Script to postion an anchor point in middle of layer

What type of scripts do you need?

Moderator: byronnash

Post Reply
uroshp
Posts: 5
Joined: March 25th, 2008, 4:33 pm

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
kobyg
Posts: 128
Joined: December 7th, 2007, 10:11 am

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.
uroshp
Posts: 5
Joined: March 25th, 2008, 4:33 pm

oh wow man!
thanks so much for the info. i'll download and give it a spin!

thanks again!
Post Reply