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

## Sure Target 1.6

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.

If it's too complicated to explain in english, you can drop me a line in french on my email address: seb@sperier.com.

SÃ©bastien

http://www.yenaphe.info

http://www.yenaphe.info

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); }
```

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); }
```

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;}`

, 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;}
```

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.

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.

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.

SÃ©bastien

http://www.yenaphe.info

http://www.yenaphe.info

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