Using Create Nulls From Paths without Nulls (self contained)
Copy link to clipboard
Copied
Is it possible to use the new "Create nulls from paths" and relink the expression to its own layer rather than the null object.
I have a very basic object - a flower
It has a stem which is one single path.
Using Create Nulls from paths makes one at the stop of the stem and the bottom as you would expect
I then link the top of the stem null to the flower petals position.
This way I can move the flower and the stem bends and follows nicely
However I am wondering if I can alter the expression to bypass the null and link it directly to the position of the petals object group.
The direct code created out of create nulls from paths script.
I have been able to link the stem up using the Expression controls automatically created to select the shape instead of the null
however the null which then does nothing, breaks the code if deleted and it no longer works.
So I can bypass the null but its effectiveness is still dependent on the existence of the null which makes the attempt pointless.
var nullLayerNames = ["Shape Layer 2: Path 1 [5.1.0]","Shape Layer 2: Path 1 [5.1.1]"];
var origPath = thisProperty;
var origPoints = origPath.points();
var origInTang = origPath.inTangents();
var origOutTang = origPath.outTangents();
var getNullLayers = [];
for (var i = 0; i < nullLayerNames.length; i++){
try{
getNullLayers.push(effect(nullLayerNames)("ADBE Layer Control-0001"));
} catch(err) {
getNullLayers.push(null);
}}
for (var i = 0; i < getNullLayers.length; i++){
if (getNullLayers != null && getNullLayers.index != thisLayer.index){
origPoints = fromCompToSurface(getNullLayers.toComp(getNullLayers.anchorPoint));
}}
createPath(origPoints,origInTang,origOutTang,origPath.isClosed());
I can do without obviously but I was hoping to make the flower self-contained if possible. And then if it were possible to bypass the null I could learn by extrapolation and apply the bypass to other projects
Copy link to clipboard
Copied
Simply rewrite all the array stuff to only point to your point controls, not layers.
Mylenium
Copy link to clipboard
Copied
I'm trying to work out where to begin.
There are only 2 vertices and only 1 that needs to be linked effectively.
1 should be linked to transform.position*-1; (so that it stays still while the flower moves)
So I'm thinking the for loop can go but I'm unsure of how this code works exactly so not sure where I need to swap-in/insert my position data.
Copy link to clipboard
Copied
Wondering if somebody could possibly help me to strip away the code to simply rewrite arrays to point controls, not laters?
Really just trying to understand "createPath" better.
Even if it is not the code above it would be great to see an example of rewriting createPath without the arrays to get me started. I can't seem to work out where to rewrite to insert.
Should I provide an example file?

