Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Photoshop Scripting
/* eslint-env photoshop */
/**
* New 3D Layer from File.
* @param {String} modelFilepath Absolute path to the 3D file
*
* Examples:
* `addLayer3D('C:\\example\\scene.wrl');`
* `addLayer3D('C:\\example\\scene.dae');`
* `addLayer3D('C:\\example\\scene.obj');`
* `addLayer3D('C:\\example\\scene.stl');`
*/
function addLayer3D(modelFilepath){
var list1 = new ActionList();
var desc1 = new ActionDescriptor();
list1.putPath(new File(modelFilepath));
desc1.putList(stringIDToTypeID('fileList'), list1);
executeAction(stringIDToTypeID('add3DLayerFromFile'), desc1, DialogModes.NO);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.