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

[Question] using javascript to change 3dLayer's texture

New Here ,
Aug 23, 2020 Aug 23, 2020

Copy link to clipboard

Copied

Hello everyone,

I'm rather a developer then an artist, and currently working on e-commece site project.

My client has tons and tons of designs and it has to be rendered on realistic model.

first thing i tried was blender but I didn't find many of beautiful product mockups there and finally I had a look at a photoshop mockup.

I bought few of them from creative market and the result is very beautiful and so realistic.

Problem here is that I'm trying to achieve the functionality programmatically (changing 3d layer's texture). 

first screenshot is layers and when I dobule click on the texture, (sorry my photoshop is installed in korean and can't change it for some reason).

second is me struggling to do it somehow and how I got lost.

I went through lots of docs but couldn't really find anything clear for this.

Is there any way to do this?

 

TOPICS
Actions and scripting , SDK

Views

206

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 Expert ,
Aug 23, 2020 Aug 23, 2020

Copy link to clipboard

Copied

In a Photoshop script you may be able to open the textures in Photoshop.   If that can be scripted you most likely would need to use action manager there would most likely not be any DOM method.  That would mean Javsscript it look like you may net prototyping in Applet script.  I do not know if the  the script would have access to the UV overlay

JJMack

Votes

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 Expert ,
Sep 05, 2020 Sep 05, 2020

Copy link to clipboard

Copied

LATEST

If the 3D Layer is the current layer this seem to open the top texture. The Script would need to locate the 3d Layer and target it and know which texture it want to replace and have an appropriate replacement texture.

if (app.activeDocument.activeLayer.kind==LayerKind.LAYER3D) open3DLayerTexture(0);

function open3DLayerTexture(textureIndex) {
	var descriptor = new ActionDescriptor();
	descriptor.putInteger( stringIDToTypeID( "textureIndex" ), textureIndex );
	executeAction( stringIDToTypeID( "open3DLayerTexture" ), descriptor, DialogModes.NO );
}

 

JJMack

Votes

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