Skip to content

Commit

Permalink
Update skinning schemes
Browse files Browse the repository at this point in the history
  • Loading branch information
lexaknyazev committed Feb 25, 2017
1 parent a91e16e commit 6c41899
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 30 deletions.
18 changes: 2 additions & 16 deletions specification/2.0/schema/node.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"$schema" : "http://json-schema.org/draft-04/schema",
"title" : "node",
"type" : "object",
"description" : "A node in the node hierarchy. A node can have either the `camera`, `meshes`, or `skeletons`/`skin`/`meshes` properties defined. In the later case, all `primitives` in the referenced `meshes` contain `JOINT` and `WEIGHT` attributes and the referenced `material`/`technique` from each `primitive` has parameters with `JOINT` and `WEIGHT` semantics. A node can have either a `matrix` or any combination of `translation`/`rotation`/`scale` (TRS) properties. TRS properties are converted to matrices and postmultiplied in the `T * R * S` order to compose the transformation matrix; first the scale is applied to the vertices, then the rotation, and then the translation. If none are provided, the transform is the identity. When a node is targeted for animation (referenced by an animation.channel.target), only TRS properties may be present; `matrix` will not be present.",
"description" : "A node in the node hierarchy. When the node contains `skin`, all `mesh.primitives` must contain `JOINT` and `WEIGHT` attributes. A node can have either a `matrix` or any combination of `translation`/`rotation`/`scale` (TRS) properties. TRS properties are converted to matrices and postmultiplied in the `T * R * S` order to compose the transformation matrix; first the scale is applied to the vertices, then the rotation, and then the translation. If none are provided, the transform is the identity. When a node is targeted for animation (referenced by an animation.channel.target), only TRS properties may be present; `matrix` will not be present.",
"allOf" : [ { "$ref" : "glTFChildOfRootProperty.schema.json" } ],
"properties" : {
"camera" : {
Expand All @@ -18,23 +18,10 @@
"uniqueItems" : true,
"default" : []
},
"skeletons" : {
"type" : "array",
"description" : "The indices of skeleton nodes.",
"items" : {
"$ref" : "glTFid.schema.json"
},
"uniqueItems" : true,
"gltf_detailedDescription" : "The indices of skeleton nodes. Each node defines a subtree, which has a `jointName` of the corresponding element in the referenced `skin.jointNames`."
},
"skin" : {
"allOf" : [ { "$ref" : "glTFid.schema.json" } ],
"description" : "The index of the skin referenced by this node."
},
"jointName" : {
"allOf" : [ { "$ref" : "glTFid.schema.json" } ],
"description" : "Name used when this node is a joint in a skin."
},
"matrix" : {
"type" : "array",
"description" : "A floating-point 4x4 transformation matrix stored in column-major order.",
Expand Down Expand Up @@ -86,8 +73,7 @@
"extras" : {}
},
"dependencies" : {
"skeletons" : ["skin", "meshes"],
"skin" : ["skeletons", "meshes"]
"skin" : ["mesh"]
},
"additionalProperties" : false
}
22 changes: 8 additions & 14 deletions specification/2.0/schema/skin.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,27 @@
"description" : "Joints and matrices defining a skin.",
"allOf" : [ { "$ref" : "glTFChildOfRootProperty.schema.json" } ],
"properties" : {
"bindShapeMatrix" : {
"type" : "array",
"description" : "Floating-point 4x4 transformation matrix stored in column-major order.",
"items" : {
"type": "number"
},
"minItems" : 16,
"maxItems" : 16,
"default" : [ 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 0.0, 1.0 ]
},
"inverseBindMatrices" : {
"allOf" : [ { "$ref" : "glTFid.schema.json" } ],
"description" : "The index of the accessor containing the floating-point 4x4 inverse-bind matrices. The default is that each matrix is a 4x4 identity matrix, which implies that inverse-bind matrices were pre-applied."
},
"jointNames" : {
"skeleton" : {
"allOf" : [ { "$ref" : "glTFid.schema.json" } ],
"description" : "The index of the node used as a skeleton root. When undefined, joints transforms resolve to scene root."
},
"joints" : {
"type" : "array",
"description" : "Joint names of the joints (nodes with a `jointName` property) in this skin.",
"description" : "Indices of skeleton nodes, used as joints in this skin.",
"items" : {
"$ref" : "glTFid.schema.json"
},
"uniqueItems" : true,
"gltf_detailedDescription" : "Joint names of the joints (nodes with a `jointName` property) in this skin. The array length is the same as the `count` property of the `inverseBindMatrices` accessor (when defined), and the same as the total quantity of all skeleton nodes from node-trees referenced by the skinned mesh instance node's `skeletons` array."
"gltf_detailedDescription" : "Indices of skeleton nodes, used as joints in this skin. The array length must be the same as the `count` property of the `inverseBindMatrices` accessor (when defined)."
},
"name" : {},
"extensions" : {},
"extras" : {}
},
"additionalProperties" : false,
"required" : ["jointNames"]
"required" : ["joints"]
}

0 comments on commit 6c41899

Please sign in to comment.