Sure Target 1.6

Moderators: Disciple, zlovatt

Post Reply
Foudou
Posts: 19
Joined: March 27th, 2009, 1:54 am

April 15th, 2009, 12:10 pm

I don't know if anybody here is using the Andrew Kramer SureTarget preset.

He doesn't work with parenting layer, i have modified the expression for work with parent. It works perfectly with the position and for each rotation axis, but it doesn't work for simultaneous rotation in two or three axis.

It strange and i need this feature for a project.

I don't know if anybody had search a solution for the same problem, or if there is a other solution.

If somebody want to see the modified code. I will post-it tomorrow.

Thanks.

I
Image
FrenchEnglish inside.
Yenaphe
Posts: 84
Joined: February 3rd, 2009, 6:30 pm
Location: Paris - France
Contact:

April 16th, 2009, 7:43 am

Foudou, i don't exactly understand what you want to do. Could you explain it better ? Whant do you what to parent, and what rotation does not work, camera or null object ?

If it's too complicated to explain in english, you can drop me a line in french on my email address: seb@sperier.com.
Foudou
Posts: 19
Joined: March 27th, 2009, 1:54 am

April 17th, 2009, 5:58 am

A link to understand of what we are talking :

http://www.videocopilot.net/tutorials/presets_and_more/

This is the original code for the SureTarget 1.51 preser.

Code: Select all

ST = effect("SureTarget")("Curseur");
Min = Math.floor(ST);
Max = Min+1;

try{
L = effect("T-"+Min)("Calque"); M = effect("T-"+Max)("Calque"); exists = true;
}catch (err){
function countItems(obj) { a=0; while (true) { a++; try { eval(obj+"("+a+")"); } catch(error) { a--; break; } } return a }  TargetCount = countItems("effect") - 5; exists = false;
} 

// here is the part who interessting me
if(exists){  Amin = effect("T-"+Min)("Calque").position+wig; Amax = effect("T-"+Max)("Calque").position+wig; }else{Amin = effect("T-"+(TargetCount))("Calque").position+wig; Amax = effect("T-"+TargetCount)("Calque").position+wig;}

if(effect("EaseTargets")("Case") == 0){ linear(ST,Min,Min+1,Amin,Amax); }else{ ease(ST,Min,Min+1,Amin,Amax); }
If you used this with parented layers, it makes a weird trajectory. So i have modified the code with a basic toWorld. It look like this :

Code: Select all

ST = effect("SureTarget")("Curseur");
Min = Math.floor(ST);
Max = Min+1;

try{
L = effect("T-"+Min)("Calque"); M = effect("T-"+Max)("Calque"); exists = true;
}catch (err){
function countItems(obj) { a=0; while (true) { a++; try { eval(obj+"("+a+")"); } catch(error) { a--; break; } } return a }  TargetCount = countItems("effect") - 5; exists = false;
} 
 // here is the modified part.
if(exists){  Amin = effect("T-"+Min)("Calque").toWorld((0,0,0),time)+wig; Amax = effect("T-"+Max)("Calque").toWorld((0,0,0),time)+wig; }else{Amin = effect("T-"+(TargetCount))("Calque").toWorld((0,0,0),time)+wig; Amax = effect("T-"+TargetCount)("Calque").toWorld((0,0,0),time)+wig;}

if(effect("EaseTargets")("Case") == 0){ linear(ST,Min,Min+1,Amin,Amax); }else{ ease(ST,Min,Min+1,Amin,Amax); }
But you always have the same problem with the rotation of the parented layers, this is the original code.

Code: Select all

 if(exists){ Amin = effect("T-"+Min)("Calque").transform.zRotation; Amax = effect("T-"+Max)("Calque").transform.zRotation;}else{Amin = effect("T-"+TargetCount)("Calque").transform.zRotation; Amax = effect("T-"+TargetCount)("Calque").transform.zRotation;}
And this is the modified version of the code based on Dan Ebberts http://www.motionscript.com/mastering- ... ient.html
, who allow the following of the zRotation

Code: Select all

// i'm calculating the possible value before the test!
u = effect("T-"+Min)("Calque").toWorldVec([1,0]);
Umin = radiansToDegrees(Math.atan2(u[1],u[0]));

u = effect("T-"+Max)("Calque").toWorldVec([1,0]);
Umax = radiansToDegrees(Math.atan2(u[1],u[0]));

u = effect("T-"+TargetCount)("Calque").toWorldVec([1,0]);
UTargetCount = radiansToDegrees(Math.atan2(u[1],u[0]));

if(exists){ Amin = Umin; Amax = Umax;}else{Amin =UTargetCount; Amax = UTargetCount;}  
I have adapted this code for xRotation and yRotation by changing the toWorldVec in (0,1,0) and atan2(u(2),u(1)) for xRot and (0,0,1) and atan2(u(0),u(2)) for yRot.

It works for each rotation, but not if you used more than one rotation expression, because the rotation value becomes weird.

IN this state, it's useful but in order to become the real 1.6 version, i have to find a solution and for the moment i have no idea. The math works so i can't figure out why the rotation can't interact.

A possibility is to find an other technic to get the rotation value, without the toWorldvec.

If anybody have a solution, it will be useful for one of my script project, with a lot of parented text layer.

Thanks!

P.S.: a possibility is to search a recursive method to add all the rotation of the parented layer, until the first parent value, to obtain the real rotation value, even if it could take a long time with a lot of layers. :P
Image
FrenchEnglish inside.
Yenaphe
Posts: 84
Joined: February 3rd, 2009, 6:30 pm
Location: Paris - France
Contact:

April 18th, 2009, 3:18 am

Ok, i'm still a little bit confused (but i do often use suretarget so at least i know how it works).

You have a problem with rotation when parenting a layer to suretarget. But do you parent the layer to the camera, or to the null object. My guess is the null object.

Do you have a test project, or a preview render so i can see how wrong your rotation goes so i can figure out what's wrong with the expressions.
Foudou
Posts: 19
Joined: March 27th, 2009, 1:54 am

April 19th, 2009, 2:23 pm

The problem is parenting between the layer and not between the SureTargetNullObject and the camera.

A basic example will be :
a first text layer
a second text layer parenting to the first
a third text layer parenting to the second

If i use the classic suretarget configuration the camera do something like this :

http://www.dailymotion.com/falsetto/video/15172925

With my correction on the suretarget there isn't this problem except on the rotation on more than one axis at the time :

http://www.dailymotion.com/falsetto/video/15173169
On this exemple, all text layer are parented (2nd to first, 3rd to 2nd, etc...).

And for finish an example where sure target works but only with ZRotation :
http://www.dailymotion.com/falsetto/video/15173249
Image
FrenchEnglish inside.
Post Reply