mirror of
https://git.mirrors.martin98.com/https://github.com/syoyo/tinygltf.git
synced 2025-08-14 22:25:54 +08:00
Merge pull request #190 from ux3d/feature/parse-node-weights
parse/serialize node weights
This commit is contained in:
commit
6591ba4461
@ -3680,6 +3680,8 @@ static bool ParseNode(Node *node, std::string *err, const json &o) {
|
|||||||
node->children.clear();
|
node->children.clear();
|
||||||
ParseIntegerArrayProperty(&node->children, err, o, "children", false);
|
ParseIntegerArrayProperty(&node->children, err, o, "children", false);
|
||||||
|
|
||||||
|
ParseNumberArrayProperty(&node->weights, err, o, "weights", false);
|
||||||
|
|
||||||
ParseExtensionsProperty(&node->extensions, err, o);
|
ParseExtensionsProperty(&node->extensions, err, o);
|
||||||
ParseExtrasProperty(&(node->extras), o);
|
ParseExtrasProperty(&(node->extras), o);
|
||||||
|
|
||||||
@ -5588,6 +5590,10 @@ static void SerializeGltfNode(Node &node, json &o) {
|
|||||||
SerializeNumberProperty<int>("camera", node.camera, o);
|
SerializeNumberProperty<int>("camera", node.camera, o);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (node.weights.size() > 0) {
|
||||||
|
SerializeNumberArrayProperty<double>("weights", node.weights, o);
|
||||||
|
}
|
||||||
|
|
||||||
if (node.extras.Type() != NULL_TYPE) {
|
if (node.extras.Type() != NULL_TYPE) {
|
||||||
SerializeValue("extras", node.extras, o);
|
SerializeValue("extras", node.extras, o);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user