Ver código fonte

Refactoring of PR #6092 (#6101)

* Fix fbx export. Nodes "LayerElementNormal" and "LayerElementColor" should be written only when actual data are exported.

* Update FBXExporter.cpp

- Fix intentions
- use empty instead of size for checking data exists

* refactoring

---------

Co-authored-by: Kim Kulling <[email protected]>
sSsA01 5 meses atrás
pai
commit
ac5988422a
1 arquivos alterados com 2 adições e 2 exclusões
  1. 2 2
      code/AssetLib/FBX/FBXExporter.cpp

+ 2 - 2
code/AssetLib/FBX/FBXExporter.cpp

@@ -1333,14 +1333,14 @@ void FBXExporter::WriteObjects () {
         layer.AddChild("Version", int32_t(100));
         FBX::Node le;
 
-		if (normal_data.size()) {
+		if (!normal_data.empty()) {
 		  le = FBX::Node("LayerElement");
 		  le.AddChild("Type", "LayerElementNormal");
 		  le.AddChild("TypedIndex", int32_t(0));
 		  layer.AddChild(le);
         }
 
-		if (color_data.size()) {
+		if (!color_data.empty()) {
 		  le = FBX::Node("LayerElement");
 		  le.AddChild("Type", "LayerElementColor");
 		  le.AddChild("TypedIndex", int32_t(0));