Skip to main content
Damienned
Inspiring
Jan 5, 2012 3:55 PM UTC
Answered

Is it possible to transform a selected gradient in javascript?

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.
Damienned
DamiennedCorrect answer
Inspiring
Jan 7, 2012 5:11 PM UTC
Please download the attached file to view this post

2 replies

Inspiring
Jan 6, 2012 4:53 AM UTC

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.

Translate
Damienned
DamiennedAuthorCorrect answer
Inspiring
Jan 7, 2012 5:11 PM UTC
Please download the attached file to view this post
Translate