Documentation

Development

User Acquisition

Monetization

Industry

Asset Transformer SDK

2026.1

Supported
​

User Manual

Python API

C# API

Changelog

Discussions

Asset Transformer SDK

2026.1

Supported
​

​
​
Get started
  • System requirements
  • Licensing
  • Setup
  • Migrate from Scenario Processor
Framework
  • Framework
  • Preferences
Input/output files
  • Supported formats
  • Import files
  • Export files
  • Export textures
  • CAD vs Mesh
Scene
  • Product structure
  • Occurrence
  • Component
  • Material
  • Image
Algorithms
  • CAD
  • Healing
  • Optimization
  • Combine and bake
  • Reconstruction
  • UVs
Viewer
  • Viewer
Pixyz UI
  • Setup
  • Overview
  • Create a custom UI
Guidelines
  • Data preparation
  • Process point clouds
Debug and diagnose
  • Log files
  • Debug best practices
Other
  • Samples
  • Glossary
  1. Asset Transformer SDK (ex Pixyz)

Product structure

Use this feature to manage and manipulate the product structure of 3D scenes, including creating hierarchies, sorting occurrences, and optimizing for performance.
Read time 2 minutes
Last updated 9 months ago

API functions:
  • scene.getChildren
  • scene.getParent
  • scene.setParent
  • scene.getOccurrenceName
Product structure is the scene hierarchy of occurrences. It can be seen as a tree where we can go down to the leaf using scene.getChildren and go up to the root using scene.getParent.
We can manipulate this product structure to change order and parenting relations between occurences.
Note
The most complex the product structure is, the less performant will be algorithms to search something in the scene. A complex hierarchy can also have an impact in terms of real time rendering performances. Cleaning and simplifying a complex product structure is an important process to export performant 3D assets.

Code example

Create new occurrences

Let's take an example where we create a new product structure from scratch to match the following tree:
Root|- zz|- |- t|- |- n|- a|- b
def createTestProductStructure(): root = scene.getRoot() zz_occurrence = scene.createOccurrence(name="zz", parent=root) t_occurrence = scene.createOccurrence(name="t", parent=zz_occurrence) n_occurrence = scene.createOccurrence(name="n", parent=zz_occurrence) a_occurrence = scene.createOccurrence(name="a", parent=root) b_occurrence = scene.createOccurrence(name="b", parent=root)

Print the hierarchy tree

We want to be able to print the name of each occurrence and have the same representation in the console than the structure described above.
# Go through the product structure using "depth first" recursive methoddef dfPrintOccurrencesName(offset, occurrence): print(offset + scene.getOccurrenceName(occurrence)) offset = offset + " |- " for child in scene.getChildren(occurrence): dfPrintOccurrencesName(offset, child)

Manipulate the product structure

We want to manipulate the created hierarchy to sort the occurrences based on the alphabetical order of their names.
# Sort a product structure based on occurrences name alphabetical orderdef sortOccurrencesRecursively(occurrence): children = scene.getChildren(occurrence) if not children: return names = core.getProperties(children, "Name") # This built-in method retrieve all the names of an occurrence list children_with_names = zip(children, names) sorted_children_with_names = sorted(children_with_names, key=lambda x: x[1]) sorted_children = [child for child, name in sorted_children_with_names] for child in sorted_children: sortRecursively(child) scene.setParent(child, occurrence)

Output

Root|- a|- b|- zz|- |- n|- |- t

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
    • Code example

      • Create new occurrences

      • Print the hierarchy tree

      • Manipulate the product structure

        • Output


Report a problem with this page
​
​