Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Photoshop Scripting - how to get 3D solid body default extrusion Z-scale?

New Here ,
Dec 10, 2019 Dec 10, 2019

I am looking for help or ideas on how to programmatically determine the appropriate Z-scale factor I need to set on an extruded 3D body in Photoshop so that it will be scaled to a desired thickness (e.g. 3mm).

I am able to programmatically create a 3D solid body extrusion from a bumpmap layer, but when Photoshop creates the 3D extrusion, I am seeing a Z-scale with a value of something like 286.87 pixels. Depending on the bump map, the Z-scale will be different. In other test cases, my extrusion is created with a Z-scale of 359.53, for example. I don't understand why the Z-scale is different with different bumpmaps, or if that is configurable somehow.

In any case, I need to set the thickness of the geometry to 3mm thick. In the UI this is very easy, I can set the units to 'millimeters' and type in '3' and the system will calculate the Z-scale that needs to be applied to accomplish a thickness of 3mm. For example, in my body that has a default Z-scale of 286.87 pixels (126.83mm), when I type in 3mm as the Z-scale, behind the scenes it actually applies a value of 0.023653 as the scale factor. And since 126.83 * .023653 = 3, I get an extrusion at 3mm thick. You can see this if you record an action script, you'll see the Z-scale value that is actually applied even though the user types 3 into the user interface.

But programmatically, you can't just pass in '3mm'... you have to pass in the Z-scale factor (e.g. .023653).

But to do that, I need to know what the default scale-value is, inverse that and multiply it by 3 to get my scale factor, or...

Scale Factor = Desired Thickness * (1 / default Scale Value).

Here's the problem. I don't know how to get the default scale value. It changes based on the bump map and I don't see any way to programmatically ask Photoshop to give me this information. And if I can't get the default scale value, then I can't figure out what scale factor I need to apply to get my desired thickness.

I hope someone has an idea how to do this. I've thought about exporting the 3D body to another file format and using another program to get the data, which seems absurd. Another idea is to show the image from the side (viewing the x-y plane) and to create an image from that and see if I can somehow analyze the image to compute the Z-axis. That also seems absurd. I'm not sure how else to do it.

TOPICS
Actions and scripting
319
Translate
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
Guest
Dec 10, 2019 Dec 10, 2019

i also want 3D solid body default extrusion Z-scale.

Translate
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 ,
Dec 10, 2019 Dec 10, 2019

I can't offer any specific advise, but it always seemed to me like there are some document dimensions and resolution vs. map size/ res calculations going on there in the first place. Perhaps you can also dig up some old papers on Repoussé when Adobe sold it as the next big thing on MAX years ago that might explain the underlying resolution math a bit better. There were definitely some docs on this, even if they may have been very rudimentary.

 

Mylenium

Translate
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
New Here ,
Dec 12, 2019 Dec 12, 2019
LATEST

Thank you for the suggestion. I think I will also try some experimenting with creating 3d extrusions from solid black or solid white or 50% white surfaces to see if I can draw a correlation to the underlying process. From that, hopefully I can analye the ingoing bump map and determine from that what the resulting extrusion depth will be.

Translate
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