Skip to main content
Damienned
Inspiring
January 5, 2012
Answered

Is it possible to transform a selected gradient in javascript?

  • January 5, 2012
  • 2 replies
  • 1504 views

var omf = 2.834645;

var moveMatrix = app.getTranslationMatrix((-10*omf), (-10*omf));

var rotateMatrix = concatenateRotationMatrix( moveMatrix, 0 );

var totalMatrix =  concatenateScaleMatrix (rotateMatrix, 500, 500);

app.activeDocument.selection[0].transform(totalMatrix,false,false,true,false,0, Transformation.CENTER);

I wrote the following script but it doesn't seem to transform the gradient.

Please help...

Cheers Daniel

This topic is closed to new replies. Start a new post to keep the conversation going.
Correct answer Damienned
Please download the attached file to view this post

2 replies

Inspiring
January 6, 2012

AFAIN, transform(transformationMatrix[,changePositions][,changeFillPatterns][,changeFillGradients][,changeStrokePattern][,changeLineWidths][,transformAbout]), the [changeFillGradients] option is only valid whether to rotate the FillGradients or not.

So the answer is impossible.

However, with Scriptographer it is possible.

Damienned
DamiennedAuthorCorrect answer
Inspiring
January 7, 2012
Please download the attached file to view this post