Skip to content
AlphaToolBox3D is in early alpha: features are incomplete and things can break. Use it at your own risk and keep copies of your files. Report a problem
ToolBox3D

Docs · Python API

tb.ops.model

3 operations. Without targets=, an operation works on the current selection, like its button in the editor.

Import Model

tb.ops.model.import_(*, staged: str) -> Result

Add a parsed 3D file's hierarchy, meshes, curves, materials and textures to the scene. Skeleton, skin weights and clips are not imported into the Model editor.

  • Operation model.import
  • In Model
ArgumentTypeDefaultDescription
stagedstrrequiredToken from tb_api::stage_import (the parsed file).

Model Mode

tb.ops.model.mode(
    *,
    mode: Literal["model", "uv", "material", "clothing"] = ...,
    clear_physics: bool = ...,
) -> Result

Switch the Model editor between its modes (Model, UV, Material, Clothing), or read the current one (leave out mode). Modes only change what the editor shows: every operation runs in any mode. Entering UV shows the UV editor pane, leaving UV hides it. Entering Clothing opens a garment around the selected meshes unless one is open; leaving it parks the garment until you come back.

  • Operation model.mode
  • In Model
ArgumentTypeDefaultDescription
modeLiteral["model", "uv", "material", "clothing"]—The mode to show; leave out to read the current mode. (model / uv / material / clothing).
clear_physicsbool—Entering Clothing: first end the Physics World session, whose simulated objects otherwise refuse the garment.

Reimport Model

tb.ops.model.reimport(*, staged: str, nodes: Sequence[ObjectRef] = ...) -> Result

Replace the geometry of mesh objects with the meshes of a changed file, keeping each object's name, materials and texture sets; each object follows only the file's change of its placement since the last import (moves made here stay). A mesh in the file replaces the object with the same name; a file with one mesh replaces the one object asked for. Texture Paint then offers Keep Strokes, which moves the paint to the new surface. One undo step.

  • Operation model.reimport
  • In Model
ArgumentTypeDefaultDescription
stagedstrrequiredToken from tb_api::stage_import (the parsed file).
nodesSequence[ObjectRef]—Objects to replace (default: the selected objects, else every object a mesh in the file names).