Class Importer
Single-use class for importing 3D data to Unity.
This class can be used in the editor as well as in runtime, if the license requirements are met.
Inheritance
System.Object
Importer
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Assembly: cs.temp.dll.dll
Syntax
public sealed class Importer
Constructors
Importer(String, ImportSettings)
Declaration
public Importer(string file, ImportSettings importSettings)
Parameters
Type |
Name |
Description |
System.String |
file |
|
ImportSettings |
importSettings |
|
Properties
elaspedTicks
Elasped ticks since the begining of the import.
Declaration
public long elaspedTicks { get; }
Property Value
Type |
Description |
System.Int64 |
|
filePath
Declaration
public string filePath { get; set; }
Property Value
Type |
Description |
System.String |
|
gameObjectCount
Declaration
public int gameObjectCount { get; }
Property Value
Type |
Description |
System.Int32 |
|
importedModel
Declaration
public ImportStamp importedModel { get; }
Property Value
importSettings
Returns the ImportSettings reference
Declaration
public ImportSettings importSettings { get; set; }
Property Value
isAsynchronous
[Default is True]
If set to true, the import process will run as much as it can on different threads than the main one, so that it won't freeze the Editor/Application and performances are kept to the maximum.
In Asynchronous mode, it is recommended to use callback methods to get information on the import status.
Declaration
public bool isAsynchronous { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
isStopped
Declaration
public bool isStopped { get; }
Property Value
Type |
Description |
System.Boolean |
|
LatestModelImportedObject
The GameObject reference to the latest imported model. Returns null if no model was imported during this session.
Declaration
public static ImportStamp LatestModelImportedObject { get; }
Property Value
LatestModelImportedPath
The file path to the latest imported model. Returns null if no model was imported during this session.
Declaration
public static string LatestModelImportedPath { get; }
Property Value
Type |
Description |
System.String |
|
polycount
Declaration
public int polycount { get; }
Property Value
Type |
Description |
System.Int32 |
|
postprocess
Declaration
public SubProcess postprocess { get; }
Property Value
preprocess
Declaration
public SubProcess preprocess { get; }
Property Value
printMessageOnCompletion
[Default is True]
If set to true, the importer will print a message in the console on import completion.
Declaration
public bool printMessageOnCompletion { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
Methods
AddOrSetPostprocess(String, SubProcess)
Add a post-process action to run for a specific file format.
Declaration
public static void AddOrSetPostprocess(string format, SubProcess postprocessingAction)
Parameters
Type |
Name |
Description |
System.String |
format |
|
SubProcess |
postprocessingAction |
|
AddOrSetPreprocess(String, SubProcess)
Add a pre-process action to run for a specific file format.
Declaration
public static void AddOrSetPreprocess(string format, SubProcess preprocessingAction)
Parameters
Type |
Name |
Description |
System.String |
format |
|
SubProcess |
preprocessingAction |
|
AddOrSetTemplate(String, ImportSettingsTemplate)
Add a pre-process action to run for a specific file format.
Declaration
public static void AddOrSetTemplate(string format, ImportSettingsTemplate template)
Parameters
GetPostprocess(String)
Declaration
public static SubProcess GetPostprocess(string filePath)
Parameters
Type |
Name |
Description |
System.String |
filePath |
|
Returns
GetPreprocess(String)
Declaration
public static SubProcess GetPreprocess(string filePath)
Parameters
Type |
Name |
Description |
System.String |
filePath |
|
Returns
GetSettingsTemplate(String)
Declaration
public static ImportSettingsTemplate GetSettingsTemplate(string filePath)
Parameters
Type |
Name |
Description |
System.String |
filePath |
|
Returns
run()
Starts importing the file. Can be executed only once per Importer instance.
Declaration
stop()
Declaration
Events
completed
Callback function triggered when the importer has finished importing.
In Async mode, this callback is triggered only when everything is finished.
Always occurs in the main thread.
Declaration
public event GameObjectToVoidHandler completed
Event Type
Type |
Description |
GameObjectToVoidHandler |
|
failed
Callback function trigerred when the import failed
Declaration
public event ExceptionHandler failed
Event Type
progressed
Callback function triggered everytime the importer has progressed.
Always occurs in the main thread.
Declaration
public event ProgressHandler progressed
Event Type
Type |
Description |
ProgressHandler |
|