SyObj Class Reference

< Previous | Contents | Manuals Home | Boris FX | Next >

SyObj Class Reference

The SyObj class is used to represent (a reference to) SynthEyes objects within the Python environment. Valid types include "TRK", "OBJ", "SHOT", "PHASE", "MESH", "LIGHT", "NOTE", "SPLINE", "LIVEPREP", "STOREPREP", "STER", "EXTRA", "GLOBAL", "SCENE".

A major goal to SyObj is to continue to refer to the same object within the SynthEyes environment even if the object is renamed or other objects are deleted within the SynthEyes environment, without notification to Python. To accomplish that, the SyObj uses a unique identifier supplied by SynthEyes that is a creation timestamp. SyObj references become invalid when a different SynthEyes scene is loaded, or if you close their owning hlev object.

For example, a reference to Tracker01 continues to refer to it if its name is changed to Tracker101. If a new scene is opened in SynthEyes, the reference to Tracker101 is now invalid, even if the new scene now contains a Tracker101, since it is the unique identifier that matters.

SyObj instances are created using indices, which is how SynthEyes keeps track of shots, objects, trackers, meshes etc internally and in the communication path, but those indices are converted to unique identifiers for permanent storage. When the index is required at a later time, it is re-determined at that time.

Attribute values can be integers, floats, strings, SyTrans transforms, points (length 2 lists), vectors (length 3 lists), transform lists (length 4 lists of 3 element lists), or SyObjs. When assigning to an attribute, or calling a function, you must supply a value of the appropriate type. Don't pass the string "10" where a numeric argument is expected, for example.

With a SyObj, you can determine or change the value of any of its Sizzle attributes, either directly or via the Get() function; for example, trk.isEnabled or trk.Get("isEnabled") . Using the Get function, an attribute name can contain multiple parts, such as cam.Get("rowP.x") or trk.Get("cam.nm") , to access subattributes easily and directly.

Important : While you can access nested attributes, you cannot change nested data elements directly, ie cam.Get("trans.rowP.x") is OK, and cam.Get("shot.cam") is OK but silly, cam.Set("trans.rowP.x", 0) will crash (assign a vector to "trans.rowP").

Animated attributes reflect the value on the current user-level frame, or you can use

SyLevel.SetSzlFrame(frm) to supply a different frame number temporarily (equivalent to the

frame variable in Sizzle). That is typically done when examining a whole series of frames, so that it can be done quickly and silently without having to repeatedly redraw the entire SynthEyes user interface.

init (hlev, type, index) Create an object. The SyLevel object (hlev) must be

supplied as the owner. The type is "TRK", "MESH", etc The index is as-used by SynthEyes, ie zero-based (whereas Sizzle indices are 1-based for convenience).

Type() The object's type, "TRK", "MESH", etc

Index() The object's index within objects of this type

UniqID() The objects' unique identifier.

Name() The object's current name within SynthEyes

SetName(nm) Change the object's name. Must be within a Begin/Accept Undo block!

Get(attrnm) Get the attribute's value (on the current or overridden frame, if it is animated). The attribute name can have multiple parts, ie the scalar "rowP.x" of a transform. You can also write obj.Get("attr") as the pithier obj.attr

GetF(frm, attrnm) Get the attribute's value on the specified frame.

Set(attrnm) Change the attribute's value (on the current or overridden frame, if animated). Must be within a Begin/Accept Undo block! Use the special methods for changing the aspect ratio of a shot, do not use this. You can also write obj.Set("attr", val) as the pithier obj.attr = val

SetF(frm, attrnm, val) Change the attribute's value on the specified frame. Must

be within a Begin/Accept Undo block!

Call(funcnm, *args) Call the specified function on this object, where *args is

any number of arguments. Must be within an Undo block if the function changes the scene. See Calling Arbitrary Sizzle Functions for more information.

MovingObjects() a list of all moving objects on this camera

Trackers() Returns the trackers attached to this object, which must be a camera or moving object (type "OBJ")

Objects() The objects on this shot

Meshes() Returns the meshes parented to this object

NewTracker() Creates a new tracker parented to this object

ReadObj(meshfilnm) Reloads this (existing) mesh from the given OBJ file.

Returns True or False accordingly.


©2023 Boris FX, Inc. — UNOFFICIAL — Converted from original PDF.