extended model operations
This commit is contained in:
@@ -2486,6 +2486,54 @@ void Model::UpdateModel()
|
||||
++iter;
|
||||
}
|
||||
}
|
||||
void Model::Add(Object* value)
|
||||
{
|
||||
if (value != nullptr)
|
||||
{
|
||||
objects.push_back(value);
|
||||
if (value->mesh != nullptr)
|
||||
{
|
||||
meshes.insert(pair<string, Mesh*>(value->mesh->name, value->mesh));
|
||||
for (auto& x : value->mesh->subsets)
|
||||
{
|
||||
materials.insert(pair<string, Material*>(x.material->name, x.material));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
void Model::Add(Armature* value)
|
||||
{
|
||||
if (value != nullptr)
|
||||
{
|
||||
armatures.push_back(value);
|
||||
}
|
||||
}
|
||||
void Model::Add(Light* value)
|
||||
{
|
||||
if (value != nullptr)
|
||||
{
|
||||
lights.push_back(value);
|
||||
}
|
||||
}
|
||||
void Model::Add(Decal* value)
|
||||
{
|
||||
if (value != nullptr)
|
||||
{
|
||||
decals.push_back(value);
|
||||
}
|
||||
}
|
||||
void Model::Add(Model* value)
|
||||
{
|
||||
if (value != nullptr)
|
||||
{
|
||||
objects.insert(objects.begin(), value->objects.begin(), value->objects.end());
|
||||
armatures.insert(armatures.begin(), value->armatures.begin(), value->armatures.end());
|
||||
decals.insert(decals.begin(), value->decals.begin(), value->decals.end());
|
||||
lights.insert(lights.begin(), value->lights.begin(), value->lights.end());
|
||||
meshes.insert(value->meshes.begin(), value->meshes.end());
|
||||
materials.insert(value->materials.begin(), value->materials.end());
|
||||
}
|
||||
}
|
||||
void Model::Serialize(wiArchive& archive)
|
||||
{
|
||||
Transform::Serialize(archive);
|
||||
|
||||
@@ -1045,6 +1045,12 @@ struct Model : public Transform
|
||||
void LoadFromDisk(const string& dir, const string& name, const string& identifier);
|
||||
void FinishLoading();
|
||||
void UpdateModel();
|
||||
void Add(Object* value);
|
||||
void Add(Armature* value);
|
||||
void Add(Light* value);
|
||||
void Add(Decal* value);
|
||||
// merge
|
||||
void Add(Model* value);
|
||||
void Serialize(wiArchive& archive);
|
||||
};
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace wiVersion
|
||||
// minor features, major bug fixes
|
||||
const int minor = 8;
|
||||
// minor bug fixes, alterations, refactors
|
||||
const int revision = 30;
|
||||
const int revision = 31;
|
||||
|
||||
|
||||
long GetVersion()
|
||||
|
||||
Reference in New Issue
Block a user