/*
The Parent3DObject property can be very useful when dealing with cluster properties or
other objects that are buried deep in a hierarchy.
*/
NewScene( null, false );
var oModel = Application.ActiveSceneRoot.AddModel();
oModel.Name = "MyModel";
var obj = oModel.AddGeometry( "Cube", "MeshSurface" );
// Add a textured image to the polygon mesh
BlendInTextureLayers( "Image", obj, 1, true, siReplaceAndNoBlendInTextureLayers );
obj.ActivePrimitive.Geometry.AddCluster( siSampledPointCluster, "TextureCluster" );
GenerateUniqueUVs( obj, "TextureProperty" );
SetInstanceDataValue( obj, obj.Material + ".Phong.Image.tspace_id", "TextureProperty" );
// Get at the uv property
var oUVProperty = Dictionary.GetObject( obj + ".polymsh.cls.TextureCluster.TextureProperty" );
// Which 3dobject does the UVProperty belong to?
var o3DObject = oUVProperty.Parent3DObject;
Application.LogMessage( "UV Property belongs to : " + o3DObject.FullName );
// Expected Result:
//INFO : UV Property belongs to : MyModel.cube |