Documentation

​
​

Development

User Acquisition

Monetization

Industry

Asset Transformer Studio

2026.5.0

Supported
​

User Manual

Python API

Changelog

Asset Transformer Studio

2026.5.0

Supported
​

​
​
Get started
  • About Asset Transformer Studio
  • Getting started
  • Additional Resources
User Interface
  • Overview
  • Menu Bar
  • Toolbars
  • Window
  • Customizing the User Interface
Data Preparation Fundamentals
  • Overview
  • General Information
  • Typical Data Preparation Workflow
  • About 3D Models Types
  • About the Product Structure (Tree)
  • About Occurrences
  • About Instances & Prototypes
  • About Face and Vertex Normals
  • About UVs
  • About Tessellation
  • About Decimation
  • About Animation
  • Glossary
Working With Asset Transformer Studio
  • Overview
  • Videos and Tutorials
  • Supported File Formats
  • Importing Files
  • Exporting Files
  • Scripting With the Python API
    • Getting Started With Scripting
    • Creating and Using Scripts
    • Sample Scripts
    • Basic Structures in a Scene
    • Product Structure Management
    • Filter Expressions
  • Interrupting a Process
  • Plugins
  • Errors in Asset Transformer Studio
Python API Reference
  • Overview
Changelog
  • Changelog
  1. Asset Transformer Studio
  2. Working With Asset Transformer Studio
  3. Scripting With the Python API

Product Structure Management

How to handle Product Structure entities with Python scripting in Asset Transformer Studio
Read time 1 minute
Last updated 10 hours ago

Check the following examples to learn how to handle entities of the Product Structure (or Scene tree) with Python scripting.

Parsing scene tree

scene.getRoot() scene.getChildren(occurrence) scene.getParent(occurrence) scene.hasComponent(occurrence, scene.ComponentType.Part) scene.getComponent(occurrence, scene.ComponentType.Part)

Example

def traverseTree(occurrence): print("Occurrence " + str(occurrence)) if scene.hasComponent(occurrence, scene.ComponentType.Part): print("-> has part") for child in scene.getChildren(occurrence): traverseTree(child) traverseTree(scene.getRoot())

Node creation

scene.createOccurrence() scene.addComponent(occurrence, componentType) scene.prototypeSubTree(occurrence) scene.setParent(occurrence, parent) scene.setLocalMatrix(occurrence, matrix)

Example

part = scene.createOccurrence("Part1") scene.addComponent(part, scene.ComponentType.Part) instance1 = scene.prototypeSubTree(part) instance2 = scene.prototypeSubTree(part) assembly = scene.createOccurrence("Assembly") scene.setParent(instance1, assembly) scene.setParent(instance2, assembly) scene.setParent(assembly, scene.getRoot())
Node creation example

Accessing part geometry

scene.getPartActiveShape(part)
For TessellatedShape type:
tessellation = scene.getPartMesh(shape) polygonal.getMeshDefinitions(tessellation) polygonal.createMeshFromDefinition(meshDefinition)
For BRepShape type:
scene.getPartModel(shape)

Simple CAD geometry example

torus = pxz.cad.createBRepTorus(100,10) model = cad.createModel() cad.addBodyToModel(torus, model) occurrence = scene.createOccurrence("Torus") part = scene.addComponent(occurrence, scene.ComponentType.Part) scene.setPartModel(part, model) scene.setParent(occurrence, scene.getRoot()) algo.tessellate([occurrence], 0.200000, -1, -1)

Properties

Not all entity types support custom properties.
core.supportCustomProperties(entity) core.addCustomProperty(node, "propertyName", "propertyValue") core.getProperty(node, "property") # like any other built-in property scene.getMetadata(occurrence, propertyName)

Find nodes by properties

scene.findPartOccurrencesByActiveMaterial() scene.findOccurrencesByProperty("propertyName", "regex") scene.findMaterialsByProperty("propertyName", "regex") scene.findOccurrencesByMetadata("propertyName", "regex") # ECMAScript type regex

Copyright © 2026 Unity Technologies
LegalPrivacy PolicyCookiesDocumentation Terms of UseDo Not Sell or Share My Personal InformationYour Privacy Choices (Cookie Settings)

"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S and elsewhere (more info here). Other names or brands are trademarks of their respective owners.

Some pages are machine-translated for convenience, and may contain inaccuracies. In the event of conflicting information, the English version is authoritative.

  • On this page
    • Parsing scene tree

      • Example

    • Node creation

      • Example

    • Accessing part geometry

      • Simple CAD geometry example

    • Properties

    • Find nodes by properties