Assimp v5.2.2 (January 2022)
The Asset-Importer-Lib API documentation.
Assimp::SceneCombiner Class Reference

Static helper class providing various utilities to merge two scenes. More...

#include <SceneCombiner.h>

Static Public Member Functions

static void AddNodePrefixes (aiNode *node, const char *prefix, unsigned int len)
 Add a name prefix to all nodes in a scene. More...
 
static void AttachToGraph (aiNode *attach, std::vector< NodeAttachmentInfo > &srcList)
 
static void AttachToGraph (aiScene *master, std::vector< NodeAttachmentInfo > &srcList)
 Attach a list of node graphs to well-defined nodes in a master graph. More...
 
static void BuildUniqueBoneList (std::list< BoneWithHash > &asBones, std::vector< aiMesh * >::const_iterator it, std::vector< aiMesh * >::const_iterator end)
 Builds a list of uniquely named bones in a mesh list. More...
 
static void Copy (aiAnimation **dest, const aiAnimation *src)
 
static void Copy (aiAnimMesh **dest, const aiAnimMesh *src)
 
static void Copy (aiBone **dest, const aiBone *src)
 
static void Copy (aiCamera **dest, const aiCamera *src)
 
static void Copy (aiLight **dest, const aiLight *src)
 
static void Copy (aiMaterial **dest, const aiMaterial *src)
 
static void Copy (aiMesh **dest, const aiMesh *src)
 Get a deep copy of a mesh. More...
 
static void Copy (aiMeshMorphAnim **dest, const aiMeshMorphAnim *src)
 
static void Copy (aiMetadata **dest, const aiMetadata *src)
 
static void Copy (aiNode **dest, const aiNode *src)
 
static void Copy (aiNodeAnim **dest, const aiNodeAnim *src)
 
static void Copy (aiString **dest, const aiString *src)
 
static void Copy (aiTexture **dest, const aiTexture *src)
 
static void CopyScene (aiScene **dest, const aiScene *source, bool allocate=true)
 Get a deep copy of a scene. More...
 
static void CopySceneFlat (aiScene **dest, const aiScene *source)
 Get a flat copy of a scene. More...
 
static void MergeBones (aiMesh *out, std::vector< aiMesh * >::const_iterator it, std::vector< aiMesh * >::const_iterator end)
 Merges two or more bones. More...
 
static void MergeMaterials (aiMaterial **dest, std::vector< aiMaterial * >::const_iterator begin, std::vector< aiMaterial * >::const_iterator end)
 Merges two or more materials. More...
 
static void MergeMeshes (aiMesh **dest, unsigned int flags, std::vector< aiMesh * >::const_iterator begin, std::vector< aiMesh * >::const_iterator end)
 Merges two or more meshes. More...
 
static void MergeScenes (aiScene **dest, aiScene *master, std::vector< AttachmentInfo > &src, unsigned int flags=0)
 Merges two or more scenes and attaches all scenes to a specific position in the node graph of the master scene. More...
 
static void MergeScenes (aiScene **dest, std::vector< aiScene * > &src, unsigned int flags=0)
 Merges two or more scenes. More...
 
static void OffsetNodeMeshIndices (aiNode *node, unsigned int offset)
 Add an offset to all mesh indices in a node graph. More...
 

Detailed Description

Static helper class providing various utilities to merge two scenes.

It is intended as internal utility and NOT for use by applications.

The class is currently being used by various postprocessing steps and loaders (ie. LWS).

Member Function Documentation

◆ AddNodePrefixes()

static void Assimp::SceneCombiner::AddNodePrefixes ( aiNode node,
const char *  prefix,
unsigned int  len 
)
static

Add a name prefix to all nodes in a scene.

Parameters
Currentnode. This function is called recursively.
prefixPrefix to be added to all nodes
lenSTring length

◆ AttachToGraph() [1/2]

static void Assimp::SceneCombiner::AttachToGraph ( aiNode attach,
std::vector< NodeAttachmentInfo > &  srcList 
)
static

◆ AttachToGraph() [2/2]

static void Assimp::SceneCombiner::AttachToGraph ( aiScene master,
std::vector< NodeAttachmentInfo > &  srcList 
)
static

Attach a list of node graphs to well-defined nodes in a master graph.

This is a helper for MergeScenes()

Parameters
masterMaster scene
srcListList of source scenes along with their attachment points. If an attachment point is nullptr (or does not exist in the master graph), a scene is attached to the root of the master graph (as an additional child node) @duplicates List of duplicates. If elem[n] == n the scene is not a duplicate. Otherwise elem[n] links scene n to its first occurrence.

◆ BuildUniqueBoneList()

static void Assimp::SceneCombiner::BuildUniqueBoneList ( std::list< BoneWithHash > &  asBones,
std::vector< aiMesh * >::const_iterator  it,
std::vector< aiMesh * >::const_iterator  end 
)
static

Builds a list of uniquely named bones in a mesh list.

Parameters
asBonesReceives the output list
itFirst mesh to be processed
endLast mesh to be processed

◆ Copy() [1/13]

static void Assimp::SceneCombiner::Copy ( aiAnimation **  dest,
const aiAnimation src 
)
static

◆ Copy() [2/13]

static void Assimp::SceneCombiner::Copy ( aiAnimMesh **  dest,
const aiAnimMesh src 
)
static

◆ Copy() [3/13]

static void Assimp::SceneCombiner::Copy ( aiBone **  dest,
const aiBone src 
)
static

◆ Copy() [4/13]

static void Assimp::SceneCombiner::Copy ( aiCamera **  dest,
const aiCamera src 
)
static

◆ Copy() [5/13]

static void Assimp::SceneCombiner::Copy ( aiLight **  dest,
const aiLight src 
)
static

◆ Copy() [6/13]

static void Assimp::SceneCombiner::Copy ( aiMaterial **  dest,
const aiMaterial src 
)
static

◆ Copy() [7/13]

static void Assimp::SceneCombiner::Copy ( aiMesh **  dest,
const aiMesh src 
)
static

Get a deep copy of a mesh.

Parameters
destReceives a pointer to the destination mesh
srcSource mesh - remains unmodified.

◆ Copy() [8/13]

static void Assimp::SceneCombiner::Copy ( aiMeshMorphAnim **  dest,
const aiMeshMorphAnim src 
)
static

◆ Copy() [9/13]

static void Assimp::SceneCombiner::Copy ( aiMetadata **  dest,
const aiMetadata src 
)
static

◆ Copy() [10/13]

static void Assimp::SceneCombiner::Copy ( aiNode **  dest,
const aiNode src 
)
static

◆ Copy() [11/13]

static void Assimp::SceneCombiner::Copy ( aiNodeAnim **  dest,
const aiNodeAnim src 
)
static

◆ Copy() [12/13]

static void Assimp::SceneCombiner::Copy ( aiString **  dest,
const aiString src 
)
static

◆ Copy() [13/13]

static void Assimp::SceneCombiner::Copy ( aiTexture **  dest,
const aiTexture src 
)
static

◆ CopyScene()

static void Assimp::SceneCombiner::CopyScene ( aiScene **  dest,
const aiScene source,
bool  allocate = true 
)
static

Get a deep copy of a scene.

Parameters
destReceives a pointer to the destination scene
srcSource scene - remains unmodified.

◆ CopySceneFlat()

static void Assimp::SceneCombiner::CopySceneFlat ( aiScene **  dest,
const aiScene source 
)
static

Get a flat copy of a scene.

Only the first hierarchy layer is copied. All pointer members of aiScene are shared by source and destination scene. If the pointer doesn't point to nullptr when the function is called, the existing scene is cleared and refilled.

Parameters
destReceives a pointer to the destination scene
srcSource scene - remains unmodified.

◆ MergeBones()

static void Assimp::SceneCombiner::MergeBones ( aiMesh out,
std::vector< aiMesh * >::const_iterator  it,
std::vector< aiMesh * >::const_iterator  end 
)
static

Merges two or more bones.

Parameters
outMesh to receive the output bone list
flagsCurrently no parameters
beginFirst mesh to be processed
endPoints to the mesh after the last mesh to be processed

◆ MergeMaterials()

static void Assimp::SceneCombiner::MergeMaterials ( aiMaterial **  dest,
std::vector< aiMaterial * >::const_iterator  begin,
std::vector< aiMaterial * >::const_iterator  end 
)
static

Merges two or more materials.

The materials should be complementary as much as possible. In case of a property present in different materials, the first occurrence is used.

Parameters
destDestination material. Must be empty.
beginFirst material to be processed
endPoints to the material after the last material to be processed

◆ MergeMeshes()

static void Assimp::SceneCombiner::MergeMeshes ( aiMesh **  dest,
unsigned int  flags,
std::vector< aiMesh * >::const_iterator  begin,
std::vector< aiMesh * >::const_iterator  end 
)
static

Merges two or more meshes.

The meshes should have equal vertex formats. Only components that are provided by ALL meshes will be present in the output mesh. An exception is made for VColors - they are set to black. The meshes should have the same material indices, too. The output material index is always the material index of the first mesh.

Parameters
destDestination mesh. Must be empty.
flagsCurrently no parameters
beginFirst mesh to be processed
endPoints to the mesh after the last mesh to be processed

◆ MergeScenes() [1/2]

static void Assimp::SceneCombiner::MergeScenes ( aiScene **  dest,
aiScene master,
std::vector< AttachmentInfo > &  src,
unsigned int  flags = 0 
)
static

Merges two or more scenes and attaches all scenes to a specific position in the node graph of the master scene.

Parameters
destReceives a pointer to the destination scene. If the pointer doesn't point to nullptr when the function is called, the existing scene is cleared and refilled.
masterMaster scene. It will be deleted afterwards. All other scenes will be inserted in its node graph.
srcNon-empty list of scenes to be merged along with their corresponding attachment points in the master scene. The function deletes the input scenes afterwards. There may be duplicate scenes.
flagsCombination of the AI_INT_MERGE_SCENE flags defined above

◆ MergeScenes() [2/2]

static void Assimp::SceneCombiner::MergeScenes ( aiScene **  dest,
std::vector< aiScene * > &  src,
unsigned int  flags = 0 
)
static

Merges two or more scenes.

Parameters
destReceives a pointer to the destination scene. If the pointer doesn't point to nullptr when the function is called, the existing scene is cleared and refilled.
srcNon-empty list of scenes to be merged. The function deletes the input scenes afterwards. There may be duplicate scenes.
flagsCombination of the AI_INT_MERGE_SCENE flags defined above

◆ OffsetNodeMeshIndices()

static void Assimp::SceneCombiner::OffsetNodeMeshIndices ( aiNode node,
unsigned int  offset 
)
static

Add an offset to all mesh indices in a node graph.

Parameters
Currentnode. This function is called recursively.
offsetOffset to be added to all mesh indices

The documentation for this class was generated from the following file: