Mask Reverse Path Direction
Moderator: Paul Tuersley
Mask Reverse Path Direction? How to make?
-
- Posts: 114
- Joined: March 10th, 2005, 5:50 am
- Location: London, UK
- Contact:
Perhaps if you could be more specific....
1.Select Layer
2.Select Mask
3.var TempMaskArray= new Array(Select Mask)
// TempMaskArray[0,1,2,3,4...,n]
4...
5. Select Mask = newMaskArray[n,...,4,3,2,1,0]
In the illustrator10 there is a function
Windows->Attributes(F11) Reverse Path Direction OFF / Reverse Path Direction ON
In the After Effects is not present.
Example.
One solid, two elliptical masks.
We apply Effect->Render->Stroke.

Problems appear at morphing masks.
2.Select Mask
3.var TempMaskArray= new Array(Select Mask)
// TempMaskArray[0,1,2,3,4...,n]
4...
5. Select Mask = newMaskArray[n,...,4,3,2,1,0]
In the illustrator10 there is a function
Windows->Attributes(F11) Reverse Path Direction OFF / Reverse Path Direction ON
In the After Effects is not present.
Example.
One solid, two elliptical masks.
We apply Effect->Render->Stroke.

Problems appear at morphing masks.
-
- Posts: 114
- Joined: March 10th, 2005, 5:50 am
- Location: London, UK
- Contact:
I would probably do something like :
- create a new shape object
- loop through the verts of the original mask and assign to the shape
- loop through the in and out tangents, swap them, and add to the shape
- apply the shape
A little function could do this quite neatly I'm sure.
Do you script?
:D
- create a new shape object
- loop through the verts of the original mask and assign to the shape
- loop through the in and out tangents, swap them, and add to the shape
- apply the shape
A little function could do this quite neatly I'm sure.
Do you script?
:D
-
- Posts: 114
- Joined: March 10th, 2005, 5:50 am
- Location: London, UK
- Contact:
I started thinking about it,so thought I'd do the leg work... just for fun....
It seems to reverse the mask just fine, although Vegas doesn't seem to respect this? Maybe your morphing thing will.
Let me know...
Cheers,
Dave
Code: Select all
function reverseMask (obj,maskIndex){
// check
if(obj==undefined){
alert('Object undefined');return
}
if(maskIndex>obj.Masks.numProperties){
alert('Incorrect mask index specified');return
}
// existing mask
var curMask= obj.Masks.property(maskIndex).property("ADBE Mask Shape")
var verts= curMask.value.vertices
var inTans= curMask.value.inTangents
var outTans= curMask.value.outTangents
// collect the values
var tempVerts=[]
var tempInTans=[]
var tempOutTans=[]
for(var i=curMask.value.vertices.length-1;i>=0;i--){
tempVerts.push(verts[i])
tempOutTans.push(inTans[i])
tempInTans.push(outTans[i])
}
// build the shape
var tempMask=new Shape()
tempMask.vertices = tempVerts
tempMask.inTangents = tempInTans
tempMask.outTangents = tempOutTans
tempMask.closed=curMask.value.closed
// assign mask
curMask.setValue(tempMask)
}
reverseMask(app.project.activeItem.layers[1],1)
Let me know...
Cheers,
Dave
Thanks! Works!
Only changes "Set First Vertex".
morphing no testing.
Only changes "Set First Vertex".
morphing no testing.
-
- Posts: 114
- Joined: March 10th, 2005, 5:50 am
- Location: London, UK
- Contact:
dude...
You'll have to be a little more descriptive with your responses! I'm a scripter - not a cryptologist!
You'll have to be a little more descriptive with your responses! I'm a scripter - not a cryptologist!
-
- Posts: 39
- Joined: November 2nd, 2005, 10:20 am
- Contact:
I can't get this script to work in AE7, I get Syntax error on line2.
Any ideas?
Thanks.
Phil
Any ideas?
Thanks.
Phil
Phil Spitler