RSX Code Reference
    Preparing search index...
    • rsx
    • TemplateUtility

    Class TemplateUtility

    The TemplateUtility class provides various template specific utilities and helpers to interact with Template and SceneObject instances.

    Hierarchy (View Summary)

    Index
    • Parameters

      • OptionalisInternalConstructor: boolean

      Returns rsx.TemplateUtility

    • Updates the contents of the template with the contents of the provided template instance. If the provided object is not a template instance nothing happens. All template instances in all open scenes will have their diffs recorded, and will be updated after the apply operation is done.

      Parameters

      • sceneObject: SceneObject

        Template instance whose template to update.

      • objectTemplate: Template

        The template to apply.

      Returns UncertainAsyncOp<TemplateOperationResult, string>

      Object signaling status and return value of the operation.

    • Populates Template UUIDs of the provided scene object. The template UUIDs are taken from the provided template object UUIDs. Both of the hierarchies must match identically. Also ensures all objects in the instance hierarchy have the provided template resource UUID link, essentially breaking any nested template links.

      Parameters

      Returns void

    • Breaks the link between a template instance and its template. Object will retain all current values but will no longer be influenced by modifications to its parent template.

      Parameters

      • sceneObject: SceneObject

        Template instance whose link to break.

      Returns void

    • Creates a new template from the provided scene object hierarchy, and makes the scene object an instance of the template if succesful.

      Parameters

      • sceneObject: SceneObject

        Scene object hierarchy from which to create the template.

      • libraryPath: LibraryPath

        Virtual library path at which to store the template in.

      Returns UncertainAsyncOp<TemplateOperationResult, string>

      Object signaling status and return value of the operation.

    • Gathers all affectted SceneNodes by a template save operation.

      Parameters

      • root: SceneObject

        The root to start gathering new objects fron.

      Returns SceneNode[]

      A vector of all new scene nodes on the template instance.

    • Computes and returns a debug string representation of the template delta for the provided scene object. The delta is computed on the fly against the template version the instance was last synced to.

      Parameters

      • object: SceneObject

        Scene object to compute the template delta debug string for.

      Returns string

      Debug string of the template delta, or empty string if the object is not a template instance.

    • Returns the root object of the template instance that this object belongs to, if any.

      Parameters

      • sceneObject: SceneObject

        Scene object to retrieve the template parent for.

      Returns SceneObject

      Template parent of the provided object, or null if the object is not part of a template instance.

    • Returns the UUID of the template attached to the provided scene object.

      Parameters

      • sceneObject: SceneObject

        Scene object to retrieve the template UUID for.

      Returns UUID

      Template UUID if the object is part of a template, empty uuid otherwise.

    • Checks if a scene object has a template link. Scene objects with a template link will be automatically updated when their template changes in order to reflect its changes.

      Parameters

      • sceneObject: SceneObject

        Scene object to check if it has a template link.

      Returns boolean

      True if the object is a template instance (has a template link), false otherwise.

    • Remove any instance specific changes to the object or its hierarchy from the provided template instance and restore it to the exact copy of the linked template.

      Parameters

      Returns void

    • Updates unversioned instances of the given template across all currently loaded scenes. Instances that have a pinned template version are skipped; use UpdateInstanceFromTemplate for those.

      Parameters

      Returns void

    • Updates multiple template instances to the most recent version of the object from the template resources. Use this over updateInstanceFromTemplate if it is possible that one object has moved from one template instance to another. Calling this method with both instances instead of separate calls to updateInstanceFromTemplate ensures that UUIDs are resolved properly.

      Parameters

      Returns void

    • Updates an internal template instance (keepTemplateInternals) to the most recent version from the provided template resource. Unlike UpdateInstanceFromTemplate, this does not require template link data (OriginObjectID, templateResource) on the instance.

      Parameters

      Returns void

    • Updates unversioned instances of nestedTemplate within templateResource. Instances that have a pinned template version are skipped.

      Parameters

      Returns void

    • Updates unversioned template instances in the scene to their most recent version. Instances that have a pinned template version are skipped; use UpdateInstanceFromTemplate for those.

      Parameters

      Returns void

    onRevertedToTemplate: Event<[sceneObject: SceneObject]>

    Invoked when a scene object was reverted to the template.

    onTemplateSaved: Event<[p0: ResourceHandle<Template>]>

    Invoked when a template resource is saved.