
Better USD Command Line (API) Reference
simplifies your USD workflows across DCCs
1) How to execute command lines in Better USD
To use the command lines, you have two options:
-
You can use them via the UI, in the Better USD console available under Windows -> Open console.
-
Alternatively, you can use them in the "BetterUSD_standalone.bat", which will launch a Better USD instance without the UI, available only through the command line.


2) All command lines can be used in Better USD
In Better USD, you can use command lines to execute code directly through a Python console. There are many commands available that allow you to do a wide range of things and automate your workflows.
BTU Package
Module containing all sub-modules, classes, and functions to access Better USD.
​
-
btu.saveScene(file_path: str) -> return None
This method allows you to save your scene by providing the path where you want to save your Better USD scene.
​​
​
-
btu.getPathScene() -> return str
Retrieves the path of the currently opened scene.
​​
​
-
btu.openScene(file_path: str) -> return None
Allows you to open a Better USD .btu scene.
​
​
-
btu.getWorkSpace() -> return str
Retrieves the workspace folder of the DCC hosting Better USD, meaning the folder containing the scene currently opened in Maya, Houdini, Blender... Returns None when that scene has never been saved.
​​​​
​
-
btu.clearScene() -> return None
Creates a new empty scene to start from scratch.
​​
​
​
​
-
btu.createNode(nameNode: str, pos=[1.0, 1.0]: list[float, float]) -> return NodeModel
Creates a Better USD node with the given name. You can get all the names of creatable nodes by executing btu.getCallableNodes(). The pos argument is optional and sets the node’s position in the graph.
​​​​
​
-
btu.getCallableNodes() -> return list[str]
Returns a list of all node names that you can create in Better USD via command line using btu.createNode().​​
​​
​
-
btu.deleteNode(path_node: str) -> return None
Deletes a node based on its path. The first argument is the path of the node you want to delete.
​​
​
-
btu.getNode(path_node: str) -> return NodeModel
Retrieves the node class from its path. The argument is the path of the node you want to retrieve.
​​
​
-
btu.getAllNode() -> return list[NodeModel]
Retrieves all node classes present in the scene.
​
​
-
btu.getNodesSelected() -> return list[NodeModel]
Returns a list of all selected nodes in the current scene.
​​
​
​
​
-
btu.createBackdrop(list_node=[], pos=[1.0, 1.0]) -> return Backdrop
Creates a backdrop in your scene. The first argument is optional and allows you to input the nodes constrained to the backdrop. The list must contain node instances [NodeModel, NodeModel, NodeModel] — strings are not allowed. The second argument is the position of the backdrop in the scene and is optional.
​​
​
-
btu.deleteBackdrop(path_backdrop: str) -> return None
Deletes a backdrop based on its path. The argument is the path of the backdrop you want to delete.
​​
​
-
btu.getBackdrop(path_backdrop) -> return Backdrop
Retrieves the backdrop class from its path. The argument is the path of the backdrop you want to retrieve.
​​
​
-
btu.getAllBackdrop() -> return list[Backdrop]
Retrieves all backdrop classes present in the scene.
​​
-
btu.getBackdropsSelected() -> return list[Backdrop]
Returns a list of all selected backdrops in the current scene.
​
​
​
​
-
btu.connectNode(node_src: NodeModel, index_src: int, node_dst: NodeModel, index_dst: int) -> return None
Connects an output of one node to an input of another. index_src is the index of the output port on node_src, and index_dst the index of the input port on node_dst. Both nodes must be node instances (NodeModel), not paths - use btu.getNode() to retrieve them.
​
​
-
btu.disconnectNode(node_src: NodeModel, index_src: int, node_dst: NodeModel, index_dst: int) -> return None
Removes the connection between an output of node_src and an input of node_dst. The arguments are the same as btu.connectNode().
​
​
-
btu.getConnectionsSelected() -> return list[connection]
Returns a list of all selected connections in the current scene.
​​​
​​​
-
btu.cookGraph() -> return None
Re-cooks the graph to refresh all nodes and recompute their connections.
​​
​
-
btu.executeGraph() -> return None
Exports and executes all graphs present in the scene, and publishes your work in the process.
​​
​
-
btu.setEvaluationGraph(computable: bool) -> return None
Allows you to set the node graph to manual mode, preventing automatic computation of nodes and avoiding any latency or slowdown.
-
btu.getItemsSelected() -> return list[NodeModel|Backdrop|connection]
Returns a list of all selected items in the current scene (nodes, backdrops, connections, etc.)
​
​
​
​​
-
btu.enableProfiler(value: bool) -> return None
Enables or disables the node profiler, which measures the cook time of every node. It is disabled by default because it adds a small overhead to each cook.
​
​
-
btu.getReportProfiler(limit=15: int) -> return list
Returns the profiler report, sorted from the slowest node to the fastest. The optional limit argument caps the number of nodes listed, 15 by default.
​
​
-
btu.resetProfiler() -> return None
Clears every measurement collected so far by the profiler, without disabling it.
​
​
​
​
-
btu.enableHooksManager(value: bool) -> return None
allows you to disable hook activation in Better USD
​
​
-
btu.isEnableHookManager() -> return bool
return if hook manager is activation in Better USD
​
​
-
btu.reloadAllHooks() -> return bool
allows you to reload all the hooks in your files and also lets you add hooks that were added after Better USD started
​
​
​​
​
-
btu.getCurrentFrame() -> return int
Returns the current frame of the DCC hosting Better USD.
​
​
-
btu.setCurrentFrame(value: int) -> return None
Moves the DCC hosting Better USD to the given frame.
​
​
-
btu.getStartFrame() -> return int
Returns the first frame of the frame range of the DCC hosting Better USD.
​
​
-
btu.setStartFrame(value: int) -> return None
Sets the first frame of the frame range of the DCC hosting Better USD.
​
​
-
btu.getEndFrame() -> return int
Returns the last frame of the frame range of the DCC hosting Better USD.
​
​
-
btu.setEndFrame(value: int) -> return None
Sets the last frame of the frame range of the DCC hosting Better USD.
​
​
​
​​
-
btu.getDataContextFile() -> return dict
Returns the whole ContextFile table, which maps each path pattern to the list of .btu scenes proposed when a DCC scene path matches that pattern.
​
​
-
btu.setDataContextFile(data_set: dict) -> return None
Replaces the whole ContextFile table at once. The argument must be a dict whose values are lists of .btu paths, example {'partern':['your/file/A.btu'], 'partern':['your/file/B.btu']}.
​
​
-
btu.setDataContextFileFromPattern(pattern: str, values: list[str]) -> return None
Adds or replaces a single entry of the ContextFile table, leaving the other patterns untouched. The values must be a list of .btu files, example ['your/file/A.btu', 'your/file/B.btu'].
​
​
-
btu.resolveDataContextFileFromPath(path: str) -> return list[str]
Returns the list of .btu scenes associated with the given path, by matching that path against every pattern of the ContextFile table.​​​​
NodeModel Class
The base class for all nodes in Better USD. An instance of this class corresponds to exactly one instance of a node in Better USD.
​​​
-
setPosition(new_position: list[int, int]) -> return None
Allows you to change the position of the node in the scene.
​​
​
-
getPosition() -> return list[int, int]
Retrieves the position of the node in the scene.
​​
​
-
setColor(new_color: list[int, int, int]) -> return None
Allows you to change the color of the node in the scene. Values are in RGB from 0 to 255.
​​
​
-
getColor() -> return list[int, int, int]
Retrieves the color of the node in the scene.
​​
​
-
byPassNode(value: bool) -> return None
Sets the node to bypass mode to prevent it from being computed.
​​
​
-
getByPassNode() -> return bool
Returns whether the node is in bypass mode or not.
​​
​
-
copyParameter() -> return parameterPack
Copies all parameter information from the node so you can paste it into another node. Works with pastParameter().
​​
​
-
pastParameter(parameter: parameterPack) -> return None
Pastes parameters from a copied node into this node. Works with copyParameter().
​​
​
-
setConnection(output_index: int, node_dst: NodeModel, input_index: int) -> return None
Connects the output of this node to the input of another node.
​​
​
-
setName(new_name: str) -> return None
Changes the name of the node. If a node with the same name already exists, a number will be added at the end.
-
setSelected(value: bool) -> return None
This command allows you to change an item's selection state.
-
getSelected() -> return bool
This command returns whether an item is currently selected.​
ContainerModel Class
The base class for all (backdrops, nameTags, etc..) in Better USD. An instance of this class corresponds to exactly one instance of a (backdrops, nameTags, etc..) in Better USD.
​​​
-
addNode(node: NodeModel) -> return None
Adds a node to the container so that it is constrained to the container. When the container moves, the node will move with it.
​​
​
-
removeNode(node: NodeModel) -> return None
Removes a node constrained to the container, breaking the link between the node and the container.
​​
​
-
clearAllChildrenNode() -> return None
Removes all nodes that are constrained by the container.
​​
​
-
setPosition(new_position: list[int, int]) -> return None
Changes the position of the container in the scene.
​​
​
-
getPosition() -> return list[int, int]
Retrieves the position of the container in the scene.
​​
​
-
setSize(new_size: list[float, float]) -> return None
Changes the size (width and height) of the container in the scene.
​​
​
-
getSize() -> return list[float, float]
Retrieves the size (width and height) of the container in the scene.
​​
​
-
setColor(new_color: list[int, int, int]) -> return None
Changes the color of the container in the scene. Values are RGB from 0 to 255.
​​
​
-
getColor() -> return list[int, int, int]
Retrieves the color of the container in the scene.
​​
​
-
setName(new_name: str) -> return None
Changes the name of the container. If a container with the same name already exists, a number will be added at the end.
-
setSelected(value: bool) -> return None
This command allows you to change an item's selection state.
-
getSelected() -> return bool
This command returns whether an item is currently selected.

