Explicit handling of an FBXExportNode edge-case.
parent
00277d93f2
commit
aadb413fc0
|
@ -168,7 +168,7 @@ void FBX::Node::Dump(Assimp::StreamWriterLE &s)
|
||||||
DumpChildren(s);
|
DumpChildren(s);
|
||||||
|
|
||||||
// finish, filling in end offset placeholder
|
// finish, filling in end offset placeholder
|
||||||
End(s, !children.empty());
|
End(s, force_has_children || !children.empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
void FBX::Node::Begin(Assimp::StreamWriterLE &s)
|
void FBX::Node::Begin(Assimp::StreamWriterLE &s)
|
||||||
|
|
|
@ -66,6 +66,9 @@ public: // public data members
|
||||||
std::vector<FBX::Property> properties; // node properties
|
std::vector<FBX::Property> properties; // node properties
|
||||||
std::vector<FBX::Node> children; // child nodes
|
std::vector<FBX::Node> children; // child nodes
|
||||||
|
|
||||||
|
// some nodes always pretend they have children...
|
||||||
|
bool force_has_children = false;
|
||||||
|
|
||||||
public: // constructors
|
public: // constructors
|
||||||
Node() = default;
|
Node() = default;
|
||||||
Node(const std::string& n) : name(n) {}
|
Node(const std::string& n) : name(n) {}
|
||||||
|
|
|
@ -419,6 +419,7 @@ void FBXExporter::WriteReferences ()
|
||||||
// always empty for now.
|
// always empty for now.
|
||||||
// not really sure what this is for.
|
// not really sure what this is for.
|
||||||
FBX::Node n("References");
|
FBX::Node n("References");
|
||||||
|
n.force_has_children = true;
|
||||||
n.Dump(outfile);
|
n.Dump(outfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1914,11 +1915,8 @@ void FBXExporter::WriteObjects ()
|
||||||
|
|
||||||
// this node absurdly always pretends it has children
|
// this node absurdly always pretends it has children
|
||||||
// (in this case it does, but just in case...)
|
// (in this case it does, but just in case...)
|
||||||
asnode.Begin(outstream);
|
asnode.force_has_children = true;
|
||||||
asnode.DumpProperties(outstream);
|
asnode.Dump(outstream);
|
||||||
asnode.EndProperties(outstream);
|
|
||||||
asnode.DumpChildren(outstream);
|
|
||||||
asnode.End(outstream, true);
|
|
||||||
|
|
||||||
// note: animation stacks are not connected to anything
|
// note: animation stacks are not connected to anything
|
||||||
}
|
}
|
||||||
|
@ -1932,11 +1930,8 @@ void FBXExporter::WriteObjects ()
|
||||||
alnode.AddProperties(animlayer_uid, FBX::SEPARATOR + "AnimLayer", "");
|
alnode.AddProperties(animlayer_uid, FBX::SEPARATOR + "AnimLayer", "");
|
||||||
|
|
||||||
// this node absurdly always pretends it has children
|
// this node absurdly always pretends it has children
|
||||||
alnode.Begin(outstream);
|
alnode.force_has_children = true;
|
||||||
alnode.DumpProperties(outstream);
|
alnode.Dump(outstream);
|
||||||
alnode.EndProperties(outstream);
|
|
||||||
alnode.DumpChildren(outstream);
|
|
||||||
alnode.End(outstream, true);
|
|
||||||
|
|
||||||
// connect to the relevant animstack
|
// connect to the relevant animstack
|
||||||
connections.emplace_back(
|
connections.emplace_back(
|
||||||
|
|
Loading…
Reference in New Issue