westonthayer / bloks Goto Github PK
View Code? Open in Web Editor NEWFlexbox for Adobe Illustrator
Home Page: http://westonthayer.com/writing/2016/07/27/layout-experiments-in-adobe-illustrator/
License: MIT License
Flexbox for Adobe Illustrator
Home Page: http://westonthayer.com/writing/2016/07/27/layout-experiments-in-adobe-illustrator/
License: MIT License
Seems to happen rarely at random. Only known solution is to restart Illustrator.
The size of a clipping mask according to Illustrator's API is determined by the largest object in the clip group. This is super unintuitive, and they don't provide a nice way to get the size of the mask object.
Hey @WestonThayer,
I'm excited to try out your Illustrator plugin, but I'm having some troubles with the build process. Specifically I'm getting hung up on running the NPM build command. There were a bunch of missing gulp dependencies, which I think are all resolved, but now I seem to be missing some kind of credentials.
gulp build-jsx
/Users/eric/Library/Application Support/Adobe/CEP/extensions/com.westonthayer.bloks/gulpfile.js:65
throw new Error("./zxp-tools/certificate-creds.json doesn't exist! Please create it. Ex: { password: 'pwd' }");
^
Error: ./zxp-tools/certificate-creds.json doesn't exist! Please create it. Ex: { password: 'pwd' }
at Object.<anonymous> (/Users/eric/Library/Application Support/Adobe/CEP/extensions/com.westonthayer.bloks/gulpfile.js:65:15)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Liftoff.handleArguments (/Users/eric/Library/Application Support/Adobe/CEP/extensions/com.westonthayer.bloks/node_modules/gulp/bin/gulp.js:116:3)
at Liftoff.<anonymous> (/Users/eric/Library/Application Support/Adobe/CEP/extensions/com.westonthayer.bloks/node_modules/gulp/node_modules/liftoff/index.js:193:16)
at module.exports (/Users/eric/Library/Application Support/Adobe/CEP/extensions/com.westonthayer.bloks/node_modules/gulp/node_modules/liftoff/node_modules/flagged-respawn/index.js:17:3)
npm ERR! Darwin 15.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build-jsx"
npm ERR! node v4.4.6
npm ERR! npm v2.15.5
npm ERR! code ELIFECYCLE
npm ERR! [email protected] build-jsx: `gulp build-jsx`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] build-jsx script 'gulp build-jsx'.
npm ERR! This is most likely a problem with the com.westonthayer.bloks package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! gulp build-jsx
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs com.westonthayer.bloks
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls com.westonthayer.bloks
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/eric/Library/Application Support/Adobe/CEP/extensions/com.westonthayer.bloks/npm-debug.log
If you know the best way to resolve this one I'd appreciate it. Thanks!
Hi,
I'm not quite sure if it's my installation or what, but on my computer, Win 10 x64, the path to put the plugin is : C:\Program Files\Adobe\Adobe Illustrator CC 2015.3\Plug-ins\Extensions
Might be useful to some people :)
Bloks has hardcoded strings to check for symbol editing mode and isolation mode (maybe a few more too, I can't recall off the top of my head). The ExtendScript APIs to check for these in a language-agnostic way are broken.
Illustrator's "align to pixel grid" feature screws up Blok's auto layout. It can cause auto layout to keep running layout infinitely, effectively hanging Illustrator. Workaround is to turn that Illustrator feature off for now.
Align to pixel grid nudges things around a bit after a layout (especially with Area Text). That triggers a selection changed event and Bloks sees new dimensions. Resizing often isn't allowed, so Bloks undoes the change. Align to pixel grid then nudges things around a bit, and the infinite loop continues.
PageItem.pixelAligned
never seems to work
AIArtSuite::IsPixelPerfect
or AIDocumentSuite::GetDocumentPixelPerfectStatus()
will give us the true valueWith flexibility turned on, sometimes the correct layout leaves art with fractional widths/heights. Align to pixel grid fixes this, but then we hit the same infinite loop.
Flexbox's flex-wrap property is almost hooked up, just needs to be finished.
If I have two spacers within a BlokGroup, I'd like to be able to specifically set how much each spacer should flex (e.g. 33% and 67% remaining space).
ACTUAL: Flexibility is applied to the child object selected in step 4
EXPECTED: Flexibility is applied to the child object you had selected when you entered the numeric value
The workaround is to press to commit the flexibility value, or put focus somewhere else in the Bloks panel so that flexibility changed event fires before Illustrator's selection moves away from the intended art.
I looked into tracking what the previously selected art was so that we can retroactively update it, but that can be very problematic. Maybe a better fix is to use a modal dialog that forces you to hit or maybe use a numeric up/down.
Right now we just show a dialog with a fairly confusing error message. There are some well known errors (like EPARM) that we could show more user-friendly messages about. Maybe without using a dialog? If the error is fatal, maybe we should block further interaction with the plugin?
The x/y position of the object changes because we aren't taking into account whether the transform happened to the left
Mac version 26.0.3 โ Illustrator still prompts "plugin not connected" after copying the files to the right places.
It often takes more than one undo for only a single Blok layout to actually be undone. This can be fixed on the native side, there's a way to set operations to undo-silent. We'd need to do all Transforms on art on the native side though, and that means we need a way to "pass" an object from JS to C++. That would be super hard. Workaround is to just undo a few more times.
Hey Weston,
I've been showing off the plugin to everyone in the office. We're crazy excited. However, I'm not sure where to find the com.westonthayer.bloks - do I need to download XCode and get it spun up in there?
You should be able to select some art, then apply flexibility to all of them at once. It's tedious to do it one at a time.
This will get weird when multiple Bloks are selected that don't all have the same exact layout properties. For example, if 2 Bloks are selected, and the first has a flexibilty of 1
and the second has a flexibility of 2
, what should the text area in the panel show?
Hi. Unfortunately, I can't get this to work. It gives me this error: Uhoh, we couldn't connect to the Illustrator plugin. Make sure BloksAIPlugin.aip is installed correctly.
I've made sure to follow your instructions, but without any luck. Looking forward to hearing your thoughts on this matter!
@WestonThayer, now that I have the plugin compiling I was wondering what the last version number was that the plugin worked. I know you've stated that it's a known issue that it doesn't work in 2015.3.
Do you have a recommended version?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.