• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
1

How to achieve this animation?

Explorer ,
Feb 02, 2024 Feb 02, 2024

Copy link to clipboard

Copied

z-axis.png

At first, my question was how to rotate the anchor point so that the z-axis faced the correct direction to hinge this folder face to be in the position below it. I read about creating a null layer and parenting to that. Honestly, that proved to be quite tedious (and unsuccessful), but also I wasn't able to set up the null positioning before parenting the layer without it then repositioning the child. (Both issues are shown below in the video.)

 

z-axis.gif

 

Then I thought that maybe I was going about this the wrong way, and that I should redraw the folders head on, rotate it from the head on perspective, then use a camera to show the 45° angle. Is this the correct way to appoach this? If so, I have two questions. 

 

  • How do I maintain the stroke width for the 3d layer? (An expression, maybe?)
  • How would I draw the sides of the folders for the camera rotation?

 

If this isn't the best method, is it possible to achieve this animation, of the folder hinging open, while maintaining the stroke with? Are there any other tricks or techniques? Thank you

TOPICS
Expressions , How to

Views

218

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Feb 05, 2024 Feb 05, 2024

I oversimplified things without thinking about it very much. The solution I gave kind of works with straight lines but fails to take into account the perspective changes, and I failed to remember that the start and end tangents are parented to the vertices when you use the extended version of the Create Nulls from Paths script. It's going to take some more complicated math to get this to work with curved lines. Instead of simply using an L.toWorld([0, 0, 0]) function to attach a 2D point to a la

...

Votes

Translate

Translate
Community Expert ,
Feb 03, 2024 Feb 03, 2024

Copy link to clipboard

Copied

The folders you want to flip down must be drawn square to the camera. If you rotate in Y and then rotate in X, you will get weird motion along the X axis. Instead, change the Y orientation to put the illustration at an angle to the Acgive Camera the same way you would orient a folder on a real set. Then rotate in X to make the folder lie down.

RickGerard_0-1706982337180.gif

3D layers are going to have perspective. To make the lines appear to have the same width, all you need to do is add a camera with a long lens to reduce the perspective shift. Perspective (vanishing point lines) is controlled by distance from the camera or camera position, framing is controlled by focal length. Try a 100 to 200-mm lens. 

 

If you want the lines to appear to have the same thickness as the folder rotates toward the camera, you will have to turn on the C4D rendering engine and extrude the lines to the same depth as the thickness of the lines.

 

The only other option would be to keep the layer 2D and use the Create Nulls from Paths script from the Window Menu to create a null for each point on the math using the Points Follow Nulls button. Then, create a set of duplicate nulls and shift parent each one to the appropriate null created by the script to snap them to the same 2D position. Next, remove the parenting, and make all of your rotate nulls 3D. 

 

You will have to use Create Nulls From Paths Extended if you want curves and also attach nulls to each vertex. With straight lines, the comp looks like this. 

RickGerard_1-1706984960542.gif

I have arranged the 3D nulls below each of the nulls created by the script and added this simple expression to convert 3D space to 2D space for the nulls controlling the path.

L = thisComp.layer(index+1);
L.toComp([0, 0, 0])

The expression just looks at the layer 3D layer below it and converts 3D space to comp space.

 

I have uploaded an After Effects 2023 project file for you to fiddle with.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 04, 2024 Feb 04, 2024

Copy link to clipboard

Copied

Thank you so much for your thorough response. I redrew the folders and created nulls using the Points Follow Nulls from the Extended version.

 

Screenshot 2024-02-04 at 2.22.08 PM.png

Would you mind sharing a quick gif on how to duplicate the nulls? And then I shift-parenting each duplicate to its corresponding null created by the 'Create Nulls... Extended'? Do I add the position expression to each scripted-null once shift-parented, and then removed? Honestly, a quick gif of those last steps would help immensely. I apologize for my ignorance, but I feel I'm almost there there thanks to you.


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 05, 2024 Feb 05, 2024

Copy link to clipboard

Copied

I oversimplified things without thinking about it very much. The solution I gave kind of works with straight lines but fails to take into account the perspective changes, and I failed to remember that the start and end tangents are parented to the vertices when you use the extended version of the Create Nulls from Paths script. It's going to take some more complicated math to get this to work with curved lines. Instead of simply using an L.toWorld([0, 0, 0]) function to attach a 2D point to a layer's 3D space, I'm going to need to calculate the distance from and the angle to the camera to adjust the position of the points for accurate 3D. I will then also need to calculate the change in position of the in and out handles based on the relationship between the path points and the 3D nulls they are following. The math is going to take some research, and I don't have time for that now. Maybe Dan Ebberts, one of the best expressions and scripting men in the world, will see this post and provide a quicker solution for the expressions.

 

As far as the workflow to generate your 3D nulls for the Points with no curves, try this:

  1. Select the path and apply Points Follow Nulls to generate a new null for each point on the path
  2. Select all of the new paths (with Orange labels), duplicate them (Ctrl/Cmnd + D), Change the label color to red, and make them 3D
  3. Add a new Rotater Null and make it 3D, then position it at the center of rotation
  4. Select all the Red layers from the Label Group tab and Parent them to the Rotation null
  5. Select the first Orange Null created by the script and add the toWorld expression to it
  6. Use the file menu or right-click to Copy the expression only
  7. Select the Orange Label Group again and paste, verifying that the expression was added to all layers using the P key
  8. Manipulate the Rotation properties of the Rotater null

 

Selecting a label group and changing colors is done by right-clicking on the layer label.

 

You now have an orthographic 3D representation of a moving 3D layer. Orthographic means no perspective. 

 

If I figure out how to compensate for the camera and give you perspective, or better yet, figure out how to fix the curves problems with the start and end handles generated by Create Nulls From Paths Extended, I'll post the solution and probably create a tutorial.

 

The expression for this workflow:

L = thisComp.layer(index -1);
L.toWorld([0, 0, 0]);

Here's what the workflow looks like:

RickGerard_0-1707121156330.gif

I hope this helps a bit.

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 07, 2024 Feb 07, 2024

Copy link to clipboard

Copied

It does help immensely. Thank you so much for taking the time, Rick.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 07, 2024 Feb 07, 2024

Copy link to clipboard

Copied

rotation-axisq2.gif

Curious why my folder isn't hinging correctly. Any ideas? Thanks again for all of your help. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 07, 2024 Feb 07, 2024

Copy link to clipboard

Copied

It looks like your folder path is scaled and the nulls are not lined up with the verticies. Can you share the AEP file?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 08, 2024 Feb 08, 2024

Copy link to clipboard

Copied

Yes, I noticed that the nulls seem to be attaching to a wider path shape, but I don't believe I've scaled anything. Here's the file. Thanks again. Also, I'm using AE 2020 for this specific project.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 08, 2024 Feb 08, 2024

Copy link to clipboard

Copied

I found a solution that works from this forum post: https://community.adobe.com/t5/after-effects-discussions/create-nulls-from-paths-position-is-way-off....

 

It seems to be a bug that has to do with originally working in AI, despite creating shapes from layers in AE. This script did the trick: https://www.pablocuello.com/scripts/

Thanks again for all your help, Rick!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 08, 2024 Feb 08, 2024

Copy link to clipboard

Copied

LATEST

I wish I had known you were working with shape layers created from vector paths. You did not need a script. All you needed to do was select the Right Front layer, press the U key twice to reveal all modified properties, reset the Transform/Group 1/Position, the Anchor Point, and the Position values, and then use the Create Nulls from Paths/Points Follow Nulls script, and your nulls would like up with the path points perfectly.

 

Because of the bezier curves in the vector files, you're going to get some distortion when the path is rotated, but everything should line up just fine.

RickGerard_0-1707451638466.gif

This was my complete workflow. No scripts are needed. 

 

If I get some time, I'll try to work out the fix for the Bezier handles that you can apply to the nulls attached to the Handle Controls

so the lines don't get distorted in X when the Rotator is moved.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines