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

Can you share any explanation about math used in this plugin? #11

Open
mishazawa opened this issue Jul 6, 2023 · 2 comments
Open

Can you share any explanation about math used in this plugin? #11

mishazawa opened this issue Jul 6, 2023 · 2 comments

Comments

@mishazawa
Copy link

Hello. I'm struggle to find information about math involved into this type of AE<->Blender plugins (tracking, camera transforms, coordinate systems, AE Keyframe Data). Do you know any resources that share this information or explanations of things?

I'm trying to build similar plugin for Houdini and even investigated source code of older AE2Blend plugin, but it made in some cryptic way and it is hard to figure out how I should interpret data.

Thank you.

@adroitwhiz
Copy link
Owner

A lot of this plugin is very After Effects-specific, but I'll try to go over it a little.

  • Blender and After Effects use different coordinate systems. In After Effects, the Y-axis points upwards and the Z-axis points forward. In Blender, it's the other way around. This is easy enough to deal with in translation and scaling (just swap the axes) but harder to deal with in rotations. It looks like Houdini uses the same coordinates as AE, so you'll have to convert between coordinate systems too.
  • Rotations in both Blender and After Effects use Euler angles, which are simple in principle--you just rotate around the three axes in a specific order. Blender lets you choose that order, so importing After Effects layers is pretty easy.
  • Blender cameras with no rotations point downwards by default, while After Effects cameras with no rotations point forward. I believe that you can rotate any Euler angle by increments of 90 degrees without messing up the keyframes, but I have no idea how to do so without trial and error, which is how I corrected the Blender camera rotation.
  • Both Blender and After Effects use cubic Bezier curves for individual animation keyframe channels, which use 4 points to define smooth curve segments. After Effects uses a weird system for these, but after converting them to Blender's system, everything just works.
  • After Effects also has some weird "spatial" keyframe interpolation for 2D/3D points. I don't know how it works, and just bake that point's location at each frame. It's probably not possible to replicate it exactly in Blender. Hopefully Houdini doesn't have this problem.
  • In addition to rotation, After Effects layers have an "Orientation", which is represented internally as a quaternion, another way to represent 3D rotations. Blender supports those too, so I just bake the layer orientation value at each frame (if it's keyframed) then import that into Blender. Hopefully Houdini doesn't make you deal with this either.

Let me know if you have any more specific questions. My response time will probably be a little longer but I'll try to get back to you.

@mishazawa
Copy link
Author

thank you for response. I will dive into...

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