Class SceneConverter
Converts a scene hierarchy from Unity to Pixyz and vice versa.
Inherited Members
Namespace: UnityEditor.Pixyz.UnitySDK
Assembly: Unity.Pixyz.UnitySDK.Editor.dll
Syntax
public class SceneConverter
Properties
API
Pixyz instance to which api calls are made
Declaration
public PiXYZAPI API { get; set; }
Property Value
| Type | Description |
|---|---|
| PiXYZAPI |
EnableUndo
Use Unity undo API when converting from Pixyz to Unity.
Declaration
public bool EnableUndo { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
FetcherResolution
GBuffer render texture resolution used to convert unsupported shaders (supported shaders: BiRP/Standard)
Declaration
public int FetcherResolution { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
HierarchyLoad
Specify how the hierarchy should be synced between the engines
Declaration
public SceneConverter.HierarchyLoadType HierarchyLoad { get; set; }
Property Value
| Type | Description |
|---|---|
| SceneConverter.HierarchyLoadType |
ImportPrototypes
Create GameObjects for Pixyz prototypes. Only available at import. Editor only.
Declaration
public bool ImportPrototypes { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
LineShader
Default line shader to render lines
Declaration
public Shader LineShader { get; set; }
Property Value
| Type | Description |
|---|---|
| Shader |
OverrideShader
Shader that can override the shader used to convert Pixyz material to Unity material
Declaration
public Shader OverrideShader { get; set; }
Property Value
| Type | Description |
|---|---|
| Shader |
PointShader
Default point shader to render points
Declaration
public Shader PointShader { get; set; }
Property Value
| Type | Description |
|---|---|
| Shader |
PrototypesPrefabs
Imported prototypes as prefabs.
Declaration
public GameObject[] PrototypesPrefabs { get; }
Property Value
| Type | Description |
|---|---|
| GameObject[] |
ScaleFactor
Scale applied to Unity transform matrices and vertices when converting a Pixyz mesh to a Unity mesh
Declaration
public float ScaleFactor { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
Specular
Set this parameter to true when converting materials from a Unity builtin project to Pixyz and vice versa.
Declaration
public SceneConverter.SpecularWorkflow Specular { get; set; }
Property Value
| Type | Description |
|---|---|
| SceneConverter.SpecularWorkflow |
SyncComponents
Specify which components should be synced between Pixyz and Unity (and vice versa)
Declaration
public ComponentType[] SyncComponents { get; set; }
Property Value
| Type | Description |
|---|---|
| ComponentType[] |
SyncInactive
Sync inactive GameObjects/Occurrences
Declaration
public bool SyncInactive { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
AddTangentsRecomputeOccurrences(OccurrenceList)
When decimating, Pixyz deletes tangents and recreates them in a right handed coordinate system. SceneConverter can recalculate tangents in a left handed coordinate system.
Declaration
public void AddTangentsRecomputeOccurrences(OccurrenceList occurrences)
Parameters
| Type | Name | Description |
|---|---|---|
| OccurrenceList | occurrences | Occurrences to recompute |
Reset()
Reset SceneConverter maps in order to use it again.
Declaration
public void Reset()
ToPixyz(IList<GameObject>, bool, MaterialSyncType, uint, Dictionary<GameObject, uint>)
Use this function if you want to convert a set of GameObjects together. Not part of the same hierarchy. If recursive is set to false, each corresponding Occurrence will have no parent and no children (flattened hierarchy).
Declaration
public uint[] ToPixyz(IList<GameObject> gameObjects, bool recursive = true, SceneConverter.MaterialSyncType materialSyncType = MaterialSyncType.SyncNone, uint parent = 0, Dictionary<GameObject, uint> gameObjectToOccurrence = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IList<GameObject> | gameObjects | List of GameObjects to convert. |
| bool | recursive | Convert roots subtrees. |
| SceneConverter.MaterialSyncType | materialSyncType | How to sync materials. |
| uint | parent | Parent occurrence |
| Dictionary<GameObject, uint> | gameObjectToOccurrence | Mapping dictionary |
Returns
| Type | Description |
|---|---|
| uint[] | All id of occurrences created as a flatten hierarchy |
ToPixyz(GameObject, bool, MaterialSyncType, uint, Dictionary<GameObject, uint>)
Convert a GameObject and its sub-hierarchy to Pixyz.
Declaration
public uint ToPixyz(GameObject gameObject, bool recursive = true, SceneConverter.MaterialSyncType materialSyncType = MaterialSyncType.SyncNone, uint parent = 0, Dictionary<GameObject, uint> gameObjectToOccurrence = null)
Parameters
| Type | Name | Description |
|---|---|---|
| GameObject | gameObject | GameObject to convert. |
| bool | recursive | Convert root sub-hierarchy. |
| SceneConverter.MaterialSyncType | materialSyncType | How to sync materials. |
| uint | parent | Parent occurrence |
| Dictionary<GameObject, uint> | gameObjectToOccurrence | Mapping dictionary |
Returns
| Type | Description |
|---|---|
| uint | Root occurrence id |
ToUnity(uint, MeshSyncType, Dictionary<uint, Object>, bool)
Convert Pixyz data to Unity.
Declaration
public GameObject ToUnity(uint root, SceneConverter.MeshSyncType meshSyncType = MeshSyncType.SyncFullAndDuplicate, Dictionary<uint, Object> entityToObject = null, bool convertAssets = true)
Parameters
| Type | Name | Description |
|---|---|---|
| uint | root | Root occurrence to convert. |
| SceneConverter.MeshSyncType | meshSyncType | Describes how to sync back meshes. |
| Dictionary<uint, Object> | entityToObject | Optional entity mapping dictionary. |
| bool | convertAssets | Set to false when calling this function multiple times in a row. |
Returns
| Type | Description |
|---|---|
| GameObject | GameObject corresponding to root occurrence. |
ToUnity(OccurrenceList, MeshSyncType, Dictionary<uint, Object>)
Convert Pixyz data to Unity.
Declaration
public GameObject[] ToUnity(OccurrenceList multipleRoots, SceneConverter.MeshSyncType meshSyncType = MeshSyncType.SyncFullAndDuplicate, Dictionary<uint, Object> entityToObject = null)
Parameters
| Type | Name | Description |
|---|---|---|
| OccurrenceList | multipleRoots | Root occurrences to convert |
| SceneConverter.MeshSyncType | meshSyncType | Describes how to sync back meshes. |
| Dictionary<uint, Object> | entityToObject | Optional entity mapping dictionary. |
Returns
| Type | Description |
|---|---|
| GameObject[] | GameObjects corresponding to the root occurrences. |