Page 1 of 1

Script to postion an anchor point in middle of layer

Posted: April 28th, 2009, 8:53 am
by uroshp
Hey guys,
I have no scripting knowledge and am starting to figure out expressions so i'll be relying on your help for this one
(if it's possible)

lets say i create a 1080p solid where i draw a mask around only one little part of it on the left hand side. Then when i select that layer my anchor point is where it was before and not in the middle of my mask.

Would it be possible to create a script that would center the anchor point to the mask area without moving the mask around? so what it would need to do is move the anchor point to the new middle (which will move the mask to the middle of the comp) and then have to move the solid to it's original x,y,z coordinates so it matches the original position of the mask.

Any ideas?
Thanks in advance!
Ollie

Re: Script to postion an anchor point in middle of layer

Posted: April 28th, 2009, 10:18 am
by kobyg
Check out this script (script from Nabscripts.com and modified for Video Copilot).
I don't know where you can find the script by itself... here it is boundeled with a project file:
http://www.videocopilotstore.net/208b91 ... cts/86.zip
unzip the file to extract: MasksToLayers.jsx (from "Script" folder)

This script will duplicate your layer and will reposition the anchor point at the center of the mask.
In case you have several masks on that layer, the script will duplicate the layer for each mask you have on it (each duplicate will contain only one mask) and it will reposition the anchor point of each duplicate at the center of its mask.

I hope this helps.

Koby.

Re: Script to postion an anchor point in middle of layer

Posted: April 28th, 2009, 3:45 pm
by uroshp
oh wow man!
thanks so much for the info. i'll download and give it a spin!

thanks again!