-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2.0.0-dev.1.7 #59
2.0.0-dev.1.7 #59
Conversation
Spec says: ***When the node contains `skin`, all `mesh.primitives` must contain `JOINTS_0` and `WEIGHTS_0` attributes.*** That makes sense to me, but maybe it's this code that's right, in which case we should update the spec.
Is this ready? I see #58 is un-checked above, but it looks like related code is on this branch already. ISSUES.md needs a refresh, other than that this all looks good. |
99dae0f
to
cfcbf23
Compare
disables syntax highlighting on big reports.
7545802
to
9fd834a
Compare
52ca8e9
to
a50b553
Compare
Remaining skinning stuff (joint indices, normalized weights, and hierarchy limits) will go to the next release. This one will be published this week. |
a50b553
to
f357392
Compare
@emackey @donmccurdy |
if (mesh.primitives | ||
.any((primitive) => primitive.jointsCount != 0)) { | ||
context.addIssue(LinkError.nodeSkinnedMeshWithoutSkin); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it valid to specify skin
on a node with no mesh
at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lib/src/errors.dart
Outdated
new SemanticError._( | ||
'MESH_PRIMITIVES_UNEQUAL_JOINTS_COUNT', | ||
(args) => "All primitives must contain the same number of 'JOINTS' " | ||
"and 'WEIGHTS' attribute sets."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I like the idea of error or warning here, but is this mentioned in the spec?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The spec requires each primitive have JOINTS_0
and WEIGHTS_0
, but I see nothing to say that one primitive couldn't have JOINTS_1
in addition to JOINTS_0
when other primitives do not. The spec would lead me to think that is valid, while this error would lead me to think it is not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have a data-driven opinion on this. We haven't yet seen models with more than 4 influences per vertex.
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
About whether it should be allowed, or whether the validator should say something about it?
I haven't seen any examples either. I'd prefer that primitives be more consistent than not, but elsewhere we've asserted primitives could have different attribute sets without discussing skinning specifically...
The message is sort of saying one thing and testing another, but tentatively, I'd lean toward making the error code something more generic (MESH_PRIMITIVES_INVALID_JOINTS_COUNT
) and then we can change either the behavior of the test or the message text depending on what we decide in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd lean toward making the error code something more generic
Agree.
@zellski do you have preference on this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for checking -- no, no strong preference. I feel mildly irked by the thought of completely heterogenous primitives in a mesh, but I have no rational basis for that irritation. When we implement animation at Facebook, I expect we'll treat primitives in a mesh as almost completely unrelated to one another, so no strong "day job" preference either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Considering that skinned mesh transform should be ignored, all primitives of the skinned mesh must have joints. Whether they have to have the same number of influences per vertex is a different question.
I'll update the code and tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Turns out we have a separate issue for skinned primitives without joints:
glTF-Validator/lib/src/base/node.dart
Lines 198 to 201 in d376c03
if (mesh.primitives | |
.any((primitive) => primitive.jointsCount == 0)) { | |
context.addIssue(LinkError.nodeSkinWithNonSkinnedMesh); | |
} |
So I propose to replace "must" with "should" in the description of MESH_PRIMITIVES_UNEQUAL_JOINTS_COUNT
(while keeping error code) and to reduce its severity to Warning
or Information
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good 👍
if (warnOnMultipleExtensions && extensionMaps.length > 1) { | ||
context.addIssue(SemanticError.multipleExtensions, | ||
args: [null, extensionMaps.keys]); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I understand this one ... why is having multiple extensions reported as an issue? Your test case makes sense — multiple material extensions may interact in undefined ways — but reporting an issue when KHR_materials_unlit
is used with KHR_draco_mesh_compression
makes less sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This warning is effective only when several extensions are defined for the same object.
For now, it's enabled only for material
objects:
glTF-Validator/lib/src/base/material.dart
Lines 89 to 90 in d376c03
final extensions = | |
getExtensions(map, Material, context, warnOnMultipleExtensions: true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good.
Currently having trouble with
But this returns immediately, without any delay that would normally be associated with attempting to download a number of packages from a server. No further messages are printed, errors or otherwise. I'm pretty sure this is a problem with my local machine or local network. I tried switching back to master and the old dartsdk, which used to work, and it's not getting any packages or errors now. I may need to try this from a different machine on another network. |
@emackey |
Thanks. Corporate cert went bad, fixed now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Also I tested this in VSCode with a mismatched Joint/Weight sample, seems to work fine.
This is published to npm now. |
NODE_SKINNED_MESH_WITHOUT_SKIN
,MESH_PRIMITIVES_UNEQUAL_JOINTS_COUNT
issues.KHR_materials_unlit
extension.MULTIPLE_EXTENSIONS
warning.GLB_UNEXPECTED_BIN_CHUNK
,BUFFER_NON_FIRST_GLB
, andBUFFER_MISSING_GLB_DATA
(GLB chunks order #67).ANIMATION_SAMPLER_INPUT_ACCESSOR_TOO_FEW_ELEMENTS
andANIMATION_SAMPLER_OUTPUT_INTERPOLATION
issues.