Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


Translation Matrix: Source(s) for Documentation and Explanation?

Community Beginner ,
Nov 08, 2021 Nov 08, 2021

Copy link to clipboard

Copied

Where are the properties of an Illustrator "Translation Matrix" object documented and explained?

 

Attempting to [a] retrieve, then [b] modify, and finally [c] apply a translation(s) to ~2,000 images using Javascript.

 

What little documentation regarding the composition of the Translation Matrix included in:

  • Illustrator CC Scripting Guide, and
  • Adobe Illustrator CC Scripting Reference: Javascript

merely lists these seven properties without definition nor explanation:

  1. Matrix.mValueA
  2. Matrix.mValueB
  3. Matrix.mValueC
  4. Matrix.mValueD
  5. Matrix.mValueTX
  6. Matrix.mValueTY
  7. Matrix.typename

 

Hence this appeal: Where can one find documentation (and explanation) regarding the properties in an Illustrator Translation Matrix?

 

Many, many thanks for the assist!

 

TOPICS
Scripting

Views

94

Likes

Translate

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
Adobe Community Professional ,
Nov 08, 2021 Nov 08, 2021

Copy link to clipboard

Copied

check this page for a great deal of information about Matrices

 

https://www.senocular.com/flash/tutorials/transformmatrix/

Likes

Translate

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
Enthusiast ,
Nov 08, 2021 Nov 08, 2021

Copy link to clipboard

Copied

Hi @Plane Wryter, small point of clarification: *translation* means moving—you can do that in Illustrator by using the translate() method of a page item.

What you are refering to (as Carlos mentioned) is a *transformation* matrix (or transform matrix). Tranformation includes rotation and skewing as well as translation.

I only mention this because if you actually only want to apply a translation (as your post mentions) you don't need to mess with matrices.

- Mark

Likes

Translate

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
Community Beginner ,
Nov 08, 2021 Nov 08, 2021

Copy link to clipboard

Copied

@CarlosCanto and @m1b, thanks!

@m1b: Thanks for the clarification. I do need to make minor adjustments to dimensions (width & height), rotation, and [re-]scale (all less than 1%).

Can all three parameters be affected by a transformation matrices?

  • BTW: The senocular reference is quite obtuse (although I did take Matrix Algebra as an undergrad). After reading it, I remain unclear as to the meaning of the seven properties listed above. Any further insights on their meaning?

Many thanks!

Plane Wryter

Likes

Translate

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
Adobe Community Professional ,
Nov 08, 2021 Nov 08, 2021

Copy link to clipboard

Copied

the senocular info it's not obtuse at all, you need to read it again, and again until it gets clear

 

it clearly reads in one of the first paragraphs

"The transformation matrices in Flash that define these affine transformations use a 3 x 3 matrix consisting of 3 rows and 3 columns. The positions of values within this matrix are labeled abcdtxtyuv, and w. In matrices, these are known as elements."

 

it lists the exact same properties Illustrator matrix object uses.

 

to read, modify and apply a 20 pt translation to a selected rectangle

 

var idoc = app.activeDocument;
var sel = idoc.selection[0];

var im = app.getIdentityMatrix(); // retrieve

im.mValueTX = 20; // modify

sel.transform (im, true, true, true, true, 1, undefined); // apply

  

Likes

Translate

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
Adobe Community Professional ,
Nov 08, 2021 Nov 08, 2021

Copy link to clipboard

Copied

but you shouldn't worry about matrix values or use them to do what you need, you can use getScaleMatrix, concatenateRotationMatrix, then concatenate other matrix if you need to, then finally apply that combined transformation matrix, it's all in the Illustrator Reference with samples.

Likes

Translate

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
Advocate ,
Nov 08, 2021 Nov 08, 2021

Copy link to clipboard

Copied

The properties in question are the elements of the matrix.  For example, the elements of a matrix which rotates a selected item 90 degrees are as follows:

 

var m = app.getRotationMatrix(90);
alert(m.mValueA  + "\t"     + m.mValueB + "\n" + 
      m.mValueC  + "\t\t\t" + m.mValueD + "\n" + 
      m.mValueTX + "\t\t\t" + m.mValueTY);
selection[0].transform(m);

 

Likes

Translate

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
LEGEND ,
Nov 08, 2021 Nov 08, 2021

Copy link to clipboard

Copied

LATEST

The fact is transformation matrixes are a widely used feature in 2D graphics; often used to position every object. I learned from the PostScript Language Reference Manual. So Adobe won't redocument this. 

Two ways to think about them

- a magic set of rules for moving, rotating or scaling objects; combine them to make more transformations like shearing. 
- a description of 6 of the elements in a 3x3 matrix used to transform positions. The other 3 elements are invariant. 
Google should find you a treatment that works for you.

6 of your 7 items are standard matrix elements; the 7th is presumably part of the API needs. 

Likes

Translate

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