Use AiNode's metadata to keep per-node(and per-instance) FBX (3dsmax) UserDefinedProperties
Also simplify metadata structure to avoid unnecessary allocations (and make it easier for wrappers like AssimpNET to read it)
This commit is contained in:
@@ -725,14 +725,14 @@ aiNode* ProcessSpatialStructure(aiNode* parent, const IfcProduct& el, Conversion
|
||||
if (!properties.empty()) {
|
||||
aiMetadata* data = new aiMetadata();
|
||||
data->mNumProperties = properties.size();
|
||||
data->mKeys = new aiString*[data->mNumProperties]();
|
||||
data->mValues = new aiString*[data->mNumProperties]();
|
||||
data->mKeys = new aiString[data->mNumProperties]();
|
||||
data->mValues = new aiString[data->mNumProperties]();
|
||||
|
||||
unsigned int i = 0;
|
||||
BOOST_FOREACH(const Metadata::value_type& kv, properties) {
|
||||
data->mKeys[i] = new aiString(kv.first);
|
||||
data->mKeys[i].Set(kv.first);
|
||||
if (kv.second.length() > 0) {
|
||||
data->mValues[i] = new aiString(kv.second);
|
||||
data->mValues[i].Set(kv.second);
|
||||
}
|
||||
++i;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user