3D Plugins – 3D Object Naming Scheme

See 3D Plugin Template to get started.

Every 3D Object has a name or ID that can be used in code. It is designed to identify the 3D Object, Instance, parent 3D Object, and Instance of the Parent (and sometimes additional information about the object as needed).

 

For example:

A sample box that is part of a Building:

buildingmolds-104-lc78zuy3i096ii5m-2-u6drrcc8r789da3r-box

 

buildingmolds – identifies the Mold Group or item type. This is also helps identify the JavaScript Array holding the object definition. (WTW.buildingMolds in this case).

104 – this number provides the Instance of the Object and defines the Index number for the Array. (WTW.buildingMolds[104] provides the full 3D Object definition).

lc78zuy3i096ii5m – this is the unique ID for the 3D Object definition. This is the value used in the database as the Key Value. (select * from wtw_buildingmolds where buildingmoldid = ‘lc78zuy3i096ii5m’;)

2 – this number provides the Instance of the parent 3D Object and defines the Index number for the Array. By default, 3D Objects are parented to the WTW.connectingGrid Array 3D Object, therefore, WTW.connectingGrid[2] provides the full parent 3D Object definition. Note that it may be parented to an Action Zone (WTW.actionZones[2]) if part of a moving 3D Object like a swinging or sliding Door.

u6drrcc8r789da3r – this is the unique ID for the parent 3D Object definition. This is the value used in the database as the Key Value. (select * from wtw_connectinggrids where connectinggridid = ‘u6drrcc8r789da3r’;)

box – optional additional data about the object or state of the object. It may show the shape, hover condition,  or other identifying “current state” data.

 

There is a useful JavaScript  function WTW.getMoldnameParts() you can use to pull the parts of the name:

let moldname = ‘buildingmolds-104-lc78zuy3i096ii5m-2-u6drrcc8r789da3r-box’;

let moldnameparts = WTW.getMoldnameParts(moldname);

/* you can get the following values:

          moldnameparts.moldname is the moldname like above

          moldnameparts.moldind is the index number for the mold array

          moldnameparts.moldid is the unique ID of the mold (database table key value reference)

          moldnameparts.cgind is the connecting grid index number (WTW.connectingGrids[moldnameparts.cgind] gives you the 3D Object definition)

          moldnameparts.cgid is the unique ID of the Connecting Grid (database table key value reference)

          moldnameparts.communityid is the unique ID for the 3D Community related to this 3D Object (only has a value when is a WTW.communityMolds).

          moldnameparts.buildingid is the unique ID for the 3D Building related to this 3D Object (only has a value when is a WTW.buildingMolds).

          moldnameparts.thingid is the unique ID for the 3D Thing related to this 3D Object (only has a value when is a WTW.thingMolds).

          moldnameparts.moldgroup identifies what kind of 3D object it is; building, community, or thing.

          moldnameparts.molds is the Array for the Mold; WTW.communityMolds, WTW.buildingMolds, or WTW.thingMolds.

          moldnameparts.shape is the Mold shape which identifies the function used to create the Mold (mesh).

          moldnameparts.namepart is an array of the segments of the name split by the hyphen ‘-‘. This is useful for checking the additional optional values and current state.

          moldnameparts.parentname is the full name of the parent 3D Object.

*/

Leave a Reply