Importer Class
The scope of applications for UnigineScript is limited to implementing materials-related logic (material expressions, scriptable materials, brush materials). Do not use UnigineScript as a language for application logic, please consider C#/C++ instead, as these APIs are the preferred ones. Availability of new Engine features in UnigineScript (beyond its scope of applications) is not guaranteed, as the current level of support assumes only fixing critical issues.
The functionality described in this article is not available in the Community SDK edition.
You should upgrade to- Engineering / Sim
SDK edition to use it.
You should upgrade to
This class is used to manage a file importer. File importers are used by the Engine's import system to bring the data stored in various non-native formats to UNIGINE. Each importer can be used to import multiple file formats, but there shouldn't be two or more importers registered for a single file format.
Importer Class
Members
int containsParameter ( String name ) #
Returns a value indicating whether the list of import parameters includes a parameter with a given name.Arguments
- String name - Parameter name.
Return value
1 if the list of import parameters includes a parameter with a given name; otherwise, 0.void setParameterInt ( String name, int v ) #
Sets a new value for the specified integer parameter. There are built-in parameters that can also be used in custom importers.Arguments
- String name - Name of the integer parameter.
- int v - New value to be set.
int getParameterInt ( String name ) #
Returns the current value of the specified integer parameter. There are built-in parameters that can also be used in custom importers.Arguments
- String name - Name of the integer parameter.
Return value
Value of the integer parameter.void setParameterFloat ( String name, float v ) #
Sets a new value for the specified float parameter. There are built-in parameters that can also be used in custom importers.Arguments
- String name - Name of the float parameter.
- float v - New value to be set.
float getParameterFloat ( String name ) #
Returns the current value of the specified float parameter. There are built-in parameters that can also be used in custom importers.Arguments
- String name - Name of the float parameter.
Return value
Value of the float parameter.void setParameterDouble ( String name, double v ) #
Sets a new value for the specified double parameter.Arguments
- String name - Name of the double parameter.
- double v - New value to be set.
double getParameterDouble ( String name ) #
Returns the current value of the specified double parameter.Arguments
- String name - Name of the double parameter.
Return value
Value of the double parameter.void setParameterString ( String name, String v ) #
Sets a new value for the specified string parameter. There are built-in parameters that can also be used in custom importers.Arguments
const char * getParameterString ( String name ) #
Returns the current value of the specified string parameter. There are built-in parameters that can also be used in custom importers.Arguments
- String name - Name of the string parameter.
Return value
Value of the string parameter.int addPreProcessor ( String type_name ) #
Adds an import pre-processor with a given name. There are built-in pre-processors that can also be added to custom importers.Arguments
- String type_name - Pre-processor name.
Return value
1 if the specified import pre-processor is successfully added; otherwise, 0.void removePreProcessor ( String type_name ) #
Removes an import pre-processor with a given name. There are built-in pre-processors that can also be added to custom importers.Arguments
- String type_name - Pre-processor name.
int addPostProcessor ( String type_name ) #
Adds an import post-processor with a given name. There are built-in post-processors that can also be added to custom importers.Arguments
- String type_name - Post-processor name.
Return value
1 if the specified import post-processor is successfully added; otherwise, 0.void removePostProcessor ( String type_name ) #
Removes an import post-processor with a given name. There are built-in post-processors that can also be added to custom importers.Arguments
- String type_name - Post-processor name.
int init ( String filepath, int flags ) #
Initializes the importer for the specified file using the given flags. Import flags specify which scene components are to be imported.Arguments
- String filepath - Path to a file to be imported.
- int flags - Set of import flags. Any combination of IMPORT_* flags, or ~0 to set all of them.
Return value
1 if the importer was initialized successfully; otherwise, 0.int import ( String output_path ) #
Imports the contents of the input file to the specified output path.Arguments
- String output_path - Output path.
Return value
1 if the contents of the input file are successfully imported to the specified output path; otherwise, 0.Last update:
2021-12-13
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)