Copy link to clipboard
Copied
I am using java script to parse the PSD file and generate layer information in another format.
In target PSD, smart object layers are expected to be rotated/scaled with certain Anchor Point (Pivot) and it need not to be MIDDLECENTRE. In such case how can i calculate the Anchor Point from layer. I am using Adobe Photoshop CC 2020.
It hard to deal with Smart Object layer in a Photoshop Script unless the Script created the Smart Object for it the knows quite a bit about the Object Smart Object layer Object Transform That it is not distorting or rotating the object. The object transform may be scaling the object but the script can scale it to 100% and get the bounds of the layer know the object size.
If the smart exist and your script did not create you may be able to use the code r-bin posted in this forum to the g
...Copy link to clipboard
Copied
layer.anchorPoint returns undefined
Copy link to clipboard
Copied
Please explain what you are talking about; how is the anchor point defined, …?
Maybe post a screenshot including the pertinent Panels to clarify.
Copy link to clipboard
Copied
It hard to deal with Smart Object layer in a Photoshop Script unless the Script created the Smart Object for it the knows quite a bit about the Object Smart Object layer Object Transform That it is not distorting or rotating the object. The object transform may be scaling the object but the script can scale it to 100% and get the bounds of the layer know the object size.
If the smart exist and your script did not create you may be able to use the code r-bin posted in this forum to the get information about the existing Object transform. You seem to get the four corner points and the warping data. If the four corners form a perfect rectangle the Object may not currently be rotated or distorted but it could be rotated some multiple of 90 and the aspect ratio could have been change to distort the object.
Here is a Smart object layer in a mockup. Other Smart object Layer in the mockup share this smart Object. Each Smart Object layer has it own complex transform for the layer that transforms rotates and warps the object for the layer's use. Look at the seat back transform and warp. Wrapping is a transform option look at the transform tool option bar.
 
					
				
				
			
		
 
					
				
				
			
		
Find more inspiration, events, and resources on the new Adobe Community
Explore Now