fix:auto add rootnode and cut animation curve promblem
This commit is contained in:
parent
0a6ec8297e
commit
9cfd44bec9
|
@ -49,7 +49,7 @@ find_package(Boost REQUIRED COMPONENTS filesystem)
|
|||
find_package(LibXml2 MODULE REQUIRED)
|
||||
find_package(ZLIB MODULE REQUIRED)
|
||||
find_package(fmt MODULE REQUIRED)
|
||||
find_package(libiconv MODULE REQUIRED)
|
||||
find_package(Iconv MODULE REQUIRED)
|
||||
|
||||
# create a compilation database for e.g. clang-tidy
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||
|
|
BIN
build/FBX2glTF
BIN
build/FBX2glTF
Binary file not shown.
|
@ -9,7 +9,7 @@ from conans import ConanFile, CMake
|
|||
class FBX2glTFConan(ConanFile):
|
||||
settings = "os", "compiler", "build_type", "arch"
|
||||
requires = (
|
||||
("boost/1.81.0"),
|
||||
("boost/1.69.0"),
|
||||
("libiconv/1.15"),
|
||||
("zlib/1.2.13"),
|
||||
("libxml2/2.9.9"),
|
||||
|
|
|
@ -848,11 +848,6 @@ static void ReadAnimations(RawModel& raw, FbxScene* pScene, const GltfOptions& o
|
|||
const FbxVector4 localScale = computeLocalScale(pNode, pTime);
|
||||
|
||||
|
||||
if (!optAnimation) {
|
||||
hasTranslation = true;
|
||||
hasRotation = true;
|
||||
hasScale = true;
|
||||
} else {
|
||||
hasTranslation |=
|
||||
(fabs(localTranslation[0] - baseTranslation[0]) > epsilon ||
|
||||
fabs(localTranslation[1] - baseTranslation[1]) > epsilon ||
|
||||
|
@ -866,7 +861,7 @@ static void ReadAnimations(RawModel& raw, FbxScene* pScene, const GltfOptions& o
|
|||
(fabs(localScale[0] - baseScaling[0]) > epsilon ||
|
||||
fabs(localScale[1] - baseScaling[1]) > epsilon ||
|
||||
fabs(localScale[2] - baseScaling[2]) > epsilon);
|
||||
}
|
||||
|
||||
channel.translations.push_back(toVec3f(localTranslation) * scaleFactor);
|
||||
channel.rotations.push_back(toQuatf(localRotation));
|
||||
channel.scales.push_back(toVec3f(localScale));
|
||||
|
@ -943,6 +938,7 @@ static void ReadAnimations(RawModel& raw, FbxScene* pScene, const GltfOptions& o
|
|||
}
|
||||
|
||||
if (hasTranslation || hasRotation || hasScale || hasMorphs) {
|
||||
if (optAnimation) {
|
||||
if (!hasTranslation) {
|
||||
channel.translations.clear();
|
||||
}
|
||||
|
@ -955,7 +951,7 @@ static void ReadAnimations(RawModel& raw, FbxScene* pScene, const GltfOptions& o
|
|||
if (!hasMorphs) {
|
||||
channel.weights.clear();
|
||||
}
|
||||
|
||||
}
|
||||
animation.channels.emplace_back(channel);
|
||||
|
||||
totalSizeInBytes += channel.translations.size() * sizeof(channel.translations[0]) +
|
||||
|
|
Loading…
Reference in New Issue