Reimport DXF: changed materials

I'm exporting AutoCAD models to Twinmotion using DXF (only possibility). In AutoCAD objects are on layers. I import using 'Keep Hierarchy' so the objects (all entities from a single layer merged) in Twinmotion keep there AutoCAD layer names as name. Entities in AutoCAD does not have a material attached and are all 'color by layer'.

After import multiple objects have the same material-id, wich is unwanted for my workflow. Giving every layer in AutoCAD a unique color seemed te resolve this problem.

When adding some layers with entities en reimport the file, Twinmotion assigns different material-id to the objects so I have to assign materials again.

My question basicly: What is the logic for Twinmotion for assigning material-ids? The first imported layer is material 01, the second material 02 ect.? But if that's the case: hwo can sometimes different objects have the same material-id?

Hello ,

Thank you for posting in the community and the logic for Twinmotion is determined by the Collapse Method you choose, if you want to import elements and group them by the material then you should use Collapse by Material, otherwise if you use Keep Hierarchy each element will be imported and the material will not be linked to each element thus having to reapply the proper materials to new elements coming in.

Collapse Methods Details:

Keep hierarchy

Select this option to retain the same geometry hierarchy that is used in your source file. In Twinmotion, all objects will be separate and have their own pivot point, so you can move and manipulate them independently. Selecting this option also allows you to view BIM information for each element in your scene.

This option is useful if you want to create phasing groups and scene states. All objects inside your scene will be separate, making it possible to hide and show them as needed.

Retaining hierarchy is also useful if your scene contains place-holder objects that need to be replaced by Twinmotion objects, as you will need each object to be separate.

Note: Although keeping the hierarchy is sometimes necessary, selecting this option will increase the size of your scene in Twinmotion.

Collapse by material

This is the recommended option and is selected by default.

This option optimizes the model for real-time rendering, as it reduces the number of objects that are imported into Twinmotion — all objects that use the same material are collapsed into one single group. If a material is modified on any of the objects in the group, it will also be modified on all objects in the group.

Collapse all

Select this option to import objects or scenes as a whole. In Twinmotion, the entire object or scene will be grouped as one element and controlled by one pivot point only, making it easier to move, select, or delete, or to save in the User Library.

Hope this makes sense and let me know if you are still having issues if you picked Collapse by Material?

Kind regards,

Vincent B.

Hello Vincent,

Thanks for the response. I use the 'Keep hierarchy', but I have te same problem with 'Collapse by material'. The problem is there are no materials in DXF and I think layer names are used to assign materials although color of the layer also maybe used in some way.

I have a DXF file with on each layer (Lay1, Lay2, Lay3, Lay4 and Lay5) there is 1 object (color by layer). Import with 'Keep hierarchy' in Twinmotion and assign the materials, say:

Lay1 - Gold

Lay2 - Silver

Lay3 - Bronze

Lay4 - Chrome

Lay5 - Carbon

Now, in my DXF I rename Lay2 => Lay6 and re-import. What I expect to happen is that materials are linked to the objectnames (eg. autocad layers):

Lay1 - Gold

Lay3 - Bronze

Lay4 - Chrome

Lay5 - Carbon

Lay6 - <new imported material>

But what actualy happend:

Lay1 - Gold

Lay3 - Silver

Lay4 - Bronze

Lay5 - Chrome

Lay6 - Carbon

So I can never delete a layer, rename a layer or even create a new layer and than reimport without to reassign all materials beyond the deleted/renamed/new layer (Lay3 in the example)

Kind regards,

BrokenTable