Skip to main content

Support for Object Reference Properties

It is possible to assign object reference data types to script properties. Once a script has been assigned to a script component, the property panel of the ScriptComponent is populated with properties exposed by the Script. Dragging an object on a ScriptComponent would set a reference property, if any reference property of the dragged object type is exposed by the ScriptComponent.

When defining reference parameters in the Script, they become available on every script component that uses that script. Each reference parameters has a tooltip indicating where to attach items from.

Scripts already support a number of property types to be configured in SceneComposer. Candera ScriptSystem has additional support for using CanderaObject references inside scripts.

 return {
    Init = Init,
    Update = Update,
|
    rorateValue = 3.0,
    GetName = GetName
    }

As can be noticed in the example above, a float property used in a script results in a editable dynamic property:

drawing-7-1676350358.png

In a similar way, a reference property should be configurable in the property panel:

drawing-7-1676350403.png

shall result in: 

drawing-7-1676350416.png

Supported References

The following references are supported:

  • Animation and AnimationGroups (from solution. control node animations are not supported) 
  • Appearance and Appearance collections (from the solution. Appearance collection is preferred to have instance sharing enabled). Appearances/Appearance collections attached to nodes are not supported 
  • 3D camera 
  • 3D light 
  • 3D node (any type) 
  • 2D camera 
  • 2D node (any type) 
  • RenderTarget (must be a 3D render target type) 

Reference parameters are not editable when pausing the script (only the value ones). References inside controls are not supported.