• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Drawscript - turn Illustrator shapes into code

Adobe Employee ,
Mar 21, 2013 Mar 21, 2013

Copy link to clipboard

Copied

I've just launched a little extension for Illustrator I've been working on called Drawscript - http://drawscri.pt

It converts Illustrator shapes into code (Obj-C, C++, JavaScript, Processing, ActionScript 3, JSON, Bezier array).

star.png

It's great for skinning UIs, creating vector assets for gaming and learning/teaching vector graphics programming.

If you have any comments, found bugs, etc. Let me know here or on my Twitter, Facebook, Google+.

Thanks!

Tom

Views

23.1K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
LEGEND ,
Mar 22, 2013 Mar 22, 2013

Copy link to clipboard

Copied

Any plans on adding support for After Effects keyframe and mask data or at least a raw export that outputs the positions as 3 component arrays [X,Y,Z]? This would make a nice workflow with that program... Gonna give this a whirl later today or on the weekend....

Mylenium

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Mar 22, 2013 Mar 22, 2013

Copy link to clipboard

Copied

Good point, I need to look into that. Thanks for the feedback!

Can you send me more info on how exactly would you like to structure that data?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Mar 22, 2013 Mar 22, 2013

Copy link to clipboard

Copied

Looks really nice. There are various other methods floating around for some of the individual options, but nice idea to have it all in one output process from within Illustrator. Makes for a much cleaner approach, good work.

I didn't find what versions of Illustrator this works with? Is this only for CS6? It failed to install on CS5.5 for me.

Is this another case of:

if (installedSoftware < CS6 || installedSoftware != Cloud) {

    abandonWare = true;

}

If so, then it seems quite odd since its just accessing and gathering path data why couldn't it then work in other versions other than CS6? Or am I mistaken that it does indeed work in other versions?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Mar 22, 2013 Mar 22, 2013

Copy link to clipboard

Copied

Hi W_J_T,

it's currently in Beta and first drop, I am looking into this to see if it could potentially support that case as well. It requires more testing and I think it might be possible. Currently it works on CS6 only.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Mar 22, 2013 Mar 22, 2013

Copy link to clipboard

Copied

Ok, sounds good, thanks for the response. Looking forward to further releases and seeing it for other installed versions of Illustrator. * If, you can get doing so past the powers to be that is. But technically it seems like it should be doable, one would think. Keep up the good work Tom, thanks again.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Mar 23, 2013 Mar 23, 2013

Copy link to clipboard

Copied

After Effects only understands basic JavaScript arrays as coordinates. It doesn't have draw primitives or any of that, so no fancies required. Just lines and lines of [X,Y,Z] will do. Also perhaps a simple CSV export? 3D programs like Cinema 4D can use that for shaping splines and polygons...

Mylenium

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 26, 2013 Mar 26, 2013

Copy link to clipboard

Copied

Tried it on a few old illustrator files of mine and noticed that 'Javacript Canvas' often seems to have problems.

  • Selected all objects: no output in Javascript Canvas window
  • Selected one brush stroke: no output. Selected another brush stroke made with the same brush: output
  • Selected a region: no output. Selected another region of strokes/objects: output
  • Shapes seem to work fine so I converted all brush strokes to fills: no output or it makes illustrator freeze with the 'rainbow' cursor
  • Drew 50 standard shapes like rectangles, circles, stars, selected them all: output
  • Drew 50 brush strokes all made with the same brush: no output
  • Converted those 50 brush strokes to fills as it seemed to have less problems with shapes: still no output

Other languages seem to have less problems, though sometimes it takes a while looking at the rainbow cursor. Standard shapes work the best and fastest. More complicated objects like brushes seem to give them more problems. For other languages it takes a while for them to give output. Javascript Canvas often don't give output on brush strokes at all. Also not when converting them to fills.

All things which are still worked on when the final version comes out?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 29, 2013 Mar 29, 2013

Copy link to clipboard

Copied

Hi,

Will this support Illustrator CS6 masks, too? If so, this could prove very useful over the long run.

Thanks,

Patrick

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Mar 29, 2013 Mar 29, 2013

Copy link to clipboard

Copied

I need to look at it, but as of now, try to simplify structures as much as possible, because remember in order to support all the languages there are definitely some trade offs that you have to take.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Mentor ,
Mar 29, 2013 Mar 29, 2013

Copy link to clipboard

Copied

Any updates concerning CS5/etc? Is the only thing keeping this working for CS5 the "HostList Version" in the "manifest.xml" ?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Mar 30, 2013 Mar 30, 2013

Copy link to clipboard

Copied

@W_J_T: I looked into that solution, but there is more to make it working on older versions. At least complete UI rewrite and other adjustments regarding missing APIs that were introduced in CS6.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 10, 2013 Apr 10, 2013

Copy link to clipboard

Copied

Will this work with Illustrator CS4/CS5?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 30, 2013 Mar 30, 2013

Copy link to clipboard

Copied

I am unable to get generate Javascript code.
Is there an issue with the generator and javascript?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Mar 30, 2013 Mar 30, 2013

Copy link to clipboard

Copied

@carrzkiss yes, there was an issue with Javascript, make sure you try the latest build. Thanks!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 23, 2013 Apr 23, 2013

Copy link to clipboard

Copied

Hi Tom,

I am seeing an issue where my final point (closing the shape) is not a BezierCurveTo where I would expect it (it gets rendered as a straight anchor point instead of a curved one -- bottom image).

I was able to get around this by making my curve points in the middle of the set, rather than the opening/closing point.

beziers.jpg

I'm looking forward to seeing this tool grow! Thanks for making it.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
May 02, 2013 May 02, 2013

Copy link to clipboard

Copied

Hi, I am not able to reproduce this,

I did a quick test and it's fine, would you mind sending me your AI file?

Screen Shot 2013-05-02 at 3.05.16 PM.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 02, 2013 May 02, 2013

Copy link to clipboard

Copied

I re-downloaded and installed Drawscript, and now I can't reproduce the issue either. So it's cool!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 08, 2013 May 08, 2013

Copy link to clipboard

Copied

Hi All,

I'm drawing a rectangular house with rectangular windows.

DrawScript generated this JavaScript code for the house:

ctx.fillStyle="rgb(139,67,94)";

ctx.strokeStyle="rgb(0,0,0)";

ctx.lineWidth=4;

ctx.fillRect(79,255,458,342);

ctx.strokeRect(79,255,458,342);

ctx.fill();

ctx.stroke();

And similar code for the windows. But everything becomes black. Solution was to delete the ctx.fill() command. It is not needed. I think it is a bug.

best regards

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 02, 2013 May 02, 2013

Copy link to clipboard

Copied

Hey Tom,

I am not using this to it's full potential admittedly, but I am finding it VERY useful.

Drawing in iOS/Core Graphics is new to me but using Illustrator isn't, so I am  using your extension to translate skills between between one 'language' and the other.

Its proven to be a quick way to learn how to use core graphics drawing API - using live example code 🙂

Thank you !

Darren.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
May 02, 2013 May 02, 2013

Copy link to clipboard

Copied

Thanks Darren, that's a great use case! Glad you like it.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
May 02, 2013 May 02, 2013

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 06, 2013 Dec 06, 2013

Copy link to clipboard

Copied

Tom,  are you still actively developing this tool?  It seems awfully quiet on the update/release front.  I wouldn't mind purchasing this tool if it had regular updates...  hint hint.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 07, 2013 Jun 07, 2013

Copy link to clipboard

Copied

hi

when I export from Illustrator to json format the coordinate x and y lose decimals, is it a bug ?

if no ,  are there  another properties to setup when export ?

thanks

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 13, 2013 Oct 13, 2013

Copy link to clipboard

Copied

I LOVE this extension.

Is there any way to change the origin tho? Even when I adjust the origin with the ruler, the numbers come out relative the entire file. I have to export the paths to another file to get them to start at 0,0.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines