Hide menu
Loading...
Searching...
No Matches
cadex.Unity_ObjectFactoryParameters Class Reference

Defines parameters used by the Unity_ObjectFactory. More...

Public Member Functions

 Unity_ObjectFactoryParameters ()
 Constructor.
 
void SetMeshQuality (MeshQuality theMQ)
 Sets the quality of mesh computed from B-Rep.
 
void SetMergeTriangleSets (bool theOption)
 Specifies whether part's triangle sets should be merged.
 
void SetMeshOptimization (bool theOption)
 Specifies whether part's triangle sets should be optimized. Warning: with this option enabled the source model can be modified.
 
void SetImportPMI (bool theOption)
 Specifies whether Product and Manufacturing Information (PMI) should be imported into GameObject from the ModelData_Model.
 
void SetAdaptToUnityCoordinateSystem (bool theOption)
 Specifies whether model should be adapted to Unity's coordinate system.
 
void SetShader (Shader theShader)
 Specifies the shader that should be applied to the result GameObject.
 
void SetScaleFactor (float theScaleFactor)
 Sets the scale factor of the imported GameObject.
 
void SetImportLODs (bool theOption)
 Specifies whether multiple Levels Of Detail (LOD) should be imported into GameObject from the ModelData_Model.
 
void SetLODsCulledTransitionValue (float theValue)
 Sets the screen relative height to use for the "Culled" state transition [0-1].
 
MeshQuality MeshQuality ()
 Returns the quality of mesh computed from B-Rep.
 
bool MergeTriangleSets ()
 Returns true if part's triangle sets should be merged during conversion.
 
bool MeshOptimization ()
 Returns true if part's triangle sets should be optimized.
 
bool ImportPMI ()
 Returns true if Product and Manufacturing Information (PMI) should be imported into GameObject from the ModelData_Model.
 
bool AdaptToUnityCoordinateSystem ()
 Returns true if model should be adapted to Unity's coordinate system.
 
Shader Shader ()
 Returns the shader used for creating GameObject.
 
float ScaleFactor ()
 Returns the scale factor of the created GameObject.
 
bool ImportLODs ()
 Returns true if multiple Levels Of Detail (LOD) should be imported into GameObject from the ModelData_Model.
 
float LODsCulledTransitionValue ()
 Returns the screen relative height to use for the "Culled" state transition [0-1].
 

Detailed Description

Defines parameters used by the Unity_ObjectFactory.

Parameters can be set using Unity_ObjectFactory::SetParameters().

Member Function Documentation

◆ AdaptToUnityCoordinateSystem()

bool cadex.Unity_ObjectFactoryParameters.AdaptToUnityCoordinateSystem ( )
inline

Returns true if model should be adapted to Unity's coordinate system.

By default is true.

◆ ImportLODs()

bool cadex.Unity_ObjectFactoryParameters.ImportLODs ( )
inline

Returns true if multiple Levels Of Detail (LOD) should be imported into GameObject from the ModelData_Model.

By default is false.

◆ ImportPMI()

bool cadex.Unity_ObjectFactoryParameters.ImportPMI ( )
inline

Returns true if Product and Manufacturing Information (PMI) should be imported into GameObject from the ModelData_Model.

By default is false.

◆ LODsCulledTransitionValue()

float cadex.Unity_ObjectFactoryParameters.LODsCulledTransitionValue ( )
inline

Returns the screen relative height to use for the "Culled" state transition [0-1].

By default is 0.05.

◆ MergeTriangleSets()

bool cadex.Unity_ObjectFactoryParameters.MergeTriangleSets ( )
inline

Returns true if part's triangle sets should be merged during conversion.

Merging triangle sets allows to reduce the number of draw calls and improve rendering performance. By default is true.

◆ MeshOptimization()

bool cadex.Unity_ObjectFactoryParameters.MeshOptimization ( )
inline

Returns true if part's triangle sets should be optimized.

Mesh optimization includes various techniques to improve rendering performance. By default is false.

◆ MeshQuality()

MeshQuality cadex.Unity_ObjectFactoryParameters.MeshQuality ( )
inline

Returns the quality of mesh computed from B-Rep.

By default is Fine.

◆ ScaleFactor()

float cadex.Unity_ObjectFactoryParameters.ScaleFactor ( )
inline

Returns the scale factor of the created GameObject.

By default is 1.

◆ SetAdaptToUnityCoordinateSystem()

void cadex.Unity_ObjectFactoryParameters.SetAdaptToUnityCoordinateSystem ( bool  theOption)
inline

Specifies whether model should be adapted to Unity's coordinate system.

CAD Exchanger internally uses right-handed coordinate system (XYZ), opposites Unity's left-handed one (XZY). Converting model "as is" leads to visual mirroring of its geometry, so setting this parameter enabled will swap Y and Z axes of the model to make it look correct in Unity. Set this parameter to false if you would like to convert the model "as is", it may be useful if the model has already been written in left-handed coordinate system.

◆ SetImportLODs()

void cadex.Unity_ObjectFactoryParameters.SetImportLODs ( bool  theOption)
inline

Specifies whether multiple Levels Of Detail (LOD) should be imported into GameObject from the ModelData_Model.

If set to true, each polygonal representation in the model will be imported as an individual LOD.

Note
Does not create new LODs. If enabled, works only with existing LOD's in the model.

◆ SetLODsCulledTransitionValue()

void cadex.Unity_ObjectFactoryParameters.SetLODsCulledTransitionValue ( float  theValue)
inline

Sets the screen relative height to use for the "Culled" state transition [0-1].

If object's height takes less than the transition value of screen height - object will become hidden(invisible). For example, the default value is 0.05, which means that is the object will not be rendered when it takes less than 5% of the screen height.

◆ SetMergeTriangleSets()

void cadex.Unity_ObjectFactoryParameters.SetMergeTriangleSets ( bool  theOption)
inline

Specifies whether part's triangle sets should be merged.

Merging triangle sets allows to reduce the number of draw calls and improve rendering performance.

◆ SetMeshOptimization()

void cadex.Unity_ObjectFactoryParameters.SetMeshOptimization ( bool  theOption)
inline

Specifies whether part's triangle sets should be optimized. Warning: with this option enabled the source model can be modified.

Mesh optimization includes various techniques to improve rendering performance.

◆ SetMeshQuality()

void cadex.Unity_ObjectFactoryParameters.SetMeshQuality ( MeshQuality  theMQ)
inline

Sets the quality of mesh computed from B-Rep.

Sets the quality of the mesh which will be computed if imported model contains only boundary representation. If the model already contains polygonal representation, then this setting is ignored and the first representation is used.

◆ SetScaleFactor()

void cadex.Unity_ObjectFactoryParameters.SetScaleFactor ( float  theScaleFactor)
inline

Sets the scale factor of the imported GameObject.

Can be used if actual model dimensions don't match the dimensions of your scene. For example, pass 10 to enlarge the model 10 times in Unity, or 0.1 to shrink it to 1/10th of its size.

Examples
Unity/Assets/Scripts/Editor/ModelLoaderWizard.cs, and Unity/Assets/Scripts/ModelLoader.cs.

◆ SetShader()

void cadex.Unity_ObjectFactoryParameters.SetShader ( Shader  theShader)
inline

Specifies the shader that should be applied to the result GameObject.

Exceptions
ArgumentExceptionif a null value is passed.
Examples
Unity/Assets/Scripts/Editor/ModelLoaderWizard.cs, and Unity/Assets/Scripts/ModelLoader.cs.

◆ Shader()

Shader cadex.Unity_ObjectFactoryParameters.Shader ( )
inline

Returns the shader used for creating GameObject.

By default is Unity's Standard shader.