1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-22 15:06:45 +00:00

[fbx] bugfixes skinning, materials and debugging info, merry xmas 🎄

Better materials:
- default values will no longer trigger things like emission,
clear coat being enabled etc incorrectly, mostly importers misunderstand
this value, a value of 1 is not actually enabled emission, it must have a
non zero setting other than emission value for the emission flags to
actually be enabled correctly in our engine #42386
- lambert materials are warned against significantly,
do not use Lambert in Godot, use a PBR material like Ai Standard Surface
 (it's like going from low quality to high definition in terms of output
 in scenes and on assets)
- roughness values are calculated correctly in this version

Fixes for normal's array - some normal's from some files were dropped and
generated, this is now fixed.
- FBX indexing for items with (-1) index, for normal data is supported,
this is super helpful at increasing our range of compatibility of
FBX meshes.

Fix bone rest data **no longer requiring go to bind pose in Maya and various applications**
- Partial fix for #43688

Validation tools added for validating large projects

Provide package name, vendor and FBX vendor in the log.

Implemented metadata properties so we can read extra document
info required for bug reporting

**FBX 2011 (version 7200)** is unsupported now,
you must re-export your file in Maya or Max to upgrade the file format.

Fixes skin bind poses being generated based on node xforms in the scene
Fixes duplicate bones being added to skin and prevents add_bones from
registering skeleton bones it now registers skin bind poses,
but this should really be documented in the engine correctly right now
 it doesn't tell you this is the case.
This commit is contained in:
Gordon MacPherson
2020-12-02 15:38:11 +00:00
committed by RevoluPowered
parent 0b5a9bf716
commit de61cfe7c5
20 changed files with 513 additions and 252 deletions

View File

@@ -184,7 +184,6 @@ ObjectPtr LazyObject::LoadObject() {
if (!strcmp(classtag.c_str(), "Cluster")) {
object.reset(new Cluster(id, element, doc, name));
} else if (!strcmp(classtag.c_str(), "Skin")) {
object.reset(new Skin(id, element, doc, name));
} else if (!strcmp(classtag.c_str(), "BlendShape")) {
object.reset(new BlendShape(id, element, doc, name));
@@ -288,12 +287,15 @@ Document::~Document() {
delete v.second;
}
if (metadata_properties != nullptr) {
delete metadata_properties;
}
// clear globals import pointer
globals.reset();
}
// ------------------------------------------------------------------------------------------------
static const unsigned int LowerSupportedVersion = 7100;
static const unsigned int LowerSupportedVersion = 7300;
static const unsigned int UpperSupportedVersion = 7700;
bool Document::ReadHeader() {
@@ -310,11 +312,11 @@ bool Document::ReadHeader() {
// While we may have some success with newer files, we don't support
// the older 6.n fbx format
if (fbxVersion < LowerSupportedVersion) {
DOMWarning("unsupported, old format version, supported are only FBX 2011, FBX 2012 and FBX 2013, you can re-export using Maya, 3DS, blender or Autodesk FBX tool");
DOMWarning("unsupported, old format version, FBX 2015-2020, you must re-export in a more modern version of your original modelling application");
return false;
}
if (fbxVersion > UpperSupportedVersion) {
DOMWarning("unsupported, newer format version, supported are only FBX 2011, up to FBX 2020"
DOMWarning("unsupported, newer format version, supported are only FBX 2015, up to FBX 2020"
" trying to read it nevertheless");
}
@@ -323,6 +325,20 @@ bool Document::ReadHeader() {
creator = ParseTokenAsString(GetRequiredToken(ecreator, 0));
}
//
// Scene Info
//
const ElementPtr scene_info = shead->GetElement("SceneInfo");
if (scene_info) {
PropertyTable *fileExportProps = const_cast<PropertyTable *>(GetPropertyTable(*this, "", scene_info, scene_info->Compound(), true));
if (fileExportProps) {
metadata_properties = fileExportProps;
}
}
const ElementPtr etimestamp = shead->GetElement("CreationTimeStamp");
if (etimestamp && etimestamp->Compound()) {
const ScopePtr stimestamp = etimestamp->Compound();