Highlighted

rotated angle of group layer using script

New Here ,
Aug 20, 2020

Copy link to clipboard

Copied

We have a rotated group layer like below.

antony3w_0-1597924243163.png

And trying to get the rotated angle of group layer from script. But while i cannot find any APIs to retrieve the angle. I tried to calculate the angle using corners from "r-bin" post for getting angle from Smart Objects(Thanks r-bin and JJack). But for group layers, current value of corners are returned when using layer.bounds().

 

antony3w_1-1597924293629.png

In this case, how can we get or calculate the rotated angle of group layer?

 

Thanks in advance

Adobe Community Professional
Correct answer by ceyhun_akgun | Adobe Community Professional

You have to convert the entire group Layer to Smart Object from the beginning. In this case, you can always see the rotations with their current values.

Ekran Resmi 2020-08-20 15.36.24.png

TOPICS
Actions and scripting, How to, Windows

Views

84

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

rotated angle of group layer using script

New Here ,
Aug 20, 2020

Copy link to clipboard

Copied

We have a rotated group layer like below.

antony3w_0-1597924243163.png

And trying to get the rotated angle of group layer from script. But while i cannot find any APIs to retrieve the angle. I tried to calculate the angle using corners from "r-bin" post for getting angle from Smart Objects(Thanks r-bin and JJack). But for group layers, current value of corners are returned when using layer.bounds().

 

antony3w_1-1597924293629.png

In this case, how can we get or calculate the rotated angle of group layer?

 

Thanks in advance

Adobe Community Professional
Correct answer by ceyhun_akgun | Adobe Community Professional

You have to convert the entire group Layer to Smart Object from the beginning. In this case, you can always see the rotations with their current values.

Ekran Resmi 2020-08-20 15.36.24.png

TOPICS
Actions and scripting, How to, Windows

Views

85

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
Aug 20, 2020 0
LEGEND ,
Aug 20, 2020

Copy link to clipboard

Copied

Groups are not Smart Objects, they do not retain information about past transformations. 

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
Reply
Loading...
Aug 20, 2020 1
LEGEND ,
Aug 20, 2020

Copy link to clipboard

Copied

If the rotating transformation is part of a Script with manual input (DialogModes.ALL) the value can be retrieved, though. 

But maybe you need to explain in more detail what exactly you are trying to achieve and what role the angle plays in a larger context. 

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
Reply
Loading...
Aug 20, 2020 0
New Here ,
Aug 20, 2020

Copy link to clipboard

Copied

Rotating layers is not a part of script. PSD design is done by customer and we need to extract the PSD file and generate details in other file formats(XML).

 

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
Reply
Loading...
Aug 20, 2020 0
LEGEND ,
Aug 20, 2020

Copy link to clipboard

Copied

In this case you are apparently trying to retrieve information that the group does not contain. 

 

If someone else already rotated the Group then the Group is as it is, what good would the information about it having been rotated in the past do now? 

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
Reply
Loading...
Aug 20, 2020 0
LEGEND ,
Aug 20, 2020

Copy link to clipboard

Copied

Does the Group contain Smart Objects which one can assume were never transformed except as part of the Group? 

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
Reply
Loading...
Aug 20, 2020 0
New Here ,
Aug 20, 2020

Copy link to clipboard

Copied

We are not sure all group contains smart objects. It could only contain artlayers like TEXT.

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
Reply
Loading...
Aug 20, 2020 0
Adobe Community Professional ,
Aug 20, 2020

Copy link to clipboard

Copied

Did you try copycss.jsx script that comes with the Photoshop and gives transformation properties.  May be that script can help you to get the transformation. That script is very long but it gives transformation properties.

Best regards

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
Reply
Loading...
Aug 20, 2020 1
LEGEND ,
Aug 20, 2020

Copy link to clipboard

Copied

»Did you try copycss.jsx script that comes with the Photoshop and gives transformation properties.«

Do you mean »CopyCSSToClipboard.jsx«? 

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
Reply
Loading...
Aug 20, 2020 1
Adobe Community Professional ,
Aug 20, 2020

Copy link to clipboard

Copied

You can access Copycss.jsx code from the following thread

https://community.adobe.com/t5/photoshop/how-to-get-text-transform-box-boundary/m-p/11142576?page=1

Also, you can try solution suggested by r-bin.

Best regards

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
Reply
Loading...
Aug 20, 2020 2
Adobe Community Professional ,
Aug 20, 2020

Copy link to clipboard

Copied

Yes, you catch me 🙂

Best regards

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
Reply
Loading...
Aug 20, 2020 1
Adobe Community Professional ,
Aug 20, 2020

Copy link to clipboard

Copied

You have to convert the entire group Layer to Smart Object from the beginning. In this case, you can always see the rotations with their current values.

Ekran Resmi 2020-08-20 15.36.24.png

Graphic Designer Educator / PrePress Consultant

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
Reply
Loading...
Aug 20, 2020 2