Copy link to clipboard
Copied
Hello Community,
currently I am working on an automotive project and I was trying to find a way to control the blend effect "radial wipe" by the position of a Null object.
The scene contains a Null, which runs along a curve. Beside some other things the Null does, I would want to create a radial mask, just like the radial wipe. But my poor expression skills haven´t brought me further.
The path is not a full circle (277.1°) ! - I attached a solid to the null to kind of aim-constrain to it. That showed me some rotation values starting from -67.5° going to 0 to 180 and then to -150.4° (in sum 277.1°). My idea was somehow to tell the radial wipe that it´s 0% start is my -67.5° and the 100% is the -150.4° but I fail in doing so.
Then I thought that maybe instead of the negative values I should take the 277.1° but that didn´t work as well.
Then I tried to construct a radial wipe like mask out of solids, but it doesn´t work. I could hook those nicely to the null but the overlaping pieces just can´t be masked. Im out of ideas and asking for help and maybe someone is here to give some hints.
Thanks for reading and the help in advance.
Cheers
Copy link to clipboard
Copied
That's an interesting conversion. Maybe something like this:
r = (your rotation value);
if (r > -90)
linear(r,-67.5,180,0,100*247.5/277.1)
else
linear(r,-180,-150.4,100*247.5/277.1,100);
Dan
Copy link to clipboard
Copied
Hey Dan,
thanks for the help.
What I have right now is this:
I created a solid with the radial wipe effect. This will be my synced mask, which I want to use for each other element to be masked. I called it RotationMask
In the effect settings of the radial wipe, I hooked your expression into the "Completion" attribute (don´t know the english term for it, cause I have it in german here )
This is the code there so far:
a=thisComp.layer("RotationMask_VALUE").transform.rotation;
r = (a);
if (r > -90)
linear(r,-67.5,180,0,100*247.5/277.1)
else
linear(r,-180,-150.4,100*247.5/277.1,100);
The layer RotationMask_VALUE is a second solid, which is aiming to the Null - thats where I get the angle information and will be invisible because it only gets the values. The expression there is this:
target = thisComp.layer("mouse layer"); // set this to the layer to aim at
p = position - target.position;
radiansToDegrees( Math.atan2( p[1], p[0] ) )
(Mouse Layer is the Null, btw)
Right now, the setup doesn´t work as wanted. Plus I have the problem of alligning the start point of the radial wipe to the Null´s initial position.
Any ideas?
Thank you very much
Erce
Copy link to clipboard
Copied
I don't follow. You can't calculate a surface normal or tangent just from a single origin point. Hence it would be impossible to have the radial wipe respond in the manner you seem to desire. You have to include a look-ahead or look-behind point sampled from the path to have a stable reference for the "edge" of the wipe. Conversely, that would be required to determine from which sector the angular functions actually return their values. You know, a full circle is 2 x Pi, not just Pi and different angles produce the same values. Once you clean up that mess, everything else will fall into place - your crooked angle values could likely easily be normalized to sensible ranges because once you actually calculate the inclination, it can simply be added/ subtracted.
Mylenium
Copy link to clipboard
Copied
Hey Mylenium,
So you say that I have to get rid of my "value" solid and instead of that I would want to put a "look ahead" (whatever and however...) to the Null to get the proper angle. But it would also then require a point FROM where (center of rotation) it does measure, right? Also you talk about a full circle hopefully knowing, that my "circle" isn´t full? Im not sure, like I said...I have poor skills in scripting and this is a tough one for me including not even knowing all the possible tricks. So "mea culpa"
Thanks
Erce