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 materials (supported materials: Builtin/Standard, URP/Lit)
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 material 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
Declaration
public Shader PointShader { get; set; }
Property Value
Type | Description |
---|---|
Shader |
PrototypesPrefabs
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 |
Reset()
Declaration
public void Reset()
ToPixyz(IList<GameObject>, MaterialSyncType, uint, Dictionary<GameObject, uint>)
Use this function if you want to convert a set of GameObjects without their sub-hierarchies. In Pixyz, each corresponding Occurrence will have no parent, no children (flattened hierarchy).
Declaration
public uint[] ToPixyz(IList<GameObject> gameObjects, SceneConverter.MaterialSyncType materialSyncType = MaterialSyncType.SyncNone, uint parent = 0, Dictionary<GameObject, uint> gameObjectToOccurrence = null)
Parameters
Type | Name | Description |
---|---|---|
IList<GameObject> | gameObjects | List of GameObjects used as flatten hierarchy |
SceneConverter.MaterialSyncType | materialSyncType | How to sync materials. |
uint | parent | |
Dictionary<GameObject, uint> | gameObjectToOccurrence |
Returns
Type | Description |
---|---|
uint[] | All id of occurrences created as a flatten hierarchy |
ToPixyz(GameObject, bool, MaterialSyncType, uint, Dictionary<GameObject, uint>)
Convert a Transform and its subtree 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 | Transform to convert. |
bool | recursive | Convert root subtree. |
SceneConverter.MaterialSyncType | materialSyncType | How to sync materials. |
uint | parent | |
Dictionary<GameObject, uint> | gameObjectToOccurrence |
Returns
Type | Description |
---|---|
uint | Id of root occurrence. |
ToUnity(uint, MeshSyncType, Dictionary<uint, Object>)
Declaration
public GameObject ToUnity(uint root, SceneConverter.MeshSyncType meshSyncType = MeshSyncType.SyncFullAndDuplicate, Dictionary<uint, Object> entityToObject = null)
Parameters
Type | Name | Description |
---|---|---|
uint | root | |
SceneConverter.MeshSyncType | meshSyncType | |
Dictionary<uint, Object> | entityToObject |
Returns
Type | Description |
---|---|
GameObject |