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

Creates ModelData_Model from GameObject. More...

Public Member Functions

delegate void AsyncEndCallback (ModelData_Model theModel)
 Delegate that is called upon the end of the ModelData_Model object creation in CreateAsync method. Resulting model is passed as a parameter to the delegate and can be used for further processing (e.g. export to one of the supported formats).
 
 Unity_ModelFactory ()
 Constructor.
 
ModelData_Model Create (GameObject theGameObject, string theName)
 Creates ModelData_Model from GameObject.
 
ModelData_Model Create (GameObject[] theGameObjects, string theName)
 Creates ModelData_Model from an array of GameObjects.
 
void CreateAsync (GameObject theGameObject, string theName, AsyncEndCallback theCallback)
 Asynchronously creates ModelData_Model from GameObject with a specified name.
 
void CreateAsync (GameObject[] theGameObjects, string theName, AsyncEndCallback theCallback)
 Asynchronously creates ModelData_Model from an array of GameObjects with a specified name.
 
void SetParameters (Unity_ModelFactoryParameters theParam)
 Sets parameters.
 
Unity_ModelFactoryParameters Parameters ()
 Returns parameters.
 
void SetProgressStatus (Base_ProgressStatus theStatus)
 Sets progress status.
 
Base_ProgressStatus ProgressStatus ()
 Returns progress status.
 
void SetProgressStatusObserver (Base_ProgressStatus.Observer theObserver)
 Sets progress status observer.
 

Detailed Description

Creates ModelData_Model from GameObject.

Provides mapping from Unity into CAD Exchanger. Translates GameObject's product structure, names, mesh geometry, and colors to the corresponding CAD Exchanger entities.

Examples
Unity/Assets/Scripts/Editor/ModelExporterWizard.cs.

Constructor & Destructor Documentation

◆ Unity_ModelFactory()

cadex.Unity_ModelFactory.Unity_ModelFactory ( )
inline

Constructor.

Exceptions
LicenseManager_LicenseErrorif no Unity add-on license was activated.

Member Function Documentation

◆ Create() [1/2]

ModelData_Model cadex.Unity_ModelFactory.Create ( GameObject  theGameObject,
string  theName 
)
inline

Creates ModelData_Model from GameObject.

Returns created ModelData_Model.

Examples
Unity/Assets/Scripts/Editor/ModelExporterWizard.cs.

◆ Create() [2/2]

ModelData_Model cadex.Unity_ModelFactory.Create ( GameObject[]  theGameObjects,
string  theName 
)
inline

Creates ModelData_Model from an array of GameObjects.

All the given GameObjects will be converted to children of a single root assembly. Returns created ModelData_Model.

◆ CreateAsync() [1/2]

void cadex.Unity_ModelFactory.CreateAsync ( GameObject  theGameObject,
string  theName,
AsyncEndCallback  theCallback 
)
inline

Asynchronously creates ModelData_Model from GameObject with a specified name.

Use this function if you'd like the main thread of Unity to be blocked for as little time as possible during the conversion. Once the conversion is finished the callback is invoked and the resulting ModelData_Model is passed to it.

◆ CreateAsync() [2/2]

void cadex.Unity_ModelFactory.CreateAsync ( GameObject[]  theGameObjects,
string  theName,
AsyncEndCallback  theCallback 
)
inline

Asynchronously creates ModelData_Model from an array of GameObjects with a specified name.

Use this function if you'd like the main thread of Unity to be blocked for as little time as possible during the conversion. Once the conversion is finished the callback is invoked and the resulting ModelData_Model is passed to it.