Copy link to clipboard
Copied
We have a rotated group layer like below.
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().
In this case, how can we get or calculate the rotated angle of group layer?
Thanks in advance
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.
Copy link to clipboard
Copied
Groups are not Smart Objects, they do not retain information about past transformations.
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.
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).
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?
Copy link to clipboard
Copied
Does the Group contain Smart Objects which one can assume were never transformed except as part of the Group?
Copy link to clipboard
Copied
We are not sure all group contains smart objects. It could only contain artlayers like TEXT.
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.
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«?
Copy link to clipboard
Copied
Yes, you catch me 🙂
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.
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.