Reader3dsNamedObjects Property |
Gets the Dictionary that can be used to access all the objects in 3ds file by its name as defined in 3d modeling application.
Namespace: Ab3d
public Dictionary<string, Object> NamedObjects { get; }
This dictionary contains object names as keys and their corresponding GeometryModel3D as values. So if you wish to change the specific object, its material or add a custom transformation you can access the GeometryModel3D with its name that is defined in 3D modeling application.
Caution |
---|
In 3ds file the names can be only 10 characters long - so if you have defined names longer than 10 characters it is recommended to use DumpNamedObjects() in immediate window to see the names as in 3ds file. |
Note |
---|
If the object has been split because multiple materials are used for one mesh object, new objects have been added and can be accessed with the key: [original_object_name]_[material_name] - for example: "head" object can be split into: "head_material1", "head_material2". |
The simplest way to get all the named objects is place a breakpoint after the 3ds file has been read and in Visual Studio in immediate window execute the DumpNamedObjects method on the Reader3ds instance.
GeometryModel3D objectHead = humanReader3ds.NamedObjects["Head"] as GeometryModel3D; SpotLight objectHead = humanReader3ds.NamedObjects["MainLight"] as SpotLight; Model3DGroup objectHead = humanReader3ds.NamedObjects[Reader3ds.AllModelsGroupName] as Model3DGroup;