Skip to content

Instantly share code, notes, and snippets.

@cecilemuller
Created April 6, 2019 16:53
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cecilemuller/a748b0f69218fdb6fbc49b238a9036ea to your computer and use it in GitHub Desktop.
Save cecilemuller/a748b0f69218fdb6fbc49b238a9036ea to your computer and use it in GitHub Desktop.
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