User-defined properties

From Silhouette Wiki
Revision as of 19:02, 21 November 2016 by Paul (talk | contribs) (Created page with "== User=defined Properties == Properties can be created and added to objects dynamically at runtime, either from within a custom Action or in response to a hook. For instance,...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

User=defined Properties

Properties can be created and added to objects dynamically at runtime, either from within a custom Action or in response to a hook. For instance, a custom text field could be added to all Shapes when they are created in response to the object_created hook:

# set the view mode to 'Foreground' each time a 'Roto' node is selected
def nodeSelected():
    node = activeNode()
    if node != None and node.type == "RotoNode":
        fx.viewer.setViewMode(1)

fx.hooks["node_selected"] = nodeSelected