220 likes | 420 Views
Programming Photoshop with Javascript and turning shapes into code with Illustrator. Tom Krcha @ tomkrcha Adobe San Francisco. ExtendScript + JavaScript. ExtendScript Toolkit. Extend Photoshop and Illustrator with custom commands. Sample ExtendScript. Export Styles to JSON.
E N D
Programming Photoshop with Javascriptand turning shapes into code with Illustrator TomKrcha @tomkrcha Adobe San Francisco
ExtendScript Toolkit Extend Photoshop and Illustrator with custom commands
Sample ExtendScript Export Styles to JSON
Adobe Generator Extend Photoshop with JavaScript
Generate Image Assets Export layers to files in realtime while you work Layer name suffix convention: @2x, .png, .jpg, .gif, .svg
Export PSD structure Includes bounds, text format and content, layer styles, blend modes, fills. Convert into JSON, CSS, HTML, XFL, XIB, NIB • //a layer object: • { • "id": 20, • "index":9, • "bounds": { "bottom": , "left":, "right": , "top": }, • "name": "Just some circles with FX to test Generator", • "type": "layerSection” • "visible":true • "protection": { "all":true}, • "blendOptions": { "mode": "passThrough" }, • "smartObject": { … }, • "layerEffects": { … }, • "layers": [ ], • "text" : { }, • "fill" : • { • "class": "solidColorLayer", • "color": { • "blue": 53.996, • "green": 255, • "red": 0.004 • }
Photoshop to Edge Reflow Exporter Written with Adobe Generator
Realtime workflow with Generator (Gaming, Loom SDK) http://www.youtube.com/watch?v=fMxvyB1fMNY
Adobe Generator Photoshop + Node.js + ExtendScript + + =
Adobe Generator Is Open Sourced
Adobe Generator Generator vs. Remote Connections
Adobe Generator API Events: imageChanged toolChanged generatorMenuChanged currentDocumentChanged subscribeToPhotoshopEvent (call) Calls: getDocumentInfo getPixmap savePixmap evaluateJSXString evaluateJSXFile alert addMenuItem
Advanced commands with ScriptingListenerJS.log (low level ActionDescriptor calls in PS) Download from http://www.adobe.com/devnet/photoshop/scripting.html
Save as SVG <pathfill="#FFFFFF" stroke="#000000" stroke-miterlimit="10" d=” M105,39 L9,18 C0,0,27,19,20,3 C129,44,120,75,120,75 L3,20 L-18,-9 L87,95 L3,-20 L76,60 L20,-3 L105,39Z"/> M – moveTo, L – lineTo, C – curveTo, Z - closePath
Drawscript Turn Adobe Illustrator vector shapes into graphics code HTML5 Canvas, Obj-C iOS, C++ OpenFrameworks, Processing, CreateJS, Raw points http://drawscri.pt
Drawscript example iOS Skinning with Drawscript Turn vector shapes into Obj-C http://drawscri.pt