FORUMS: list search recent posts

Layer Space Transforms with offset

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Joel Slabaugh
Layer Space Transforms with offset
on Jun 4, 2015 at 7:00:12 pm

Hi all,

I'm trying to have 2d layers follow 3d layers in space. The effect is a 3d timeline with 2d numbers labeling the increments marked by 3d dots. I currently have it setup so that as you duplicate layers, they increment and offset to extend the timeline. My approach is to transform the 3d dots' coordinates with toComp and fromComp as follows but the offset seems to be off.


What i think is going on is the offset is being applied to the wrong type of coordinates but i'm not sure how to add it in the correct way.


This shows how the first base point "4" (the one that has no offset) aligns correctly. But as you duplicate the layer and it automatically increments itself it doesn't align along the 3d timeline correctly, using the code below.



Any suggestions are appreciated. Thanks.

Here's what I have for the positioning of the 2d layers (the comments are what i think is supposed to occur):

x = "the offset spacing between dots on the 3d timeline"; //calculates the number of increments and size of increments away from the base point of the timeline that travels along the x axis. This is determined by user input and the index of the layer.


L = comp("3dTimeline").layer("BasePointOfTimeline"); // gets the base point of the timeline
AP = [L.anchorPoint[0]+x, L.anchorPoint[1], L.anchorPoint[2]]; //adds the calculated offset to the x value that the 3d timeline travels along.
fromComp(L.toComp(AP)) //transforms the coordinate with the offset to it's 2d equivalent.




Return to posts index

Dan Ebberts
Re: Layer Space Transforms with offset
on Jun 4, 2015 at 7:45:39 pm

It's hard to know if this will work (depends on how you have things set up), but have you tried changing the last line to this:

L.toComp(AP)

Also, is there a reason that your expression calculates the position of the 3D layer, rather than just referencing it by name?


Dan



Return to posts index

Joel Slabaugh
Re: Layer Space Transforms with offset
on Jun 4, 2015 at 8:09:38 pm

Thanks for the response, Dan.

I did try that and it doesn't seem to align things. I calculate the position of the 3d layer so that i can add the offset to just the x value. I'm sure there's a cleaner way to do that, or even one that actually works. HA
I attached a cleaned up project file so the basics are included. Basically the goal is the pink layers in TIMELINE are the days and as you duplicate them they should extend along the timeline incrementally as you duplicate. Currently they do except for the position. They move a little when you move the camera around so it's clear there's some sort of connection. But when you move to the other side of the timeline they don't follow the rotation at all so it seems the coordinate space must be wrong.



8898_timelinetest.aep.zip



Return to posts index


Joel Slabaugh
Re: Layer Space Transforms with offset
on Jun 5, 2015 at 3:14:41 am

Dan, do you think it has to do with my camera being parented? Maybe fromComp doesn't take the camera's correct position as it is.



Return to posts index

Dan Ebberts
Re: Layer Space Transforms with offset
on Jun 5, 2015 at 4:14:54 am

I think that's unlikely because if you un-parent the camera, things don't jump. I suspect it's something simple, but it's hard to decipher how you have things set up.

Dan



Return to posts index

Joel Slabaugh
Re: Layer Space Transforms with offset
on Jun 5, 2015 at 4:30:53 am

Can i help with any direction on how i have it setup? Maybe i can add some notes for what i was thinking of accomplishing when writing the expressions...
Btw, i really appreciate your motionscript.com site. Very helpful and user friendly. Many thanks.



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]