ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

rotate offset

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Susan Lan
rotate offset
on Aug 19, 2015 at 3:01:26 pm

I have this position time offset, but, how to turn into for rotation offset, please?

offset = -.5;

p = thisComp.layer("My Animated Layer");

t = time + offset;

p.position.valueAtTime(t);


Return to posts index

Walter Soyka
Re: rotate offset
on Aug 19, 2015 at 3:26:37 pm

offset = -.5;
p = thisComp.layer("My Animated Layer");
t = time + offset;
p.rotation.valueAtTime(t);


Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index

Susan Lan
Re: rotate offset
on Aug 19, 2015 at 4:27:21 pm

Thanks Walter! I get this error, I take a capture, can you help me please?

http://i.imgur.com/YAJqgbm.jpg

9157_errorrotationoffset.jpg.zip


Return to posts index


Walter Soyka
Re: rotate offset
on Aug 19, 2015 at 4:33:17 pm

Since it's referring to a 3D layer:

p.transform.zRotation.valueAtTime(t);

Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index

Susan Lan
Re: rotate offset
on Aug 19, 2015 at 4:42:01 pm
Last Edited By Susan Lan on Aug 19, 2015 at 4:42:39 pm

I linked the rotation of the 3d null of the ligth
to the rotation ogf the 3d null (cam control) of the camera

Both nulls are 3D activated...

I'm not english, but I undertand "since" as "that is because", no?

Corecct me please, Then you are saying that I must write:
offset = +.5;
p = thisComp.layer("Cam Control").transform.zRotation.valueAtTime(t);
t = time + offset;
p.rotation.valueAtTime(t);


instead of:
offset = +.5;
p = thisComp.layer("Cam Control").transform.zRotation;
t = time + offset;
p.rotation.valueAtTime(t);


yes? Thanks Walter!


Return to posts index

Walter Soyka
Re: rotate offset
on Aug 19, 2015 at 9:07:21 pm

p refers to a layer, not to the property. You'd need to change the property reference.

offset = -.5;
p = thisComp.layer("My Animated Layer");
t = time + offset;
p.transform.zRotation.valueAtTime(t);


Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index


Susan Lan
Re: rotate offset
on Aug 20, 2015 at 6:33:32 am

Good mornig Walter! I just try it and, I want to aks you if it is normal this: ¿it is normal that only works: if, in the line "p" that refers to the layer we only write the name of the layer to which we want to follow the rotation (instead of select that line and pick/take the whip to parent to the z rotation)??:

offset = -.5;
p = thisComp.layer("Cam Control");
t = time + offset;
p.transform.zRotation.valueAtTime(t);


instead of this in line "p" of layer (this follow get error, ¿the reason is because we tell the "transform Z Rotation in "p" property line and because of that, is not necesary tell to it again in the "layer" line?

offset = -.5;
p = thisComp.layer("Cam Control").transform.zRotation;
t = time + offset;
p.transform.zRotation.valueAtTime(t);


Thanks you Walter


Return to posts index

Susan Lan
Re: rotate offset
on Aug 20, 2015 at 1:23:31 pm

I asked that, also because, it seems that the null of the AE-pointLigth rotates, but I can't notice the offset, although I change -.5 to +.5
It still seems that the null of the ligth is linked to the null of the camera, both make the same rotation and position, but, I do not notice the sensation that the camera follows the light, I don't know how to explain, I imagined to maked the ligth moving a little bit faster (time offset, no?) and that the camera follows, pursues the ligth (which in sometimes "dodge" (I don't know the word) the camera)...

:(


Return to posts index

Walter Soyka
Re: rotate offset
on Aug 20, 2015 at 1:34:53 pm

I'm getting a little lost. Can you post a screenshot of your entire UI so I can see the comp layers with some keyframes and understand better what you are applying these expressions to?

Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index


Susan Lan
Re: rotate offset
on Aug 20, 2015 at 2:32:54 pm

Good evening Walter!

Yes, thank you and sorry for the inconveniences, here I upload the image:

http://i.imgur.com/2GoYZCg.jpg

I write an expression into the: Position of the null of the ligth, to follow the position of the null of the camera (called "Cam Control")
was this
thisComp.layer("Cam Control"); transform.position + [effect("Slider Control")("Slider"),effect("Slider Control 2")("Slider"),effect("Slider Control 3")("Slider")];

then I add it, inside the code of "position offset":
offset = +.5;
p = thisComp.layer("Cam Control"); transform.position + [effect("Slider Control")("Slider"),effect("Slider Control 2")("Slider"),effect("Slider Control 3")("Slider")];
t = time + offset;
p.position.valueAtTime(t);




Then I write an expression into the: Rotation of the null of the ligth, to follow the Rotation Z of the null of the camera (called "Cam Control").

I got this to the parent-follow:
thisComp.layer("Cam Control").transform.zRotation
But when I want to add it, into our expression of rotation offset I must remove the part
.transform.zRotation
To add, finally, like this (the expression yo tell me)
offset = +.5;
p = thisComp.layer("Cam Control");
t = time + offset;
p.transform.zRotation.valueAtTime(t);


P.D.: It does not looks good, because also I'm trying to turn the cone of ligth (the beam) in a manner that seems firstly that the beam are in Y axis , I mean, lookin at this frist:
http://cloud8.lbox.me/images/384x384/201203/ultrafire-decreto-xm-1000-l-t6-...
and then animate the ligth beam


Return to posts index


Walter Soyka
Re: rotate offset
on Aug 21, 2015 at 10:38:18 am

I've rewritten your expression to try to make it a little clearer what it's doing.

Position:
timeOffset = -1;
stopFollowingAtTime = 8;

referenceTime = Math.min(time + timeOffset, stopFollowingAtTime + timeOffset);
referenceLayer = thisComp.layer("LEADER");
positionOffset = [effect("offsetX")("Slider"),effect("offsetY")("Slider")];

value + referenceLayer.transform.position.valueAtTime(referenceTime) + positionOffset;



Rotation:
timeOffset = -1;
stopFollowingAtTime = 8;

referenceTime = Math.min(time + timeOffset, stopFollowingAtTime + timeOffset);
referenceLayer = thisComp.layer("LEADER");

value + referenceLayer.transform.zRotation.valueAtTime(referenceTime);


Please feel free to ask questions on anything above that's unclear.

Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index

Susan Lan
Re: rotate offset
on Aug 21, 2015 at 11:43:07 am

Hi walter! Million of thanks!!

I wanted to ask about line 5, because I'm not sure how to write the slider of offset position (and also because I have also a slider for Z position, but in your code tyhere is not Z position)


It is good one of these tryes? For POSITION

MY TRY 1)

positionOffset = [effect("Slider Control")("Slider"),effect("Slider Control 2")("Slider"),effect("Slider Control 3")("Slider")];

MY TRY 2)

positionOffset = [effect("offsetX")("Slider Control")("Slider"),effect("offsetY")("Slider Control 2")("Slider"),effect("offsetZ")("Slider Control 3")("Slider")];

MY TRY 3)

positionOffset = [effect("offsetX")("Slider Control"),effect("offsetY")("Slider Control 2"),effect("offsetZ")("Slider Control 3")];

Thank you Walter


Return to posts index


Susan Lan
Re: rotate offset
on Aug 21, 2015 at 11:52:20 am

When I try the
MY TRY 2)
AND
MY TRY 3)
a error windows says:
"could'n find effect named 'offsetX" Expression disabled"

But I'm not sure if MY TRY 1) Is correct the add of Z?


Return to posts index

Walter Soyka
Re: rotate offset
on Aug 21, 2015 at 12:07:41 pm

I named my control effects -- so my sliders are named offsetX, offsetY, etc. If you rename those slider control effects in the Effects Control Panel (ECP), you'll see the names update in the expressions, too.

So your Try #1 is correct for now, but I'd suggest renaming the effects as I did so the names are meaningful in the ECP and timeline, without digging through the code.

Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index

Susan Lan
Re: rotate offset
on Aug 21, 2015 at 12:13:21 pm

You're an Hero for me Walter!!

I change -1 to +2 to be the ligth in frotn of the camera, to feel that the camera behind it, is pursuing the ligthy, but in some time the ligth stop (it is not second 8 yet) and the camera continuous, Can I upload into dropbox to you can see the ligth and camera layers only, or it will be inconvenience?


Return to posts index

Walter Soyka
Re: rotate offset
on Aug 21, 2015 at 12:24:48 pm

[Susan Lan] "Can I upload into dropbox to you can see the ligth and camera layers only, or it will be inconvenience?"

Sure, but it will be a couple of hours before I'll have the chance to review it.

Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index

Susan Lan
Re: rotate offset
on Aug 21, 2015 at 12:31:08 pm

Then best I take a photo/capture, one moment


Return to posts index

Susan Lan
Re: rotate offset
on Aug 21, 2015 at 12:36:03 pm

The follow though make sense? (is correct?)

I think that because of I have change the offset tiem from -1 to +2 (in order to make the ligth in front the camera and not behind it)

For that, the ligth "stops" 2 seconds before the camera stops (althought is not yet second 8 to stop as says the expression)

Can be that the reason why the ligth stops 2 seconds before the camera? How can I fix it?

Or better I don't touch -1 and I offset the position of the ligth in front?
But if I don't change -1, who pursues to who? the ligth pursues to the camera?


Return to posts index

Susan Lan
Re: rotate offset
on Aug 21, 2015 at 12:52:37 pm

the null of ligth (where I write your code) stops at 0:00:02:23
and the layer "LEADER", that is the Cam Control stops at 0:00:04:23

The capture:
http://i.imgur.com/t28qeqM.jpg

It is possible to tell to the code, to this line:
referenceTime = Math.min(time + timeOffset, stopFollowingAtTime + timeOffset);
that we don't want to take the offset value for stop? Or it is not for that reason why the ligth stops 2 seconds before the camera stops, since the time offset is 2 seconds (in order to make the ligth in front of the camera, and make the camera pursuing the ligth)


Return to posts index

Walter Soyka
Re: rotate offset
on Aug 21, 2015 at 3:01:57 pm

[Susan Lan] "It is possible to tell to the code, to this line:
referenceTime = Math.min(time + timeOffset, stopFollowingAtTime + timeOffset);
that we don't want to take the offset value for stop?"


Yes, make it this instead:

referenceTime = Math.min(time + timeOffset);

Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index

Susan Lan
Re: rotate offset
on Aug 21, 2015 at 3:31:38 pm

Good evening Walker!

I'm thinking, because although I turn this lines:
referenceTime = Math.min(time + timeOffset, stopFollowingAtTime + timeOffset);

into this one:
referenceTime = Math.min(time + timeOffset);

it still do the same: the ligth stops 2 seconds before the camera stops ( because the time offset it is 2 seconds) and when I put +1 of time offset, then the ligth stops 1 second afther the camera stops.

Then, if we imagine that we don't want to stop never, the the code you gave me, how will be?

timeOffset = -1;
stopFollowingAtTime = 8;

referenceTime = Math.min(time + timeOffset, stopFollowingAtTime + timeOffset);
referenceLayer = thisComp.layer("LEADER");
positionOffset = [effect("offsetX")("Slider"),effect("offsetY")("Slider")];

value + referenceLayer.transform.position.valueAtTime(referenceTime) + positionOffset;


__________________
and then can we make to stop the expression in another way: creating a New layer Null Object, adding there a fx Checkbox Control and then adding to your code that when the Checkbox is ON we must obey the expression, and we it will be OFF we can do wahtever manually (with values attached to sliders) some like this?:

control = thisComp.layer("Null").effect("Checkbox Control")("Checkbox") ;

if (control == 1)
{
thisComp.layerblablablabla//can we add here your fantastic code?;
}
else
{
[640,360,0];//this linked to news slider to continue manually?
}


can we? can you, please?


Return to posts index

Walter Soyka
Re: rotate offset
on Aug 21, 2015 at 4:27:52 pm

I made a mistake above -- apologies -- the line should be:

referenceTime = Math.min(time + timeOffset, stopFollowingAtTime);



[Susan Lan] "and then can we make to stop the expression in another way: creating a New layer Null Object, adding there a fx Checkbox Control and then adding to your code that when the Checkbox is ON we must obey the expression, and we it will be OFF we can do wahtever manually (with values attached to sliders) some like this?:"

This will cause a jump where the expression stops evaluating and the manual values take over, unless you carefully match the manual values to the last expression-evaluated ones.

Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index

Susan Lan
Re: rotate offset
on Aug 21, 2015 at 5:17:00 pm

Thanks Walter, trying this code (changing the line you tell me)

timeOffset = +2;
stopFollowingAtTime = 8;
referenceTime = Math.min(time + timeOffset, stopFollowingAtTime);

referenceLayer = thisComp.layer("Cam Control");
positionOffset = [effect("Slider Control")("Slider"),effect("Slider Control 2")("Slider"),effect("Slider Control 3")("Slider")];

value + referenceLayer.transform.position.valueAtTime(referenceTime) + positionOffset;


still stopping the ligth the same second of offset, the same second stopts before the LEADER stops (although is not second 8)

perhaps because of the last line?

P.D.: They are not renamed yet (the sliders controls) because typyng the "retunr" don't let me change the name, but does not matter for now

Thanks you Walter!


Return to posts index

Susan Lan
Re: rotate offset
on Aug 21, 2015 at 5:20:22 pm

How will be this code if we don't wanted to stop never (but we yes wanted to maintain the offset time, and the offset position)?

timeOffset = +2;
stopFollowingAtTime = 8;
referenceTime = Math.min(time + timeOffset, stopFollowingAtTime);

referenceLayer = thisComp.layer("Cam Control");
positionOffset = [effect("Slider Control")("Slider"),effect("Slider Control 2")("Slider"),effect("Slider Control 3")("Slider")];

value + referenceLayer.transform.position.valueAtTime(referenceTime) + positionOffset;


Return to posts index

Walter Soyka
Re: rotate offset
on Aug 21, 2015 at 5:26:20 pm

It would be very helpful to see your project file.

Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index

Susan Lan
Re: rotate offset
on Aug 21, 2015 at 6:16:23 pm

I'm sorry Walter to make you lost so much time for my fault, here is the proyect (It is in AE CS6, and the ligth with Trapcode Lux) I deleted other 3d extra stuff:

https://www.dropbox.com/s/0y7feyis1y89uia/TRYING-54.aep?dl=0

If we can't find the way to make both, the Leader layer (the camera control null) and the layer which followed it (the null of ligth), make both stop at the same time, then, perhaps it's better to the stopping with the "Chechbok Controller"? I will try very hard to "you carefully match the manual values to the last expression-evaluated ones." and match carefully,

can you tell me please, how make thist code min a way to never be stopped? (for add it, in that expression of checkbox?

timeOffset = +2;
stopFollowingAtTime = 8;
referenceTime = Math.min(time + timeOffset, stopFollowingAtTime);

referenceLayer = thisComp.layer("Cam Control");
positionOffset = [effect("Slider Control")("Slider"),effect("Slider Control 2")("Slider"),effect("Slider Control 3")("Slider")];

value + referenceLayer.transform.position.valueAtTime(referenceTime) + positionOffset;


Return to posts index

Susan Lan
Re: rotate offset
on Aug 21, 2015 at 6:22:16 pm

I forget to say you (about the Proyect) that in the AE Proyect, the layer called "Back AE-Spot" is the cone of ligth (the beam of the ligth), altogth I linked its position, to the position of the point ligth (called "Front AE-Ligth") I must to animated the rotation/orientation of the cone of ligth "Back AE-Spot", ...in order to feel that the cone ligth moves at the same direction of the ligth, but it seems it can be done with expression


Return to posts index

Susan Lan
Re: rotate offset
on Aug 22, 2015 at 12:31:20 pm

The other link does not works, the link that works is this:
https://www.dropbox.com/s/0y7feyis1y89uia/TRYING-54.aep?dl=0


Return to posts index

Walter Soyka
Re: rotate offset
on Aug 24, 2015 at 12:41:29 pm

[Susan Lan] "still stopping the ligth the same second of offset, the same second stopts before the LEADER stops (although is not second 8) perhaps because of the last line?"

The light stops because the LEADER stops. The light stops at 2:22, because the LEADER stops at 4:22 and the light is offset by two seconds.

If the expressions are confusing, this might be easier to follow if you keyframe one layer, then copy and and paste the keyframes onto the other layer.

Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index

Susan Lan
Re: rotate offset
on Aug 24, 2015 at 6:13:25 pm

You're the best Walter!!!

Thanks a lot for your time, patience, and for your great knowledge!!

I use this code you give me for Position and for Rotation.

I want to know -for other project that I want to use too-, how to keep using the code but deleting the tiem for stopp (I have another project where I want to follow a LEADER Layer with some offset, but without stopping at any time, then... for that project I must use the same code but, which line I must delete to never stop the expression?

POSITION
timeOffset = -1;
stopFollowingAtTime = 8;

referenceTime = Math.min(time + timeOffset, stopFollowingAtTime + timeOffset);
referenceLayer = thisComp.layer("LEADER");
positionOffset = [effect("offsetX")("Slider"),effect("offsetY")("Slider")];

value + referenceLayer.transform.position.valueAtTime(referenceTime) + positionOffset;


ROTATION
timeOffset = -1;
stopFollowingAtTime = 8;

referenceTime = Math.min(time + timeOffset, stopFollowingAtTime + timeOffset);
referenceLayer = thisComp.layer("LEADER");

value + referenceLayer.transform.zRotation.valueAtTime(referenceTime);


Return to posts index

Walter Soyka
Re: rotate offset
on Aug 24, 2015 at 6:17:41 pm

Remove this line:
stopFollowingAtTime = 8;


Change this line:
referenceTime = Math.min(time + timeOffset, stopFollowingAtTime + timeOffset);
...to this:
referenceTime = time + timeOffset;

Walter Soyka
Designer & Mad Scientist at Keen Live [link]
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
@keenlive [twitter]   |   RenderBreak [blog]   |   Profile [LinkedIn]


Return to posts index

Susan Lan
Re: rotate offset
on Aug 25, 2015 at 1:23:42 pm

Thank you Walter!!


Return to posts index

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