< Previous | Contents | Manuals Home | Boris FX | Next >
Object Lists, Objects, and Attributes
Sizzle uses objects and attributes to represent entities within SynthEyes, such as trackers and cameras. A camera has attributes including its position and focal length, while a tracker provides attributes about its position in the world and the image plane.
The object attributes are accessed as ob.nm or ob.x , for example, or indirectly with ob.$chan where chan is “x”, “y”, or “z”. Some attributes may themselves be lists, such as Shot[1].obj[1].trk, the list of trackers on the first object of the first shot.
If the attribute is animated, the built-in variable frame specifies the current frame to be used. The frame variable is initialized at the current frame in the user interface when a script starts up, but changing the frame variable does not affect the user interface [use Scene.SetFrame(#)]. This compact style (vs repetitive subscripting) can be seen in the "First Example" section above. The frame variable, and all frame-valued object attributes, always start at frame zero, corresponding to the first frame in the shot imagery, regardless of any shot start/end setting. To produce a frame number corresponding to what the user sees, check Scene.startFrame, Scene.matchFrameNumbers, and Shot.frameMatchOffset.
A script accesses the objects using Object Lists. There is an object list for each of the major types of objects within SynthEyes, such as the Obj, Trk, and Shot lists.
Each object in a list can be grabbed using subscripting: Obj[1] is the first object(typically a camera), Trk[5] is the 5 th tracker. Often, a loop such as for (ob in Obj) … end will let you loop over each object without subscripting.
The Obj list, Mesh list, Shot.preset and Obj.trk lists permit subscripting by an object name, for example, Obj[“Camera01”].trk[“Tracker1”] returns an object representing Tracker1 on Camera01. Note that this style is rarely necessary―it
is inefficient and object names should not be burned into scripts―but lookups by name can be very helpful in import scripts.
You can create new objects using the new operator, which is applied only to lists, and only to those lists indicated in the reference below. For example, new Lite creates a new light and returns it for further manipulation. Objects are created with default attribute values determined by SynthEyes.
You can delete cameras, objects, trackers, meshes, lights, shot presets, or extra points using the delete operator, for example, delete tk to delete a tracker. All trackers must be deleted from an object for it to be deleted; cameras must have all attached moving objects deleted also.
Deletions are not actually performed until after the completion of the script—objects to be deleted are tagged for deletion, but remain accessible and are still counted as a member of their list. If you delete tracker1, it will still appear in Camera01.trk and be counted in #Camera01.trk.
You can determine if a particular object has been tagged for deletion by using its .willDelete attribute. Since you can change this attribute, you can use it as an alternate way to delete an object. You can even use it to undelete an object.
As a convenience, deleted objects are not included if you use for (…in…)
loops. If you want to see deleted objects in a loop, use for(i=1; i <= #list; i++) .
©2023 Boris FX, Inc. — UNOFFICIAL — Converted from original PDF.