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

Export scale keys with STEP interpolation instead of LINEAR #152

Open
Damani2 opened this issue Mar 11, 2021 · 6 comments
Open

Export scale keys with STEP interpolation instead of LINEAR #152

Damani2 opened this issue Mar 11, 2021 · 6 comments

Comments

@Damani2
Copy link

Damani2 commented Mar 11, 2021

I'm working with a sequence of meshes that I'm trying to animate in sequential order and export to glb. I've created a Maya scene with an .obj sequence using a script to assemble the sequence. As I understand it, glb doesn't support visibility keys. So I've added scale keys overtop the visibility keys.

Could someone explain to me how I can export this animated sequence as glb?

I'm attaching my Maya scene file without textures as a google drive link below. I used Maya 2018 as well. Maybe I just don't understand the animation options. Do I need to create an animation clip for this? What for? How do I ensure my scale keys are exported? If someone could go over the proper settings/parameters for this with me I'd really appreciate it. I also think I've had issues with the select all polygon meshes button. I got the sense that I have to actually select all my meshes from the outliner. The visible only box I checked to off, because I want to leave the visibility keys and just add the scale keys on top. I'm assuming the visibility keys are completely ignored.

Thank you

https://drive.google.com/file/d/1F-E-bqA9Ynh6S-2uLjJGy1dCarOmiFQ0/view?usp=sharing

@ziriax
Copy link
Collaborator

ziriax commented Mar 11, 2021

For some reason my Maya's keep crashing on startup, so I can't test this right now... I'll get back to you when this is fixed.

Now, ccurrently Maya2glTF always uses linear interpolation between two sampled keys. When "abusing" scaling for visibility, one should use "STEP" interpolation...

Because Maya2glTF is a sampling exporter (e.g. it reconstructs all animation values from world space transformations), I can't just read the Maya curve interpolation value. What I could do, is add a custom attribute where one can specify the GLTF interpolation modes... I will need to experiment with that a bit.

https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#animation-samplerinterpolation

@Damani2
Copy link
Author

Damani2 commented Mar 11, 2021

For some reason my Maya's keep crashing on startup, so I can't test this right now... I'll get back to you when this is fixed.

Now, ccurrently Maya2glTF always uses linear interpolation between two sampled keys. When "abusing" scaling for visibility, one should use "STEP" interpolation...

Because Maya2glTF is a sampling exporter (e.g. it reconstructs all animation values from world space transformations), I can't just read the Maya curve interpolation value. What I could do, is add a custom attribute where one can specify the GLTF interpolation modes... I will need to experiment with that a bit.

https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#animation-samplerinterpolation

@Damani2 Damani2 closed this as completed Mar 11, 2021
@Damani2 Damani2 reopened this Mar 11, 2021
@ziriax
Copy link
Collaborator

ziriax commented Mar 12, 2021

I was finally able to open your scene on another PC.

I'm not able to export animation at all, so I'll need to debug this. I'll report back if I have more news.

@Damani2
Copy link
Author

Damani2 commented Mar 12, 2021

I was finally able to open your scene on another PC.

I'm not able to export animation at all, so I'll need to debug this. I'll report back if I have more news.

I was actually able to get it working! The note on step interpolation helped. I redid all the keys as step and it worked. Attaching my file. I am still a bit bothered by the way the scale transition looks. It gives a bit of a "blippy" effect. I want to try maybe using houdini/voxels for shapekey transitions.

https://drive.google.com/drive/folders/1rY14xeltZwn4WR8BXA7Ebubf9aZHZmk_?usp=sharing

@ziriax
Copy link
Collaborator

ziriax commented Mar 16, 2021

I'm preparing a new release that will allow exporting STEP animation (it will detect this after sampling).

So in the node editor, you can just connect the shape's visibility to the node's scale x,y and z, and then export with the -dsa 2 argument (-detectStepAnimations 2).

I also suggest you reduce the polygon count of your apples :)

@ziriax
Copy link
Collaborator

ziriax commented Mar 16, 2021

If you want, you can try this release. Feedback is welcome 😃

@ziriax ziriax changed the title Unable to export a mesh sequence with scale keys Export scale keys with STEP interpolation instead of LINEAR Mar 16, 2021
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

2 participants