Twinmotion-applied materials lost with Rhino Datasmith Direct Link and layers being turned off and on

I have a project using Datasmith with Rhino 7 and Twinmotion 2024.1.2. When I apply a material in Twinmotion, and then turn the Rhino layer containing the objects off and then on, the material reverts to the Rhino-applied material. This occurs whether the material is applied in Rhino at the layer or object level, and whether the Direct Link settings are to “Keep hierarchy” or “Collapse by material.” It also does not matter if the material in Twinmotion was applied using the “Replace Material” or “Apply to Object” material application tool. Anyone else running into this? I don’t recall it happening in prior versions?

For anyone having this issue:

I posted this to support as well, and got the following reply.

When you turn the Rhino layer off, are you performing a Direct Link sync? Similarly, are you performing another sync after turning the layer back on? If so, then this is normal behavior. When you turn a layer off in Rhino and then perform a sync, as far as Twinmotion and Datasmith are concerned, the objects in that layer were deleted from the file, so the objects in Twinmotion are also deleted. When the layer is turned back on, all objects inside are treated as new objects, since they were not present in the last sync, so they will be imported with their default Rhino materials and you will need to re-apply any Twinmotion materials.

To which I replied:
This is precisely the case. This is very limiting when working with auto-sync to streamline the visualization workflow. Turning off and on layers in Rhino is a very common way to visually hide components while modeling; while autosync could be turned off to avoid this, it would still require diligence in tracking layer visibility states in Rhino at time of manual synchronization. Has there been any consideration of supporting the synchronization of layers in a direct link connection that were active at time of sync for the duration of a work session? At the time TM closes for that session, all data from layers subsequently closed in Rhino could be flushe

yes, i face issue as long time. also mapping issue and even material missing we dosn’t turn off the layer. anyone can solve this @Snaerfoell @TwinmotionProd @SupportiveEntity

Hey there @Bdx2023! Welcome back to the community! It seems like this is likely an integration bug that should be reported to the TM team. Here’s a resource that can help gather the necessary logs and report the bug directly: