From 5a7c226c30506e5317a16200cb04f4dc6fdfd619 Mon Sep 17 00:00:00 2001 From: thomasbiang Date: Wed, 10 Jul 2019 09:51:20 -0700 Subject: [PATCH 01/15] set->unordered_set;unsigned int for iteration From 8fc899035c747da7d4f0530a9fdd8e139b67c721 Mon Sep 17 00:00:00 2001 From: thomasbiang Date: Wed, 10 Jul 2019 16:27:59 -0700 Subject: [PATCH 02/15] customize error rate for bind pose --- code/FBX/FBXExporter.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/code/FBX/FBXExporter.cpp b/code/FBX/FBXExporter.cpp index 08f4bdbc9..f25b4f135 100644 --- a/code/FBX/FBXExporter.cpp +++ b/code/FBX/FBXExporter.cpp @@ -68,6 +68,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include +#include //wangyi + // RESOURCES: // https://code.blender.org/2013/08/fbx-binary-file-format-specification/ // https://wiki.blender.org/index.php/User:Mont29/Foundation/FBX_File_Structure @@ -1840,7 +1842,10 @@ void FBXExporter::WriteObjects () // this should be the same as the bone's mOffsetMatrix. // if it's not the same, the skeleton isn't in the bind pose. - const float epsilon = 1e-4f; // some error is to be expected + float epsilon = 1e-4f; // some error is to be expected +#ifdef ASSIMP_CUSTOM_BINDPOSE_ERR + epsilon = ASSIMP_CUSTOM_BINDPOSE_ERR; +#endif bool bone_xform_okay = true; if (b && ! tr.Equal(b->mOffsetMatrix, epsilon)) { not_in_bind_pose.insert(b); From 079e522eaeca98573cf0e379c321fd69f976286d Mon Sep 17 00:00:00 2001 From: thomasbiang Date: Wed, 10 Jul 2019 16:29:50 -0700 Subject: [PATCH 03/15] clean up --- code/FBX/FBXExporter.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/code/FBX/FBXExporter.cpp b/code/FBX/FBXExporter.cpp index f25b4f135..5367a8525 100644 --- a/code/FBX/FBXExporter.cpp +++ b/code/FBX/FBXExporter.cpp @@ -68,8 +68,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include -#include //wangyi - // RESOURCES: // https://code.blender.org/2013/08/fbx-binary-file-format-specification/ // https://wiki.blender.org/index.php/User:Mont29/Foundation/FBX_File_Structure From 9b2aac8c96aa020fefb49ecec26513a117046764 Mon Sep 17 00:00:00 2001 From: thomasbiang Date: Thu, 11 Jul 2019 17:00:47 -0700 Subject: [PATCH 04/15] use ExportProperties to customize bind pose epsilon --- code/FBX/FBXExporter.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/code/FBX/FBXExporter.cpp b/code/FBX/FBXExporter.cpp index 5367a8525..915b4aca7 100644 --- a/code/FBX/FBXExporter.cpp +++ b/code/FBX/FBXExporter.cpp @@ -67,6 +67,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include // RESOURCES: // https://code.blender.org/2013/08/fbx-binary-file-format-specification/ @@ -1841,9 +1842,9 @@ void FBXExporter::WriteObjects () // this should be the same as the bone's mOffsetMatrix. // if it's not the same, the skeleton isn't in the bind pose. float epsilon = 1e-4f; // some error is to be expected -#ifdef ASSIMP_CUSTOM_BINDPOSE_ERR - epsilon = ASSIMP_CUSTOM_BINDPOSE_ERR; -#endif + float epsilon_custom = mProperties->GetPropertyFloat("BINDPOSE_EPSILON", -1); + if(epsilon_custom > 0) + epsilon = epsilon_custom; bool bone_xform_okay = true; if (b && ! tr.Equal(b->mOffsetMatrix, epsilon)) { not_in_bind_pose.insert(b); From c597e21b67a62584c2bb813769f59f1686fcccf5 Mon Sep 17 00:00:00 2001 From: thomasbiang Date: Wed, 10 Jul 2019 16:27:59 -0700 Subject: [PATCH 05/15] customize error rate for bind pose --- code/FBX/FBXExporter.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/FBX/FBXExporter.cpp b/code/FBX/FBXExporter.cpp index 915b4aca7..7419f3d15 100644 --- a/code/FBX/FBXExporter.cpp +++ b/code/FBX/FBXExporter.cpp @@ -69,6 +69,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include +#include //wangyi + // RESOURCES: // https://code.blender.org/2013/08/fbx-binary-file-format-specification/ // https://wiki.blender.org/index.php/User:Mont29/Foundation/FBX_File_Structure From 6e6765cae35a55a1fccdd2ac5e97d668b93d2d29 Mon Sep 17 00:00:00 2001 From: thomasbiang Date: Wed, 10 Jul 2019 16:29:50 -0700 Subject: [PATCH 06/15] clean up --- code/FBX/FBXExporter.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/code/FBX/FBXExporter.cpp b/code/FBX/FBXExporter.cpp index 7419f3d15..915b4aca7 100644 --- a/code/FBX/FBXExporter.cpp +++ b/code/FBX/FBXExporter.cpp @@ -69,8 +69,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include -#include //wangyi - // RESOURCES: // https://code.blender.org/2013/08/fbx-binary-file-format-specification/ // https://wiki.blender.org/index.php/User:Mont29/Foundation/FBX_File_Structure From 0ed91589080f53b7ec66fa4324b1b37c523d5801 Mon Sep 17 00:00:00 2001 From: ywang Date: Mon, 15 Jul 2019 15:52:45 -0700 Subject: [PATCH 07/15] update --- code/FBX/FBXExporter.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/code/FBX/FBXExporter.cpp b/code/FBX/FBXExporter.cpp index 915b4aca7..dc17fc885 100644 --- a/code/FBX/FBXExporter.cpp +++ b/code/FBX/FBXExporter.cpp @@ -67,7 +67,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include -#include // RESOURCES: // https://code.blender.org/2013/08/fbx-binary-file-format-specification/ From 029338940c79198f1b78db121fe2d1e794e5b1b6 Mon Sep 17 00:00:00 2001 From: thomasbiang Date: Wed, 10 Jul 2019 16:27:59 -0700 Subject: [PATCH 08/15] customize error rate for bind pose --- code/FBX/FBXExporter.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/FBX/FBXExporter.cpp b/code/FBX/FBXExporter.cpp index dc17fc885..2ecd3177d 100644 --- a/code/FBX/FBXExporter.cpp +++ b/code/FBX/FBXExporter.cpp @@ -68,6 +68,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include +#include //wangyi + // RESOURCES: // https://code.blender.org/2013/08/fbx-binary-file-format-specification/ // https://wiki.blender.org/index.php/User:Mont29/Foundation/FBX_File_Structure From 2ddb00f4e066db9721972c43b8bdeebfe3760711 Mon Sep 17 00:00:00 2001 From: thomasbiang Date: Wed, 10 Jul 2019 16:29:50 -0700 Subject: [PATCH 09/15] clean up --- code/FBX/FBXExporter.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/code/FBX/FBXExporter.cpp b/code/FBX/FBXExporter.cpp index 2ecd3177d..dc17fc885 100644 --- a/code/FBX/FBXExporter.cpp +++ b/code/FBX/FBXExporter.cpp @@ -68,8 +68,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include -#include //wangyi - // RESOURCES: // https://code.blender.org/2013/08/fbx-binary-file-format-specification/ // https://wiki.blender.org/index.php/User:Mont29/Foundation/FBX_File_Structure From f9f408690e1081fbf338e6c39e4ff93c7b5158cb Mon Sep 17 00:00:00 2001 From: thomasbiang Date: Thu, 11 Jul 2019 17:00:47 -0700 Subject: [PATCH 10/15] use ExportProperties to customize bind pose epsilon --- code/FBX/FBXExporter.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/code/FBX/FBXExporter.cpp b/code/FBX/FBXExporter.cpp index dc17fc885..915b4aca7 100644 --- a/code/FBX/FBXExporter.cpp +++ b/code/FBX/FBXExporter.cpp @@ -67,6 +67,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include +#include // RESOURCES: // https://code.blender.org/2013/08/fbx-binary-file-format-specification/ From 0f0454c3b7cae51fee7790f6945ce50d7ce4ae57 Mon Sep 17 00:00:00 2001 From: thomasbiang Date: Wed, 10 Jul 2019 16:27:59 -0700 Subject: [PATCH 11/15] customize error rate for bind pose --- code/FBX/FBXExporter.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/code/FBX/FBXExporter.cpp b/code/FBX/FBXExporter.cpp index 915b4aca7..f6dd4ab1b 100644 --- a/code/FBX/FBXExporter.cpp +++ b/code/FBX/FBXExporter.cpp @@ -69,6 +69,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include + // RESOURCES: // https://code.blender.org/2013/08/fbx-binary-file-format-specification/ // https://wiki.blender.org/index.php/User:Mont29/Foundation/FBX_File_Structure From aaaa0a02a382ad11150b04288e21ef05bfc35901 Mon Sep 17 00:00:00 2001 From: thomasbiang Date: Thu, 11 Jul 2019 17:00:47 -0700 Subject: [PATCH 12/15] use ExportProperties to customize bind pose epsilon --- code/FBX/FBXExporter.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/code/FBX/FBXExporter.cpp b/code/FBX/FBXExporter.cpp index f6dd4ab1b..ffc4cd145 100644 --- a/code/FBX/FBXExporter.cpp +++ b/code/FBX/FBXExporter.cpp @@ -70,6 +70,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include + // RESOURCES: // https://code.blender.org/2013/08/fbx-binary-file-format-specification/ // https://wiki.blender.org/index.php/User:Mont29/Foundation/FBX_File_Structure From a6b06ad811f7d022a9e97185b733cb444490dcbe Mon Sep 17 00:00:00 2001 From: ywang Date: Mon, 15 Jul 2019 15:52:45 -0700 Subject: [PATCH 13/15] update --- code/FBX/FBXExporter.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/code/FBX/FBXExporter.cpp b/code/FBX/FBXExporter.cpp index ffc4cd145..1f856e8b2 100644 --- a/code/FBX/FBXExporter.cpp +++ b/code/FBX/FBXExporter.cpp @@ -67,7 +67,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include #include -#include From d8eaf0bc7fa54e1f1927eb0740ed3a132d6b16eb Mon Sep 17 00:00:00 2001 From: ywang Date: Thu, 25 Jul 2019 15:53:57 -0700 Subject: [PATCH 14/15] cleanup empty lines --- code/FBX/FBXExporter.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/code/FBX/FBXExporter.cpp b/code/FBX/FBXExporter.cpp index 1f856e8b2..dc17fc885 100644 --- a/code/FBX/FBXExporter.cpp +++ b/code/FBX/FBXExporter.cpp @@ -68,8 +68,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include #include - - // RESOURCES: // https://code.blender.org/2013/08/fbx-binary-file-format-specification/ // https://wiki.blender.org/index.php/User:Mont29/Foundation/FBX_File_Structure From 73914cd7e29f8bd0dc814024c9ef451d1748a8ca Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Fri, 26 Jul 2019 10:55:28 +0200 Subject: [PATCH 15/15] Update FBXExporter.cpp small reformatting improvement --- code/FBX/FBXExporter.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/FBX/FBXExporter.cpp b/code/FBX/FBXExporter.cpp index dc17fc885..7d979be9b 100644 --- a/code/FBX/FBXExporter.cpp +++ b/code/FBX/FBXExporter.cpp @@ -1842,8 +1842,10 @@ void FBXExporter::WriteObjects () // if it's not the same, the skeleton isn't in the bind pose. float epsilon = 1e-4f; // some error is to be expected float epsilon_custom = mProperties->GetPropertyFloat("BINDPOSE_EPSILON", -1); - if(epsilon_custom > 0) + if(epsilon_custom > 0) { epsilon = epsilon_custom; + } + bool bone_xform_okay = true; if (b && ! tr.Equal(b->mOffsetMatrix, epsilon)) { not_in_bind_pose.insert(b);