Revert partial "FBX add roughness mappings and fixes general some material bugs"
This reverts partial commit b624e13681
.
This resolves a bug with pivots and skinning breaking with this change.
This commit is contained in:
parent
db5a927689
commit
866c8de0ac
1 changed files with 19 additions and 25 deletions
|
@ -168,19 +168,11 @@ PropertyTable::PropertyTable(const ElementPtr element, const PropertyTable *temp
|
||||||
}
|
}
|
||||||
|
|
||||||
LazyPropertyMap::const_iterator it = lazyProps.find(name);
|
LazyPropertyMap::const_iterator it = lazyProps.find(name);
|
||||||
|
|
||||||
if (it != lazyProps.end()) {
|
if (it != lazyProps.end()) {
|
||||||
DOMWarning("duplicate property name, will hide previous value: " + name, v.second);
|
DOMWarning("duplicate property name, will hide previous value: " + name, v.second);
|
||||||
continue;
|
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.
|
// since the above checks for duplicates we can be sure to insert the only match here.
|
||||||
lazyProps[name] = v.second;
|
lazyProps[name] = v.second;
|
||||||
}
|
}
|
||||||
|
@ -195,26 +187,28 @@ PropertyTable::~PropertyTable() {
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
PropertyPtr PropertyTable::Get(const std::string &name) const {
|
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);
|
||||||
|
|
||||||
// check if loaded already - return it.
|
//ai_assert(it != props.end());
|
||||||
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
|
if (it == props.end()) {
|
||||||
LazyPropertyMap::const_iterator unloadedProperty = lazyProps.find(name);
|
// check property template
|
||||||
if (unloadedProperty != lazyProps.end()) {
|
if (templateProps) {
|
||||||
PropertyPtr loaded_property = ReadTypedProperty(unloadedProperty->second);
|
return templateProps->Get(name);
|
||||||
ERR_FAIL_COND_V_MSG(!loaded_property, nullptr, "[fbx][serious] unable to load typed property");
|
|
||||||
|
|
||||||
//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 {
|
DirectPropertyMap PropertyTable::GetUnparsedProperties() const {
|
||||||
|
|
Loading…
Reference in a new issue