get_stage_next_free_path

omni.fabric.commands.scripts.utils.get_stage_next_free_path(stage: Stage, path: Union[str, Path], prepend_default_prim: bool)

Generates a unique path for a new prim on the given stage by incrementing a numerical suffix until a free path is found.

Parameters
  • stage (usdrt.Usd.Stage) – The Fabric stage where the new prim path will be created.

  • path (Union[str, usdrt.Sdf.Path]) – The initial path for the new prim. If it’s a string, it should be a valid Fabric path.

  • prepend_default_prim (bool) – If True, the default prim’s path will be prepended to the generated path if the provided path is not already under the default prim.

Returns

A unique string path that does not correspond to an existing prim on the stage.

Return type

str

Raises

ValueError – If the provided path is not a valid Fabric path string.