Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Accessing mask data

Explorer ,
Nov 01, 2011 Nov 01, 2011

Is there a way to return mask data in a way that I may be able to export and parse it in nuke?

For instance,

app.project.activeItem.selectedLayers[0].Masks.property(1).property(1).valueAtTime(currentFrame/24,0)

Returns the mask path of the first mask of the first layer selected at the first frame assuming my comp is 24 fps. But when I alert() this, I am returned 'object Shape'. Now I'm not denying it is an object shape, but I was hoping to find data that I can at least try to work with. Any ideas?

Note: I'm fine with a solution that leaves the beziers baked. The masks are already baked in the first place for these purposes.

TOPICS
Scripting
933
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Nov 01, 2011 Nov 01, 2011

Say you do this:

var myMask = app.project.activeItem.selectedLayers[0].Masks.property(1).property(1) .valueAtTime(0,false);

myMask will be a shape object with 4 attributes:

myMask.vertices gives you an array of 2D points, in layer space, one for each vertex.

myMask,inTangents gives you an array of incoming tangent points, relative to each vertex.

myMask.outTangets gives you an array of outgoing tanget points, relative to each vertex.

myMask.closed is true if the shape is closed

Dan

Translate
Community Expert ,
Nov 01, 2011 Nov 01, 2011

Say you do this:

var myMask = app.project.activeItem.selectedLayers[0].Masks.property(1).property(1) .valueAtTime(0,false);

myMask will be a shape object with 4 attributes:

myMask.vertices gives you an array of 2D points, in layer space, one for each vertex.

myMask,inTangents gives you an array of incoming tangent points, relative to each vertex.

myMask.outTangets gives you an array of outgoing tanget points, relative to each vertex.

myMask.closed is true if the shape is closed

Dan

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 03, 2011 Nov 03, 2011
LATEST

Great, thanks.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines