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

[CS5] [JS]-Gradient Feather with Gradient Stops Question

New Here ,
Aug 01, 2011 Aug 01, 2011

Copy link to clipboard

Copied

Hello,

Have any of you ever scripted applying a Gradient Feather with Opacity Gradient Stops. If so, I would appreciate you assistance. I'm trying to apply multiple effects to objects. I can apply the gradient feather but I am having issues with the stops.

//Inner Glow settings from milligramme var obj=app.activeDocument.selection[0]; $.writeln(obj.transparencySettings.innerGlowSettings.properties.toSource().replace(/,/g,",\n")); with (obj.transparencySettings.innerGlowSettings){   applied = true;   blendMode = 1852797549/*BlendMode.NORMAL*/;   opacity = 100;   noise = 0;   effectColor = "Paper";   technique = 2020618338/*GlowTechnique.PRECISE*/;   spread = 79;   size = '0.125in';   source = 2020618594 /*InnerGlowSource.EDGE_SOURCED*/;  } //Directional Feather settings, based off milligrammes script var obj=app.activeDocument.selection[0]; $.writeln(obj.transparencySettings.directionalFeatherSettings.properties.toSource().replace(/,/g,",\n")); with (obj.transparencySettings.directionalFeatherSettings){   applied = true;   angle = 46;   noise = 0;   chokeAmount = 49;   followShapeMode = FollowShapeModeOptions.ALL_EDGES;   bottomWidth = '0.25in';   topWidth = '0.125in'   rightWidth = '0.6in'   leftWidth = '0in' } // Gradient Feather Settings, PLEASE HELP var obj=app.activeDocument.selection[0]; $.writeln(obj.transparencySettings.gradientFeatherSettings.properties.toSource().replace(/,/g,",\n")); with (obj.transparencySettings.gradientFeatherSettings){   applied = true;   angle = 90;   type = 1635282023/*GradientType.LINEAR*/; // GradientStop settings go here???????   }

I am not grasping how I am supposed to get the values of the Gradient stops into the script. If you can help me with this, you can use any stop settings you have. Any help would be greatly appreciated.

Thank you very much,

Danny

TOPICS
Scripting

Views

1.2K
Translate

Report

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

Contributor , Aug 01, 2011 Aug 01, 2011

Hi

GradientStop can access via.

obj.transparencySettings.gradientFeatherSettings.opacityGradientStops

it is collection of OpacityGradientStops.

with (obj.transparencySettings.gradientFeatherSettings){   applied = true;   angle = 90;   type = 1635282023/*GradientType.LINEAR*/;   // GradientStop settings go here???????   with(opacityGradientStops){     // by default, it has two stops     for (var i=0, iL=opacityGradientStops.length; i < iL ; i++) {       $.writeln(opacityGradientStops.properties.toS

...

Votes

Translate
Contributor ,
Aug 01, 2011 Aug 01, 2011

Copy link to clipboard

Copied

Hi

GradientStop can access via.

obj.transparencySettings.gradientFeatherSettings.opacityGradientStops

it is collection of OpacityGradientStops.

with (obj.transparencySettings.gradientFeatherSettings){   applied = true;   angle = 90;   type = 1635282023/*GradientType.LINEAR*/;   // GradientStop settings go here???????   with(opacityGradientStops){     // by default, it has two stops     for (var i=0, iL=opacityGradientStops.length; i < iL ; i++) {       $.writeln(opacityGradientStops.properties.toSource());     };     // you can edit     opacityGradientStops[0].opacity = 0;     opacityGradientStops[1].opacity = 100;         // you can add a gradient stop, but add at end of collection     // so remove last stop, and add again     // do you have any nice idea?     opacityGradientStops[1].remove();     var mid_op_grad_stop = opacityGradientStops.add({       opacity:50,       location:50,       midpoint:50,     });     var last_op_grad_stop = opacityGradientStops.add({       opacity:100,       location:100,       midpoint:50,     });   } }

Thankyou

mg.

Votes

Translate

Report

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
New Here ,
Aug 02, 2011 Aug 02, 2011

Copy link to clipboard

Copied

LATEST

Thank you!

Votes

Translate

Report

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