Object Name

 
 
 

Objects are referenced by name in scripting. Objects are things like models, primitives (curves, surfaces, meshes), nulls, cameras, lights, views, passes, layers, sources, and clips.

SelectObj "cone"

If an object is part of a model other than the scene root, you must also specify the model name. This is because each model has its own namespace. For example,

SelectObj "aModel.cone"

selects the object named cone in the model named aModel.

You can also use an Object List to reference multiple objects. For example, the following selects all objects in the model named "Model":

SelectObj "Model.*"

An object variable can be used in place of a fixed string. For example:

	dim aCube
	set aCube = CreatePrim( "Cube", "MeshSurface" )
	SetValue ".Name", "myFirstCube"

	' Name is the default property, so aCube, 
	' aCube.Name, and "myFirstCube" are the same thing.

	DeselectAll
	' Any of these SelectObj commands will select the 
	' cube named "myFirstCube"
	SelectObj aCube
	'SelectObj aCube.Name
	'SelectObj "myFirstCube"
Tip

To determine object names, use the Explorer to select objects and check the SelectObj command logged in the Command Box (and the History pane of the Script Editor).

Creative Commons License Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License