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

Creating a Vector Mask from a Path

Explorer ,
Jun 10, 2011 Jun 10, 2011

How do I apply an existing path as a vector mask to an existing layer or a new solid color layer?
Saying that... how do I do that manually?

Thanks!

TOPICS
Actions and scripting
1.9K
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

Guide , Jun 11, 2011 Jun 11, 2011

Saying that... how do I do that manually?

If you have a non-background layer as active then you can select the path and go menubar/layer/vector mask/current path… done…

You can do the same with script like so…

#target photoshop var doc = app.activeDocument; doc.pathItems.getByName('Work Path').select(); pathtoVectorMask(); doc.pathItems.getByName('Work Path').remove(); function pathtoVectorMask() {      function cTID(s) { return app.charIDToTypeID(s); };      function sTID(s) { return app.stri

...
Translate
Adobe
Guide ,
Jun 11, 2011 Jun 11, 2011

Saying that... how do I do that manually?

If you have a non-background layer as active then you can select the path and go menubar/layer/vector mask/current path… done…

You can do the same with script like so…

#target photoshop var doc = app.activeDocument; doc.pathItems.getByName('Work Path').select(); pathtoVectorMask(); doc.pathItems.getByName('Work Path').remove(); function pathtoVectorMask() {      function cTID(s) { return app.charIDToTypeID(s); };      function sTID(s) { return app.stringIDToTypeID(s); };           var desc27 = new ActionDescriptor();           var ref11 = new ActionReference();           ref11.putClass( cTID('Path') );           desc27.putReference( cTID('null'), ref11 );           var ref12 = new ActionReference();           ref12.putEnumerated( cTID('Path'), cTID('Path'), sTID('vectorMask') );           desc27.putReference( cTID('At  '), ref12 );           var ref13 = new ActionReference();           ref13.putEnumerated( cTID('Path'), cTID('Ordn'), cTID('Trgt') );           desc27.putReference( cTID('Usng'), ref13 );      executeAction( cTID('Mk  '), desc27, DialogModes.NO ); };

The above assumes… 1. you have a document open… 2. your active layer is NOT background 3. you have a path called 'Work Path'… there may be some other checks that you should make too…

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 ,
Jun 11, 2011 Jun 11, 2011

Sweeeet! Exactly what I was looking for. Dunno why I couldn't find it. 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
Guide ,
Jun 11, 2011 Jun 11, 2011
LATEST

The only thing the script does different is I removed the original path after its duped to a layers vector mask…

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