Coder Social home page Coder Social logo

westonthayer / bloks Goto Github PK

View Code? Open in Web Editor NEW
68.0 68.0 7.0 24.95 MB

Flexbox for Adobe Illustrator

Home Page: http://westonthayer.com/writing/2016/07/27/layout-experiments-in-adobe-illustrator/

License: MIT License

C++ 3.88% C 0.48% CSS 6.96% HTML 6.70% JavaScript 35.10% TypeScript 46.84% R 0.05%

bloks's People

Contributors

wcork avatar westonthayer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bloks's Issues

Make the size of clipping masks only use the size of the mask

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.

  • We can't simply ask for the first group child and take it's size, the mask object can be at any Z
  • Clip groups can be nested, so we would have to recurse through the entire tree to get the true size

certificate-creds.json needed to build

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!

Another Path for the Plugin

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 :)

Support more than just en-us languages

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.

"Align to pixel grid" causes infinite loops

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.

Problem 1

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.

  • We can't detect when align to pixel grid is on since PageItem.pixelAligned never seems to work
    • On the native side, maybe AIArtSuite::IsPixelPerfect or AIDocumentSuite::GetDocumentPixelPerfectStatus() will give us the true value
  • Can't solve it by detecting an infinite loop, we'd reject real user changes

Problem 2

With 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.

  • Probably shouldn't try to solve this by attempting to round the same way align to pixel grid does. How would we know what algorithm to match? Too many edge cases

Implement flex-wrap

Flexbox's flex-wrap property is almost hooked up, just needs to be finished.

User required to hit <ENTER> after changing flexibility

  1. Create a BlokGroup
  2. Select a child object in it
  3. In the Bloks panel, put a numeric value in the flexibility text area
  4. Select a different child object

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.

Better error handling

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?

Make undo work as expected

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.

unable to find com.westonthayer.bloks

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?

Would be helpful to apply properties to more than one Blok at a time

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?

Couldn't connect to the Illustrator plugin error for AI 2022

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.