Subnode Namespace Reference

Functions

bool importPegTransformations (String filePath)
 Import transformation data from a USD (Universal Scene Description) or Autodesk Maya ATOM (Animation Transfer Object Model) file into matching scene nodes. More...
 
bool exportPegTransformations (String filePath, Object options={})
 Export transformation data from scene nodes to a USD (Universal Scene Description) or Autodesk Maya ATOM (Animation Transfer Object Model) file. More...
 
bool importTransformations (String node, String filePath)
 Import transformation data from USD (Universal Scene Description) or Autodesk Maya ATOM (Animation Transfer Object Model) files into a SubNodeMotion node. More...
 
bool exportTransformations (String node, String filePath, Object options={})
 Export transformation data from a SubNodeMotion node to a USD (Universal Scene Description) or Autodesk Maya ATOM (Animation Transfer Object Model) file. More...
 
bool deleteTransformations (String node)
 Delete the transformation data from a SubNodeMotion node. More...
 
bool deleteKeyframes (String node)
 Delete transformation timeline keyframes from a SubNodeMotion node. More...
 

Function Documentation

◆ deleteKeyframes()

bool Subnode::deleteKeyframes ( String  node)

Delete transformation timeline keyframes from a SubNodeMotion node.

This will delete timeline keyframes from the SubNodeMotion node. The imported transformation data will not be affected.

Parameters
nodeThe path to the SubNodeMotion node.
Returns
true if the keyframes were deleted successfully. Otherwise false.

◆ deleteTransformations()

bool Subnode::deleteTransformations ( String  node)

Delete the transformation data from a SubNodeMotion node.

This will delete the transformation data from the SubNodeMotion node. Timeline keyframes will be deleted as well.

Parameters
nodeThe path to the SubNodeMotion node.
Returns
true if the transformations were deleted successfully. Otherwise false.

◆ exportPegTransformations()

bool Subnode::exportPegTransformations ( String  filePath,
Object  options = {} 
)

Export transformation data from scene nodes to a USD (Universal Scene Description) or Autodesk Maya ATOM (Animation Transfer Object Model) file.

Example use:

var ok = Subnode.exportPegTransformations("/assets/animation.atom", { overwriteExistingFile: true });
if (!ok)
MessageLog.trace("Peg transformations export failed!");
Parameters
filePathFile path for the USD or ATOM file to export transformation data to. The file type is determined from the file extension (e.g. ".usd" or ".atom")
options(Optional) A dictionary object containing options for the export.
Accepted options are:
Property Type Description
overwriteExistingFile Boolean (Optional) Overwrite file if it already exists. Default is false.
Returns
true if the data was exported successfully. Otherwise false.

◆ exportTransformations()

bool Subnode::exportTransformations ( String  node,
String  filePath,
Object  options = {} 
)

Export transformation data from a SubNodeMotion node to a USD (Universal Scene Description) or Autodesk Maya ATOM (Animation Transfer Object Model) file.

By default, an existing file will not be overwritten. Use the overwriteExistingFile property for the options parameter if you want to replace data in an existing file.

var selNode = selection.selectedNode(0);
var selType = node.type(selNode);
if (selType == "SubNodeMotion")
{
if (!Subnode.exportTransformations(selNode, "/assets/walk_animation.usda", { usdIncludeModelAsSublayer: true, overwriteExistingFile: true }))
MessageLog.trace("Export failed!");
}
Parameters
nodeThe path to the SubNodeMotion node.
filePathFile path for the USD or ATOM file to export transformation data to. The file type is determined from the file extension (e.g. ".usd" or ".atom")
options(Optional) An export options object with the following properties:
Property Type Description
overwriteExistingFile Boolean (Optional) Overwrite a file if it already exists. Default value is false.
usdIncludeModelAsSublayer Boolean (Optional) The exported USD file containing the animation data will reference the original USD model (file) as sub-layer. Default value is false.
Returns
true if the data was imported successfully. Otherwise false.

◆ importPegTransformations()

bool Subnode::importPegTransformations ( String  filePath)

Import transformation data from a USD (Universal Scene Description) or Autodesk Maya ATOM (Animation Transfer Object Model) file into matching scene nodes.

Parameters
filePathFile path for the USD or ATOM file to import transformation data from. The file type is determined from the file extension (e.g. ".usd" or ".atom")
Returns
true if the data was imported successfully. Otherwise false.

◆ importTransformations()

bool Subnode::importTransformations ( String  node,
String  filePath 
)

Import transformation data from USD (Universal Scene Description) or Autodesk Maya ATOM (Animation Transfer Object Model) files into a SubNodeMotion node.

var selNode = selection.selectedNode(0);
var selType = node.type(selNode);
if (selType == "SubNodeMotion")
{
if (!Subnode.importTransformations(selNode, "/Assets/walk_animation.atom"))
MessageLog.trace("Import failed!");
}
Parameters
nodeThe path to the SubNodeMotion node.
filePathFile path for the USD or ATOM file to import transformation data from. The file type is determined from the file extension (e.g. ".usd" or ".atom")
Returns
true if the data was exported successfully. Otherwise false.