Skip to content

Commit

Permalink
Merge pull request #43420 from RevoluPowered/fix-skeleton-skinning
Browse files Browse the repository at this point in the history
Revert partial "FBX add roughness mappings and fixes general some mat…
  • Loading branch information
akien-mga authored Nov 9, 2020
2 parents db5a927 + 866c8de commit 1a14551
Showing 1 changed file with 18 additions and 24 deletions.
42 changes: 18 additions & 24 deletions modules/fbx/fbx_parser/FBXProperties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,19 +168,11 @@ PropertyTable::PropertyTable(const ElementPtr element, const PropertyTable *temp
}

LazyPropertyMap::const_iterator it = lazyProps.find(name);

if (it != lazyProps.end()) {
DOMWarning("duplicate property name, will hide previous value: " + name, v.second);
continue;
}

if (it->second == nullptr) {
print_error("skipped invalid element insertion for " + String(name.c_str()));
continue;
}

//print_verbose("storing lazy property: " + String(name.c_str()));

// since the above checks for duplicates we can be sure to insert the only match here.
lazyProps[name] = v.second;
}
Expand All @@ -195,26 +187,28 @@ PropertyTable::~PropertyTable() {

// ------------------------------------------------------------------------------------------------
PropertyPtr PropertyTable::Get(const std::string &name) const {
PropertyMap::const_iterator it = props.find(name);
if (it == props.end()) {
// hasn't been parsed yet?
LazyPropertyMap::const_iterator lit = lazyProps.find(name);
if (lit != lazyProps.end()) {
props[name] = ReadTypedProperty(lit->second);
it = props.find(name);

//ai_assert(it != props.end());
}

// check if loaded already - return it.
PropertyMap::const_iterator loaded_property_element = props.find(name);
if (loaded_property_element != props.end()) {
//print_verbose("Returning conversion for lazy property: " + String(loaded_property_element->first.c_str()));
return loaded_property_element->second;
}

// now load it since we don't have a match
LazyPropertyMap::const_iterator unloadedProperty = lazyProps.find(name);
if (unloadedProperty != lazyProps.end()) {
PropertyPtr loaded_property = ReadTypedProperty(unloadedProperty->second);
ERR_FAIL_COND_V_MSG(!loaded_property, nullptr, "[fbx][serious] unable to load typed property");
if (it == props.end()) {
// check property template
if (templateProps) {
return templateProps->Get(name);
}

//print_verbose("loaded property successfully: " + String(name.c_str()));
props.insert(std::make_pair(name, loaded_property));
return loaded_property;
return nullptr;
}
}

return nullptr;
return (*it).second;
}

DirectPropertyMap PropertyTable::GetUnparsedProperties() const {
Expand Down

0 comments on commit 1a14551

Please sign in to comment.