ドキュメント

​
​

Development

User Acquisition

Monetization

産業

Asset Transformer SDK

2026.4

サポート対象
​

User Manual

Python API

C# API

Changelog

Discussions

Asset Transformer SDK

2026.4

サポート対象
​

このページは選択した言語では使用できません。
​
​
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
    • Part
    • Metadata
    • SubpartMaterial
  • 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)

Subpart Material

SubpartMaterials are components that contain materials applied to a Part component, it provides a direct and intuitive way to control materials on subparts. This allows assigning materials on individual submesh, giving users precise control over visual appearance.
読み終わるまでの所要時間 4 分
最終更新 3ヶ月前

This component is also useful for customizing materials on instances: Each instance of a prototype can have its own
SubpartMaterial
component.

Accessing Subpart Materials

  • scene.listSubpartmaterials
  • scene.getSubpartmaterial

Setting Subpart Materials

  • scene.setSubpartMaterials
  • scene.setSubpartMaterial
重要
The number of subpart materials in a
SubpartMaterial
component must exactly match the number of submeshes in the associated part.
重要
In the UI, it is also possible to apply a subpart material to the submeshes via the “+” tab in the Occurrence Inspector.

Material Priority / Override Hierarchy

The material system follows a clear priority hierarchy, where higher levels override the ones below:
  1. Subpart Material (Highest Priority)
    Assigned directly to a subpart using code (
    setSubpartMaterial
    ). This takes precedence over all other material assignments.
  2. Occurrence Material
    Applied to a specific occurrence in the scene.
  3. Inherited Material If no material is set at the above levels, a material can be inherited from a parent node or structure in the scene tree.
  4. Submesh Material (Lowest Priority)
    The default material assigned to the submeshs(patches) during import or modeling. However, this is a legacy method and will be deprecated in future versions.

Example

Python Example: Assigning Materials to Subparts

Below are two python examples demonstrating how to assign materials to subparts using the SubpartMaterial component. The first applies materials directly on a cube. The second shows how to assign different subpart materials per instance using a shared prototype.

Apply on subparts

# Define a list of RGBA colorscolors = [ [1.0, 0.0, 0.0, 1.0], # Red [0.0, 1.0, 0.0, 1.0], # Green [0.0, 0.0, 1.0, 1.0], # Blue [1.0, 1.0, 0.0, 1.0], # Yellow [0.0, 1.0, 1.0, 1.0], # Cyan [1.0, 0.0, 1.0, 1.0], # Magenta]# Create a cube of dimensions 100x100x100cube = pxz.scene.createCube(100, 100, 100)# Set the cube's parent to the root node in the scenepxz.scene.setParent(cube, pxz.scene.getRoot())# Automatically identify patches (subparts) for material assignment. `identifyPatches` detects 6 planar faces on the cube, resulting in 6 submeshes (subparts).pxz.algo.identifyPatches([cube])# Assign a different material/color to each subpart of the cubefor i in range(6): mat = pxz.material.createMaterial(f"mat{i}", "color") pxz.material.setMaterialMainColor(mat, colors[i]) pxz.scene.setSubpartMaterial(cube, i, mat)
ヒント
algo.identifyPatches
is used to generate submeshes when geometry lacks them.

Apply on instances

# Define a list of colors for subpart materialscolors = [ [1.0, 0.0, 0.0, 1.0], # Red [0.0, 1.0, 0.0, 1.0], # Green [0.0, 0.0, 1.0, 1.0], # Blue]# Create a base cube (shared geometry for all instances)cube = pxz.scene.createCube(100, 100, 100)# Assign a default gray material to the prototype (occurrence level)default_mat = pxz.material.createMaterial("default_mat", "color")pxz.material.setMaterialMainColor(default_mat, [0.5, 0.5, 0.5, 1.0]) # Graypxz.scene.setOccurrenceMaterial(cube, default_mat)# Create three instances and assign materialsfor i in range(3): # Create a new occurrence and attach it to the scene inst = pxz.scene.createOccurrence(f"instance{i+1}") pxz.scene.setPrototype(inst, cube) pxz.scene.setParent(inst, pxz.scene.getRoot()) # Offset each instance in X (skip the first one) if i > 0: matrix = pxz.scene.getLocalMatrix(inst) matrix[0][3] += i * 150 pxz.scene.setLocalMatrix(inst, matrix) # Create and assign a unique material to subpart 0 of each instance mat = pxz.material.createMaterial(f"mat{i+1}", "color") pxz.material.setMaterialMainColor(mat, colors[i]) pxz.scene.setSubpartMaterial(inst, 0, mat)

File Format Support

The following file formats support Import and/or Export of
subpartMaterial
components:

3D Format

Import

Export

GLTF/GLB❌ Not supported✅ Supported
JT❌ Not supported✅ Supported
DAE❌ Not supported✅ Supported
USD❌ Not supported✅ Supported
FBX❌ Not supported✅ Supported
OBJ❌ Not supported✅ Supported
PDF❌ Not supported✅ Supported
PRC❌ Not supported✅ Supported
PXZ❌ Not supported✅ Supported
3DXML❌ Not supported✅ Supported
重要
❌ Not supported does not mean we do not import materials on submeshes. In many cases, materials assigned directly to submeshes are preserved. What's missing is the ability to preserve per-instance overrides — for example, if different instances of the same geomatry have different materials on the same submeshes.

Copyright © 2026 Unity Technologies
法規事項プライバシーポリシークッキーDocumentation Terms of Use私の個人情報を販売または共有しないプライバシーに関する選択 (クッキー設定)

"Unity" の名称、Unity のロゴ、およびその他の Unity の商標は、米国およびその他の国における Unity Technologies またはその関係会社の商標または登録商標です (詳しくはこちら)。その他の名称またはブランドは該当する所有者の商標です。

一部のページは利便性向上のため機械翻訳を使用しており、内容に不正確な表現が含まれる場合があります。内容に齟齬または不一致が生じた場合は、英語版を正本とします。

  • このページ
    • Accessing Subpart Materials

    • Setting Subpart Materials

    • Material Priority / Override Hierarchy

    • Example

      • Python Example: Assigning Materials to Subparts

        • Apply on subparts

        • Apply on instances

      • File Format Support


このページの問題を報告する