String Expressions

 
 
 

Scripting commands that apply to scene elements (such as objects, components, and parameters) use string arguments to identify the scene elements.

For example, the InspectObj command takes a name as its first argument:

InspectObj "aCube.length"

Using a simple syntax, you can write strings to reference any of the scene elements:

There is also a special syntax for referencing connection set, Element Types, lists of scene objects (Object List) and lists of marked parameters (Marked Parameter List). For example, the following selects all objects whose names begin with "right":

SelectObj "right*"

These rules are summarized in the table below, and are discussed in more detail in the sections that follow.

Character(s)

Meaning

,

Separates items in a list. For example, "mycube.kine.local.posx, mycube.kine.local.posy, mycube.kine.local.posz"

{ }

Specifies a list of objects. For example, "{cube, sphere}.kine.local.posx" selects the local X position of the cube and sphere objects.

B:

Denotes branch-selection. For example, DeleteObj "B:cone" deletes the object named cone and its children.

*

Matches one or more characters. For example:

  • "Views.ViewA.*Camera" matches all cameras of view A.

  • "Passes.MyPass.*" matches all partitions under "MyPass".

  • "Layers.MyLayer.*" matches all objects in "MyLayer".

  • "cube*" matches all objects whose names begin with "cube".

  • "Cone.pnt[*]" matches all the points on the object. This is the same as "Cone.point[0-LAST]".

/

A marking list for a command. Separates a list of objects and a list of animatable parameters. For example, the command AddFCurve "cone*/kine.local.pos" adds fcurves to the local position parameters of all objects whose names begin with the letters "cone".

#

Used to reference types of objects:

  • SelectObj "*.#override*" selects all overrides in the scene.

  • SelectObj "*.#model*" selects all models in the scene.

  • SelectObj "*.#3dobject*" selects all 3D objects in the scene.

  • SelectObj "*.#pass*" selects all passes in the scene.

  • SelectObj "*.#group*" selects all groups in the scene.