Skip to content
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

Use the default pose instead of frame 0 for base pose #113

Open
fire opened this issue Oct 24, 2019 · 8 comments
Open

Use the default pose instead of frame 0 for base pose #113

fire opened this issue Oct 24, 2019 · 8 comments

Comments

@fire
Copy link
Contributor

fire commented Oct 24, 2019

Hi,

Is it possible to use the default pose rather than frame 0?

It causes problems when the artist use frame 0 as an animation frame.

@ziriax
Copy link
Contributor

ziriax commented Oct 25, 2019

No this feature is not available because in a great many cases Maya fails to restore the binding pose because of constraints, expressions, scripts etc...

But you can pick any frame for the default pose, e.g. -100 or so. You pass this with the -ivt parameter

@ziriax
Copy link
Contributor

ziriax commented Oct 25, 2019

Although the documentation states that this should be possible by disabling all modifiers, this didn't always work for us..

https://knowledge.autodesk.com/support/maya/learn-explore/caas/CloudHelp/cloudhelp/2015/ENU/Maya/files/GUID-D47C31C7-428F-4A54-B104-49C51F3856E5-htm.html

The code for going to the bind pose and using that as the default one could be added again, it might work in most cases.

@yuhuaguo
Copy link

@ziriax

Hi, Ziriax, below are just my two cents for what it's worth, please correct me if any information is wrong:

In situations like exporting I don't think we need or want to restore the bind pose in the scene, as that might mess up the animation. What can be done though is to fetch the bind pose transform data and use those as the default pose for the skeleton in the exported data. That way we can get accurate skeleton pose data from the output.

There's just too many situations where having to manually create bind pose in the animation timeline is inconvenient especially if the animator for one reason or another forgot to do it before hand and Maya fails to restore bind pose.

@ziriax
Copy link
Contributor

ziriax commented Oct 25, 2019

Very true.

Do you know a reliable way of getting to the bind pose transform data?

Please note that Maya2glTF is a world-space-sampler. After 20 years of Maya and 3D hacking, we found this to be the only reliable way to export scenes, because complex rigs always have a lot of expressions, constraints, nodes, etc... So if the bind pose transform data can be extracted, we need it in world space, not local space (most likely it is)

@yuhuaguo
Copy link

yuhuaguo commented Oct 25, 2019

@ziriax I'm not familiar with the c++ package for Maya, in python we can fetch the joint(bone) bind pose with cmds.getAttr(bone + ".bindPose") to get the bind pose matrix. It's part of the attribute for the joint node. I believe the matrix is in world space, but I could be wrong. Those same data should be fetch able in c++ as well. (Edit: added some extra info)

The follow attributes are available in python/mel as well for bind pose:
bindRotation
bindRotationX
bindRotationY
bindRotationZ
bindJointOrient
bindJointOrientX
bindJointOrientY
bindJointOrientZ
bindRotateAxis
bindRotateAxisX
bindRotateAxisY
bindRotateAxisZ
bindScale
bindScaleX
bindScaleY
bindScaleZ
bindInverseScale
bindInverseScaleX
bindInverseScaleY
bindInverseScaleZ
bindSegmentScaleCompensate

@ziriax
Copy link
Contributor

ziriax commented Oct 25, 2019

I will investigate this attribute, thanks for the info!

The other problem is what default weights to pick for the blend shapes. I guess all zero should work, if this is not desired, then one should apply an animation that contains the desired weights

The same question must be answered for the transforms of all other non-joint nodes, and cameras what are the defaults?

To solve all these problems we just ask the artist to create a single frame that provides the "pose"

@yuhuaguo
Copy link

Hm, that's a very good question lol. I was thinking only in terms of character animation, but I'll take a crack at this.

Let's see, the objects themselves should have a starting point for the animation, since the animation data are technically just offsets applied onto their starting transform. So if we can somehow strip away animation data or access the default transforms pre-animation, we should be able to get accurate starting transform (and attributes) for those nodes. I'll poke around in Maya and see if I can find anything for this.

@ziriax
Copy link
Contributor

ziriax commented Oct 25, 2019

On the other hand, the two concepts (binding pose matrices and initial non-animated scene values) are orthogonal.

So it should be possible to use your bindPose attribute to extract the inverse bind poses, and have another discussion about what values to pick for the "default" scene :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants