Path constraint
Copy link to clipboard
Copied
Hi everyone,
I'm completely stranger to SDK dev so i'm just wondering if my problem can be solved that way. And maybe you'll have a simpler idea ( I can't find the solution by script).
I'd like to position a layer on a mask path by some kind of percentage of the path. Like a path constraint in 3dsMax.
Do you think there is a simple way to achieve this?
PS: sorry for the frenchglish language
Copy link to clipboard
Copied
Hi Bertrand!
If the maskPath isn't animated, then just copy paste the maskPath into the Position parameter of your layer...
If it's animated and you have access to the maskPath data (via scripting, for example...), the easiest is to apply an expression on your position (Dan Ebbert's done the job for all of us, as usual )
http://www.motionscript.com/expressions-lab-ae65/bezier.html
Expression is a bit heavy to compute, but it's way easier than writing C++ native plugin!
There was a javascript application to do that a few years ago, written by Bresnev Shu, but it's no longer available... but if you find someone who still got it, you can steal it from him!
Cheers,
François
ps: j'utilise le même frenchglish! 😉
Shameless advertising for my plugins: the coming update of BAO_Mask_Avenger includes this function !
Copy link to clipboard
Copied
Hi françois,
I saw your plugins, and it looks great.
Thx a lot for your answer. In fact I thought about this solution to "recreate" the bezier curve algorithm, but I couldn't imagine it was that simple.
I think I'd be able to make a script to do the job now. This won't update during animation ( as we can't access maskpath vertices by expressions (well, maybe you know a way to achieve this?)) but it should be ok.
Thx again.
ps: ca fait plaisir de voir un compatriote sur ces forums.
Copy link to clipboard
Copied
Accessing maskPath vertices directly via expression is not possible... or not that I know...
My plugin is a work around: you don't really dynamically access vertices, but you control them via parameters, wich are accessible.
Cos' trying to retrieve data dynamically leads to troubles, you can believe me!
It's because AE computes Geometry, then Effects...
Parameters are part of Effects, so updating there value occurs AFTER Geometry, and if you intend to get Geometry datas...
If you go the scripting way, it'll be really easy to get the vertices coordinates (myLayer.Masks.property(myMaskIndex).maskShape.valueAtTime(myTime, false).vertices[vertexIndex])
Then your expression will be processed during Geometry, so the result is available at proper time.
Cheers,
François
Copy link to clipboard
Copied
Hi françois,
Is your plugin made in C++ or script?
What are parameters you're speaking of? I know nothing like that in script.
thx for your answers anyway
Copy link to clipboard
Copied
It's a native plugin, made in C++, which is much more powerfull than scripting, but also a lot more work (and troubles) !
The SDK forum is for native plugins developpement, there is also a Scripting forum where you can find usefull and probably more accurate information.
C++ plugins can use scripting too (mine do), via "ExecuteScript" command, so you can find posts where scripting is dicussed also.
But if you have scripting questions, I'll be glad to answer (if I can) in this forum !
Cheers,
François

