Unigine::Importer Class
Header: | #include <UnigineImport.h> |
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 has a set of flags defining which scene components are to be extracted and imported. So, the importer should be initialized before use.
Each importer generates UNIGINE objects on the basis of metadata extracted from the imported files and uses a set of processors to perform all necessary auxiliary operations (data preparation, file saving, file management, etc.). Importer allows you to add any number of pre- and post-processors. However, you can set only one processor for each scene component.
You can customize actions to be performed when importing the whole scene as well as when importing textures, materials, meshes, animations, lights, cameras by overriding the corresponding event handler functions for your custom importer
class MyCustomImporter : public Unigine::Importer
{
public:
MyCustomImporter();
virtual ~MyCustomImporter();
/*...*/
// overrides of event functions
protected:
virtual bool onInit(const ImportScenePtr &scene, const char *filepath) override;
virtual bool onImport(const char *output_path) override;
virtual bool onImportTexture(const Unigine::ImportProcessor &processor, const Unigine::ImportTexturePtr &import_texture) override;
virtual bool onImportMaterial(const Unigine::ImportProcessor &processor, const Unigine::MaterialPtr &material, const Unigine::ImportMaterial &import_material) override;
virtual bool onImportMesh(const Unigine::ImportProcessor &processor, const Unigine::MeshPtr &mesh, const Unigine::ImportMesh &import_mesh) override;
virtual bool onImportLight(const Unigine::ImportProcessor &processor, const Unigine::LightPtr &light, const Unigine::ImportLight &import_light) override;
virtual bool onImportCamera(const Unigine::ImportProcessor &processor, const Unigine::PlayerPtr &camera, const Unigine::ImportCamera &import_camera);
virtual bool onImportNode(const Unigine::ImportProcessor &processor, const Unigine::NodePtr &node, const Unigine::ImportNode &import_node) override;
virtual bool onImportNodeChild(const ImportProcessorPtr &processor, const Unigine::NodePtr &node_parent, const ImportNodePtr &import_node_parent, const Unigine::NodePtr &node_child, const ImportNodePtr &import_node_child) override;
virtual bool onImportAnimation(const Unigine::ImportProcessor &processor, const Unigine::MeshAnimationPtr &animation, const Unigine::ImportMesh &import_mesh, const Unigine::ImportAnimation &import_animation) override;
private:
ImportScene *import_scene();
void import_textures(const Unigine::ImportScene &scene);
void import_materials(const Unigine::ImportScene &scene);
void import_animations(const Unigine::ImportScene &scene);
void process_node(const Unigine::ImportScene &import_scene, const Unigine::ImportNode &parent, fbx::FbxNode *fbx_node);
void process_mesh(const Unigine::ImportScene &import_scene, const Unigine::ImportNode &node, fbx::FbxNode *fbx_node, fbx::FbxMesh *fbx_mesh);
void process_light(const Unigine::ImportScene &import_scene, const Unigine::ImportNode &node, fbx::FbxNode *fbx_node, fbx::FbxLight *fbx_light);
void process_camera(const Unigine::ImportScene &import_scene, const Unigine::ImportNode &node, fbx::FbxNode *fbx_node, fbx::FbxCamera *fbx_camera);
/*...*/
};
Importer Class
枚举
Axis#
Axis.Name | 描述 |
---|---|
None = -1 | Axis none. |
X = None + 1 | X axis. |
NX = X + 1 | Negative X axis. |
Y = NX + 1 | Y axis. |
NY = Y + 1 | Negative Y axis. |
Z = NY + 1 | Z axis. |
NZ = Z + 1 | Negative Z axis. |
Members
void setAnimationsProcessor ( const char * processor ) #
Arguments
- const char * processor - The animations import processor.
const char * getAnimationsProcessor() const#
Return value
Current animations import processor.void setLightsProcessor ( const char * processor ) #
Arguments
- const char * processor - The lights import processor.
const char * getLightsProcessor() const#
Return value
Current lights import processor.void setMeshesProcessor ( const char * processor ) #
Arguments
- const char * processor - The meshes import processor.
const char * getMeshesProcessor() const#
Return value
Current meshes import processor.void setNodesProcessor ( const char * processor ) #
Arguments
- const char * processor - The nodes import processor.
const char * getNodesProcessor() const#
Return value
Current nodes import processor.void setCamerasProcessor ( const char * processor ) #
Arguments
- const char * processor - The cameras import processor.
const char * getCamerasProcessor() const#
Return value
Current cameras import processor.void setMaterialsProcessor ( const char * processor ) #
Arguments
- const char * processor - The materials import processor.
const char * getMaterialsProcessor() const#
Return value
Current materials import processor.void setOutputFilepath ( const char * filepath ) #
Arguments
- const char * filepath - The output file path.
const char * getOutputFilepath() const#
Return value
Current output file path.void setTexturesProcessor ( const char * processor ) #
Arguments
- const char * processor - The textures import processor.
const char * getTexturesProcessor() const#
Return value
Current textures import processor.Importer ( ) #
Constructor. Creates an empty importer.Ptr<Importer> getImporter ( ) const#
Returns the importer itself.Return value
Importer itself.bool containsParameter ( const char * name ) const#
Returns a value indicating whether the list of import parameters includes a parameter with a given name.Arguments
- const char * name - Parameter name.
Return value
true if the list of import parameters includes a parameter with a given name; otherwise, false.void setParameterInt ( const char * 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
- const char * name - Name of the integer parameter.
- int v - New value to be set.
int getParameterInt ( const char * name ) const#
Returns the current value of the specified integer parameter. There are built-in parameters that can also be used in custom importers.Arguments
- const char * name - Name of the integer parameter.
Return value
Value of the integer parameter.void setParameterFloat ( const char * 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
- const char * name - Name of the float parameter.
- float v - New value to be set.
float getParameterFloat ( const char * name ) const#
Returns the current value of the specified float parameter. There are built-in parameters that can also be used in custom importers.Arguments
- const char * name - Name of the float parameter.
Return value
Value of the float parameter.void setParameterDouble ( const char * name, double v ) #
Sets a new value for the specified double parameter. There are built-in parameters that can also be used in custom importers.Arguments
- const char * name - Name of the double parameter.
- double v - New value to be set.
double getParameterDouble ( const char * name ) const#
Returns the current value of the specified double parameter. There are built-in parameters that can also be used in custom importers.Arguments
- const char * name - Name of the double parameter.
Return value
Value of the double parameter.void setParameterString ( const char * name, const char * 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 * name - Name of the string parameter.
- const char * v - New value to be set.
const char * getParameterString ( const char * name ) const#
Returns the current value of the specified string parameter. There are built-in parameters that can also be used in custom importers.Arguments
- const char * name - Name of the string parameter.
Return value
Value of the string parameter.bool addPreProcessor ( const char * type_name ) #
Adds an import pre-processor with a given type name. There are built-in pre-processors that can also be added to custom importers.Arguments
- const char * type_name - Pre-processor type name.
Return value
true if the specified import pre-processor is successfully added; otherwise, false.void removePreProcessor ( const char * type_name ) #
Removes an import pre-processor with a given type name. There are built-in pre-processors that can also be added to custom importers.Arguments
- const char * type_name - Pre-processor type name.
bool hasPreProcessor ( const char * type_name ) #
Returns a value indicating if an import pre-processor with a given type name is used by the importer. There are built-in pre-processors that can also be added to custom importers.Arguments
- const char * type_name - Pre-processor type name.
Return value
true if an import pre-processor with a given type name is used by the importer; otherwise, false.bool addPostProcessor ( const char * type_name ) #
Adds an import post-processor with a given type name. There are built-in post-processors that can also be added to custom importers.Arguments
- const char * type_name - Post-processor type name to check.
void removePostProcessor ( const char * type_name ) #
Removes an import post-processor with a given type name. There are built-in post-processors that can also be added to custom importers.Arguments
- const char * type_name - Post-processor type name.
bool hasPostProcessor ( const char * type_name ) #
Returns a value indicating if an import post-processor with a given type name is used by the importer. There are built-in post-processors that can also be added to custom importers.Arguments
- const char * type_name - Post-processor type name to check.
Return value
true if an import post-processor with a given type name is used by the importer; otherwise, false.Ptr<ImportScene> getScene ( ) const#
Returns the imported scene.Return value
Instance of the ImportScene class.bool init ( const char * filepath, int flags = ~0 ) #
Initializes the importer for the specified file using the given flags. Import flags specify which scene components are to be imported.Arguments
- const char * 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
true if the importer was initialized successfully; otherwise, 0.bool import ( const char * output_path ) #
Imports the contents of the input file to the specified output path.Arguments
- const char * output_path - Output path.
Return value
true if the contents of the input file are successfully imported to the specified output path; otherwise, false.const char * getSourceFilepath ( ) const#
Returns the path to the source file.Return value
Source file path.int getFlags ( ) const#
Returns the current set of import flags (IMPORT_*) resulting output file path for imported scene component(s). In case if a set of files were generated the path to resulting *.node file will be returned.bool computeBoundBox ( const Ptr<ImportMesh> & import_mesh ) #
Computes a bound box for the specified mesh.Arguments
- const Ptr<ImportMesh> & import_mesh - Imported mesh for which a bound box is to be calculated.
Return value
true if a bound box for the specified mesh is successfully calculated; otherwise, false.bool preprocess ( ) #
Starts execution of all added pre-processors.Return value
true if the pre-processing is completed successfully.Ptr<Node> convertNode ( const Ptr<ImportProcessor> & processor, const Ptr<ImportNode> & root_node ) #
Converts metadata stored in an instance of the ImportNode class to UNIGINE's node (node hierarchy).Arguments
- const Ptr<ImportProcessor> & processor - Import processor to be used for this import operation.
- const Ptr<ImportNode> & root_node - Instance of the ImportNode class representing the root node of the imported hierarchy.
Return value
Resulting UNIGINE's node instance that stores the specified imported node (node hierarchy).bool importTexture ( const Ptr<ImportProcessor> & processor, const Ptr<ImportTexture> & import_texture ) #
Imports the specified texture and uses the specified processor to process and save the generated texture to a corresponding file in the output directory specified in the import() method.Arguments
- const Ptr<ImportProcessor> & processor - Import processor to be used for this import operation.
- const Ptr<ImportTexture> & import_texture - Instance of the ImportTexture class.
Return value
true if the specified texture was successfully imported; otherwise, false.bool importMaterial ( const Ptr<ImportProcessor> & processor, const Ptr<Material> & material, const Ptr<ImportMaterial> & import_material ) #
Imports the specified material and uses the specified processor to process and save the generated material to a corresponding file in the output directory specified in the import() method.Arguments
- const Ptr<ImportProcessor> & processor - Import processor to be used for this import operation.
- const Ptr<Material> & material - Target UNIGINE's material instance to store the specified imported material.
- const Ptr<ImportMaterial> & import_material - Instance of the ImportMaterial class.
Return value
true if the specified material was successfully imported; otherwise, false.bool importMesh ( const Ptr<ImportProcessor> & processor, const Ptr<Mesh> & mesh, const Ptr<ImportMesh> & import_mesh ) #
Imports the specified mesh and uses the specified processor to process and save the generated mesh to a corresponding file in the output directory specified in the import() method.Arguments
- const Ptr<ImportProcessor> & processor - Import processor to be used for this import operation.
- const Ptr<Mesh> & mesh - Target UNIGINE's mesh instance to store the specified imported mesh.
- const Ptr<ImportMesh> & import_mesh - Instance of the ImportMesh class.
Return value
true if the specified mesh was successfully imported; otherwise, false.Ptr<Light> importLight ( const Ptr<ImportProcessor> & processor, const Ptr<ImportLight> & import_light ) #
Imports the specified light and uses the specified processor to process and save the generated light to a corresponding *.node file in the output directory specified in the import() method.Arguments
- const Ptr<ImportProcessor> & processor - Import processor to be used for this import operation.
- const Ptr<ImportLight> & import_light - Instance of the ImportLight class.
Return value
UNIGINE's light instance that stores the specified imported light source.Ptr<Player> importCamera ( const Ptr<ImportProcessor> & processor, const Ptr<ImportCamera> & import_camera ) #
Imports the specified camera and uses the specified processor to process and save the generated player to a corresponding *.node file in the output directory specified in the import() method.Arguments
- const Ptr<ImportProcessor> & processor - Import processor to be used for this import operation.
- const Ptr<ImportCamera> & import_camera - Instance of the ImportCamera class.
Return value
UNIGINE's player instance that stores the specified imported camera.bool importAnimation ( const Ptr<ImportProcessor> & processor, const Ptr<MeshAnimation> & animation, const Ptr<ImportAnimation> & import_animation ) #
Imports the specified mesh animation and uses the specified processor to process and save the generated mesh animation to a corresponding file in the output directory specified in the import() method.Arguments
- const Ptr<ImportProcessor> & processor - Import processor to be used for this import operation.
- const Ptr<MeshAnimation> & animation - Target UNIGINE's mesh animation instance to store the specified imported mesh animation.
- const Ptr<ImportAnimation> & import_animation - Instance of the ImportAnimation class.
Return value
true if the specified animation was successfully imported; otherwise, false.bool importAnimation ( const Ptr<ImportProcessor> & processor, const Ptr<MeshAnimation> & animation, const Ptr<ImportMesh> & import_mesh, const Ptr<ImportAnimation> & import_animation ) #
Imports the specified mesh animation and uses the specified processor to process and save the generated mesh animation to a corresponding file in the output directory specified in the import() method.Arguments
- const Ptr<ImportProcessor> & processor - Import processor to be used for this import operation.
- const Ptr<MeshAnimation> & animation - Target UNIGINE's mesh animation instance to store the specified imported mesh animation.
- const Ptr<ImportMesh> & import_mesh - Instance of the ImportMesh class.
- const Ptr<ImportAnimation> & import_animation - Instance of the ImportAnimation class.
Return value
true if the specified animation was successfully imported; otherwise, false.bool checkSupportedAnimation ( const Ptr<ImportMesh> & import_mesh, const Ptr<ImportAnimation> & import_animation ) const#
Returns a value indicating if importing of the specified animation of the specified imported mesh is supported.Arguments
- const Ptr<ImportMesh> & import_mesh - Instance of the ImportMesh class.
- const Ptr<ImportAnimation> & import_animation - Instance of the ImportAnimation class.
Return value
true if importing of the specified animation of the specified imported mesh is supported; otherwise, false.Ptr<Node> importNode ( const Ptr<ImportProcessor> & processor, const Ptr<ImportNode> & import_node ) #
Imports the specified node and uses the specified processor to process and save the generated node to a corresponding file in the output directory specified in the import() method.Arguments
- const Ptr<ImportProcessor> & processor - Import processor to be used for this import operation.
- const Ptr<ImportNode> & import_node - Instance of the ImportNode class.
Return value
Target UNIGINE's node instance to store the specified imported node.bool importNodeChild ( const Ptr<ImportProcessor> & processor, const Ptr<Node> & node_parent, const Ptr<ImportNode> & import_node_parent, const Ptr<Node> & node_child, const Ptr<ImportNode> & import_node_child ) #
Imports the specified parent node with the specified child node and uses the specified processor to process and save generated nodes to a corresponding file in the output directory specified in the import() method.Arguments
- const Ptr<ImportProcessor> & processor - Import processor to be used for this import operation.
- const Ptr<Node> & node_parent - Target UNIGINE's node instance to store the specified imported parent node.
- const Ptr<ImportNode> & import_node_parent - Instance of the ImportNode class for the parent node.
- const Ptr<Node> & node_child - Target UNIGINE's node instance to store the specified imported child node.
- const Ptr<ImportNode> & import_node_child - Instance of the ImportNode class for the child node.
Return value
true if the specified parent node along with the specified child node were successfully imported; otherwise, false.bool postprocess ( ) #
Starts execution of all added post-processors. Post-processors can be used to manage files generated in the process of import.Return value
true if the post-processing is completed successfully.bool getBasis ( Importer::Axis up_axis, Importer::Axis front_axis, Math::dmat4 & ret ) #
Returns the transformation matrix for the basis specified by axes.Arguments
- Importer::Axis up_axis - Up axis of the basis.
- Importer::Axis front_axis - Front axis of the basis.
- Math::dmat4 & ret - Transformation matrix for the basis specified by axes.
Return value
true the transformation matrix for the basis was successfully calculated; otherwise, false.bool onComputeBoundBox ( const Ptr<ImportMesh> & import_mesh ) #
Extendable method for custom bound box computation.Arguments
- const Ptr<ImportMesh> & import_mesh - Imported mesh for which a bound box is to be calculated.
Return value
true if a bound box for the specified mesh was successfully calculated; otherwise, false.bool onInit ( const Ptr<ImportScene> & import_scene, const char * filepath ) #
Builds and initializes the imported scene based on the data contained in the specified input file.Arguments
- const Ptr<ImportScene> & import_scene - Imported scene (built from the data contained in the specified input file).
- const char * filepath - Path to an input file to be imported.
Return value
true if the scene is successfully initialized using the data from the specified input file; otherwise, false.bool onImport ( const char * output_path ) #
Import event handler function. This function is called each time when the import() function is called. You can specify your custom actions to be performed on scene import.class MyCustomImporter : public Unigine::Importer
{
public:
MyCustomImporter();
virtual ~MyCustomImporter();
/*...*/
// overrides of event functions
protected:
bool onImport(const char *output_path) override;
/*...*/
};
/*...*/
bool MyCustomImporter::onImport(const char *output_path)
{
bool result = false;
// your custom actions
return result;
}
Arguments
- const char * output_path - Output path to be used to store generated file(s) with imported data.
Return value
true if import operation for the specified output path was successful; otherwise, false.bool onImportTexture ( const Ptr<ImportProcessor> & processor, const Ptr<ImportTexture> & import_texture ) #
Texture import event handler function. This function is called each time when the importTexture() function is called. You can specify your custom actions to be performed on texture import.class MyCustomImporter : public Unigine::Importer
{
public:
MyCustomImporter();
virtual ~MyCustomImporter();
/*...*/
// overrides of event functions
protected:
bool onImportTexture(const ImportProcessorPtr &processor, const ImportTexturePtr &import_texture) override;
/*...*/
};
/*...*/
bool MyCustomImporter::onImportTexture(const ImportProcessorPtr &processor, const ImportTexturePtr &import_texture)
{
bool result = false;
// your custom actions
return result;
}
Arguments
- const Ptr<ImportProcessor> & processor - Import processor used for this import operation.
- const Ptr<ImportTexture> & import_texture - Instance of the ImportTexture class.
Return value
true if the specified texture was successfully imported; otherwise, false.bool onImportMaterial ( const Ptr<ImportProcessor> & processor, const Ptr<Material> & material, const Ptr<ImportMaterial> & import_material ) #
Material import event handler function. This function is called each time when the importMaterial() function is called. You can specify your custom actions to be performed on material import.class MyCustomImporter : public Unigine::Importer
{
public:
MyCustomImporter();
virtual ~MyCustomImporter();
/*...*/
// overrides of event functions
protected:
bool onImportMaterial(const ImportProcessorPtr &processor, const Unigine::MaterialPtr &material, const ImportMaterialPtr &import_material) override;
/*...*/
};
/*...*/
bool MyCustomImporter::onImportMaterial(const ImportProcessorPtr &processor, const Unigine::MaterialPtr &material, const ImportMaterialPtr &import_material)
{
bool result = false;
// your custom actions
return result;
}
Arguments
- const Ptr<ImportProcessor> & processor - Import processor used for this import operation.
- const Ptr<Material> & material - Target UNIGINE's material instance to store the specified imported material.
- const Ptr<ImportMaterial> & import_material - Instance of the ImportMaterial class.
Return value
true if the specified material was successfully imported; otherwise, false.Ptr<Light> onImportLight ( const Ptr<ImportProcessor> & processor, const Ptr<ImportLight> & import_light ) #
Light import event handler function. This function is called each time when the importLight() function is called. You can specify your custom actions to be performed on light import.class MyCustomImporter : public Unigine::Importer
{
public:
MyCustomImporter();
virtual ~MyCustomImporter();
/*...*/
// overrides of event functions
protected:
Unigine::LightPtr onImportLight(const ImportProcessorPtr &processor, const ImportLightPtr &import_light) override;
/*...*/
};
/*...*/
Unigine::LightPtr MyCustomImporter::onImportLight(const ImportProcessorPtr &processor, const ImportLightPtr &import_light)
{
bool result = false;
// your custom actions
return result;
}
Arguments
- const Ptr<ImportProcessor> & processor - Import processor used for this import operation.
- const Ptr<ImportLight> & import_light - Instance of the ImportLight class.
Return value
UNIGINE's light instance that stores the specified imported light.Ptr<Player> onImportCamera ( const Ptr<ImportProcessor> & processor, const Ptr<ImportCamera> & import_camera ) #
Camera import event handler function. This function is called each time when the importCamera() function is called. You can specify your custom actions to be performed on camera import.class MyCustomImporter : public Unigine::Importer
{
public:
MyCustomImporter();
virtual ~MyCustomImporter();
/*...*/
// overrides of event functions
protected:
Unigine::PlayerPtr onImportCamera(const ImportProcessorPtr &processor, const ImportCameraPtr &import_camera) override;
/*...*/
};
/*...*/
Unigine::PlayerPtr MyCustomImporter::onImportCamera(const ImportProcessorPtr &processor, const ImportCameraPtr &import_camera)
{
bool result = false;
// your custom actions
return result;
}
Arguments
- const Ptr<ImportProcessor> & processor - Import processor used for this import operation.
- const Ptr<ImportCamera> & import_camera - Instance of the ImportCamera class.
Return value
UNIGINE's player instance that stores the specified imported camera.bool onImportMesh ( const Ptr<ImportProcessor> & processor, const Ptr<Mesh> & mesh, const Ptr<ImportMesh> & import_mesh ) #
Mesh import event handler function. This function is called each time when the importMesh() function is called. You can specify your custom actions to be performed on mesh import.class MyCustomImporter : public Unigine::Importer
{
public:
MyCustomImporter();
virtual ~MyCustomImporter();
/*...*/
// overrides of event functions
protected:
bool onImportMesh(const ImportProcessorPtr &processor, const Unigine::MeshPtr &mesh, const ImportMeshPtr &import_mesh) override;
/*...*/
};
/*...*/
bool MyCustomImporter::onImportMesh(const ImportProcessorPtr &, const Unigine::MeshPtr &mesh, const ImportMeshPtr &import_mesh)
{
bool result = false;
// your custom actions
return result;
}
Arguments
- const Ptr<ImportProcessor> & processor - Import processor used for this import operation.
- const Ptr<Mesh> & mesh - Target UNIGINE's mesh instance to store the specified imported mesh animation.
- const Ptr<ImportMesh> & import_mesh - Instance of the ImportMesh class.
Return value
true if the specified mesh was successfully imported; otherwise, false.Ptr<Node> onImportNode ( const Ptr<ImportProcessor> & processor, const Ptr<ImportNode> & import_node ) #
Node import event handler function. This function is called each time when the importNode() function is called. You can specify your custom actions to be performed on node import.class MyCustomImporter : public Unigine::Importer
{
public:
MyCustomImporter();
virtual ~MyCustomImporter();
/*...*/
// overrides of event functions
protected:
Unigine::NodePtr onImportNode(const ImportProcessorPtr &processor, const ImportNodePtr &import_node) override;
/*...*/
};
/*...*/
Unigine::NodePtr MyCustomImporter::onImportNode(const ImportProcessorPtr &processor, const ImportNodePtr &import_node)
{
bool result = false;
// your custom actions
return result;
}
Arguments
- const Ptr<ImportProcessor> & processor - Import processor used for this import operation.
- const Ptr<ImportNode> & import_node - Instance of the ImportNode class.
Return value
UNIGINE's node instance that stores the specified imported node.bool onImportNodeChild ( const Ptr<ImportProcessor> & processor, const Ptr<Node> & node_parent, const Ptr<ImportNode> & import_node_parent, const Ptr<Node> & node_child, const Ptr<ImportNode> & import_node_child ) #
Node import event handler function. This function is called each time when the importNodeChild() function is called. You can specify your custom actions to be performed on importing and processing node hierarchies (e.g. assigning properties to node children).class MyCustomImporter : public Unigine::Importer
{
public:
MyCustomImporter();
virtual ~MyCustomImporter();
/*...*/
// overrides of event functions
protected:
bool onImportNodeChild(const ImportProcessorPtr &processor, const Unigine::NodePtr &node_parent, const ImportNodePtr &import_node_parent, const Unigine::NodePtr &node_child, const ImportNodePtr &import_node_child) override;
/*...*/
};
/*...*/
bool MyCustomImporter::onImportNodeChild(const ImportProcessorPtr &processor, const Unigine::NodePtr &node_parent, const ImportNodePtr &import_node_parent, const Unigine::NodePtr &node_child, const ImportNodePtr &import_node_child)
{
bool result = false;
// your custom actions
return result;
}
Arguments
- const Ptr<ImportProcessor> & processor - Import processor used for this import operation.
- const Ptr<Node> & node_parent - Target UNIGINE's node instance to store the specified imported parent node.
- const Ptr<ImportNode> & import_node_parent - Instance of the ImportNode class for the parent node.
- const Ptr<Node> & node_child - Target UNIGINE's node instance to store the specified imported child node.
- const Ptr<ImportNode> & import_node_child - Instance of the ImportNode class for the child node.
Return value
true if the specified parent node and its child node animation were successfully imported; otherwise, false.bool onImportAnimation ( const Ptr<ImportProcessor> & processor, const Ptr<MeshAnimation> & animation, const Ptr<ImportAnimation> & import_animation ) #
Animation import event handler function. This function is called each time when the importAnimation() function is called. You can specify your custom actions to be performed on animation import.Arguments
- const Ptr<ImportProcessor> & processor - Import processor used for this import operation.
- const Ptr<MeshAnimation> & animation - Target UNIGINE's mesh animation instance to store the specified imported mesh animation.
- const Ptr<ImportAnimation> & import_animation - ImportAnimation structure pointer. The metadata for the animation that needs to be imported.
Return value
true if the specified mesh animation was successfully imported; otherwise, false.bool onImportAnimation ( const Ptr<ImportProcessor> & processor, const Ptr<MeshAnimation> & animation, const Ptr<ImportMesh> & import_mesh, const Ptr<ImportAnimation> & import_animation ) #
Animation import event handler function. This function is called each time when the importAnimation() function is called. You can specify your custom actions to be performed on animation import.Arguments
- const Ptr<ImportProcessor> & processor - Import processor used for this import operation.
- const Ptr<MeshAnimation> & animation - Target UNIGINE's mesh animation instance to store the specified imported mesh animation.
- const Ptr<ImportMesh> & import_mesh - ImportMesh structure pointer. The metadata for the mesh that needs to be imported.
- const Ptr<ImportAnimation> & import_animation - ImportAnimation structure pointer. The metadata for the animation that needs to be imported.
Return value
true if the specified mesh animation was successfully imported; otherwise, false.bool onCheckSupportedAnimation ( const Ptr<ImportMesh> & import_mesh, const Ptr<ImportAnimation> & import_animation ) const#
Animation import support check event handler function. This function is called each time when the checkSupportedAnimation() function is called. You can specify your custom actions to be performed on animation import.Arguments
- const Ptr<ImportMesh> & import_mesh - ImportMesh structure pointer. The metadata for the mesh that needs to be imported.
- const Ptr<ImportAnimation> & import_animation - ImportAnimation structure pointer. The metadata for the animation that needs to be imported.