Highlighted

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

New Here ,
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, FAQ, How to, Problem or error, SDK

Views

59

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

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

New Here ,
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, FAQ, How to, Problem or error, SDK

Views

60

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 23, 2020 0
Most Valuable Participant ,
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

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 23, 2020 0
JJMack LATEST
Most Valuable Participant ,
Sep 05, 2020

Copy link to clipboard

Copied

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

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