top of page
fond.png

Better USD
command lines

simplifies your USD workflows across DCCs

1) How to execute command lines in Better USD

To use the command lines, you have two options:

  1. You can use them via the UI, in the Better USD console available under Windows -> Open console.
     

  2. 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.

command line dans better USD
command line dans better USD en mode standalone

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.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.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.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.setEvulationGraph(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.

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.

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.

bottom of page