Adobe Illustrator to QC?

jersmi's picture

In After Effects, an Illustrator path can be copied and pasted into a layer then animated. I wish there was someway to get illustrator path data in QC -- convert points to data for a structure of lines / splines that could be queued, drawn on screen, etc. Checking to see if anyone has any methods.

cybero's picture
Re: Adobe Illustrator to QC?

According to Mylenium a Community Professional @ Adobe Forums

Quote:

Illustrator paths must be inserted via copy&paste to act as masks or shape layer paths in After Effects. There is no way to import AI files with editable paths into AE. The data structures may be the same, but the principles are simply differen

http://forums.adobe.com/thread/507465?tstart=1

So I guess not, unless you use a plugin to take postscript structure information from within AI I guess.

cybero's picture
Re: Adobe Illustrator to QC?

Might have found something that could be ported into a structure QC can use - http://jmsoler.free.fr/didacticiel/blender/tutor/cpl_import_ai_en.htm#AI...

Requires the use of Blender.

Blender export to XML.

XML Importer or Convert to .plist.

Unless I'm much mistaken, in which case it merely does what FX does already.

Won't take the Version 9 AI files, something to do with the way they are packed.

gtoledo3's picture
Re: Adobe Illustrator to QC?

It sure is a great idea. It would be really cool to do it, and then render to a grid warp, so that point path could be tweaked in QC. I wonder about parsing the data though... if it's based on a premise like Turtle/Logo, all the coordinates are relative from the last point. That would be odd to do in QC (though I would LOVE IT).

Edit - I don't think it is, I think it's coordinate based.

usefuldesign.au's picture
Re: Adobe Illustrator to QC?

Yeah I was going to suggest Blender route. I haven't tried it but I have used Blender point data clouds in QC. (see my kineme.net avatar!).

One thing: an AI curve is obviously more than it's anchor points, it's curve equations also (defined by the handles and the bezier equations), without a plugin to convert that to a Kineme Spline Patch equation your stitched on that front. A work-around would be to use the Path>Add Anchor Points command in Illustrator many times until you have enough points to simulate a curve with straight lines for the Kineme GL Line Structure patch (make yourself a Javascript action to run in AI that does multiple runs until you have 'enough' points).

Another way is print a .ps file and parse out the point data but I think Blender sounds an easier route. Surprised one would need a script to do it, most 3D programs can import .ps if not .ai files. AI can export a .dxf file — try importing that to blender. Or open it in Text Wrangler and compare the .dxf to a .dxf of a simple square shape file to find the POLYLINE and SPLINE data of your file (begins around line 1616 for me). I don't know what the numbers mean but there must be public documentation of the dxf standard if you can be bothered working out how to interpret the numbers. (That would form the basis of a good plugin ;) )

I think we should all make formal requests to QC dev team on Radar for a symbolic 2D/3D object drawing datatype in QC that could handle this sort of thing as a native data type. Maybe PDF/PS based — maybe not — but some way to specify vector art that can be modulated by subsequent patches before a rendering patch (that does the actual rasterising or OpenGL calls). QC really needs this, it's so obvious, IMHO.

gtoledo3's picture
Re: Adobe Illustrator to QC?

There is an SVG renderer patch called the NVQC renderer/ nVeil. I have had it working before, but for some reason none of the SVG's I'm loading with it are working right now. I would post it, but I don't remember how I got it, and whether it's cool or not. That said, I remember a distinct visual difference between what I thought it should look like and how it rendered.

It would be great to have well developed spline tools with configurable points and interactive or definable tension handles, as well as loading of stuff like this.

I should mention the last version of Nodebox has some interfaces for spline type of patches that would "make sense" in QC... but it has interesting methods of allowing you to place spline points on a Viewer, then it pushes the actual path data to the patch inspector! Amazing really. Except that the app is still very limited.

jersmi's picture
Re: Adobe Illustrator to QC?

I was looking at the Nodebox stuff, which does seem super cool. And I have Cinema 4D so maybe that'll allow the same kind of export as Blender... ah, well, I do like the idea of it...

usefuldesign.au's picture
Re: Adobe Illustrator to QC?

gtoledo3 wrote:
It would be great to have well developed spline tools with configurable points and interactive or definable tension handles, as well as loading of stuff like this. ... but it has interesting methods of allowing you to place spline points on a Viewer, then it pushes the actual path data to the patch inspector!

Feedback from Viewer interaction directly into patch values that pushes the values is something that I've always thought of as "nope: no-can-do" kind of thing (to quote from that Atkinson Hertzfeld interview you have me reading now). That would be a pretty cool paradigm shift for QC… (seeing as cwright was asking for blue-sky QC thinking good timing too)

cwright's picture
Re: Adobe Illustrator to QC?

usefuldesign.au wrote:
(seeing as cwright was asking for blue-sky QC thinking good timing too)

Just to clarify a tiny bit: I'm not at all short on ideas (though I can't really discuss any of the more interesting ones anymore ;), so I'm really not trying to "farm out" brainstorming to everyone else. My intent with the blue-sky stuff is to see if there are other interesting directions that can also be pursued (I will never claim to have all the best or most useful ideas for QC -- in fact, a lot of great ideas have come from others).

(I'm not at all saying you were implying that I'm begging for ideas or anything, but I can see how it could be misconstrued that way to someone without a better view of history and things :)

usefuldesign.au's picture
Re: Adobe Illustrator to QC?

Yes yes. Good point. Wasn't implying anything of the sort of course.

It didn't occur to me how somebody else get that kind of take on what I said. Always pays to consider other perspectives than those that seem obvious.

Was just kind of good humoured wishful thinking along lines of 'Apple is Listening right now'. I'm sure you (singularly) have plenty of ideas I haven't considered and the QC team has many development irons in the fire, many of which will never see implementation for all manner of reasons.

gtoledo3's picture
Re: Adobe Illustrator to QC?

I think the one recurring theme, if I generalize, is "can I do -insert technology from framework or other aspect of the world of programming" in the world of QC.

This seems to point to the fact that QC is basically an object oriented programming language, but visual. It's strength is that you can take different available libraries and incorporate them into your projects, so in that sense it's like "visual node based Cocoa".

cwright's picture
Re: Adobe Illustrator to QC?

usefuldesign.au wrote:
I'm sure ... the QC team has many development irons in the fire, many of which will never see implementation for all manner of reasons.

oh how I wish that wasn't the case :/

usefuldesign.au's picture
Re: Adobe Illustrator to QC?

QC's not really Object Oriented / visual Cocoa at all in my uneducated view. (Even though it's code base is I guess.)

There's no way to introduce object classes and class methods let alone leverage the many Cocoa frameworks which is really what I hear (from Apple marketing) gives Cocoa it's speed to develop and high level (simple abstracted) access to complex much required computing tasks. Unless one writes a QC plugin in Cocoa or uses a QCViewer in a Cocoa Application itself which is maybe what you meant in the first place. I might have misinterpreted what you were meaning completely, sorry to be argumentative must be the mood i'm in!

I mean, I think it would be really cool if in QC (the app itself) you could define an object class and how other patches can interact with the data type/object model through method definitions. This is do-able in a javascript kind of a way I guess to some extent but not really application wide in a transparent way like defining new object classes and methods would be. More blue sky thinking… ;)

Imagine if you could just conjour a text_string-2-vector_array_object method macro as a subset of a predefined vector class inside QC with a bit of JS or noodling around with stock patches.

gtoledo3's picture
Re: Adobe Illustrator to QC?

Dude, of course it is. What are patches? They are cocoa apps that run inside of QC. (edit- oh... yeah, I mean plugins/undocumented QCPatch stuff - that is inherent to the QC engine...).

gtoledo3's picture
Re: Adobe Illustrator to QC?

Where is that Mirek with his Obj-C in QC plugin anyway? ;-)

I made a plugin that hosts Win7 in QC... attaching... whoops HD crashed. Well, it worked, it really did.

cwright's picture
Re: Adobe Illustrator to QC?

usefuldesign.au wrote:
QC's not really Object Oriented...
gtoledo3 wrote:
Dude, of course it is.

a QC Plugin isn't necessarily cocoa at all (for example, the quartz builder template plugin actually has no cocoa code, and is written all in plain C, iirc) -- they're also not "apps", but loadable "bundles" (by themselves, they cannot execute, they must be loaded by a host program, which is a true "app").

The term "object-oriented" probably has several semantic meanings, but in programming parlance it refers to the ability to deal with data + methods as objects (which QC sorta does well), and also the ability to extend these objects via subclassing (which QC completely fails at -- macros sorta work, but they pretty limited)

QC's also functional, whereas OO design is procedural -- QC actually goes out of its way to not follow a procedural model (it's lazy-eval/pull rather than push, which is how procedural would intuitively work), which limits what you can do. Non-consumer iterators somewhat make this possible, but at times it's still contrived.

Scratchpole's picture
Re: Adobe Illustrator to QC?

Wings3D can import AI files (exported as legacy AI 8) then export as your 3d model flavour of choice.

cybero's picture
Re: Adobe Illustrator to QC?

Nice catch Scratchpole, it imports a whole load of other file formats and exports a whole load more too. I'm using some archive AI files, but they come out really 2D slightly extruded. Have begun re-meshing and such in MeshLab. None the less Wings3D is a real find. Wonder why I hadn't used it before now ?

usefuldesign.au's picture
Re: Adobe Illustrator to QC?

cwright wrote:
… in programming parlance it refers to the ability to deal with data + methods as objects (which QC sorta does well)

I guess where I was coming from was that 'write QC classes, methods & patches in QC' kind of angle on 'Object Oriented'. We're just kind of stuck with the classes that the stock and plugin patches define. We can't subclass a color say as LAB color. We can write JS that will convert a LAB color definition to RGB, HSL or CMKY which are (presumably) sub classes of the native color object/data-type. But that's doing it procedurally — every time and place we deploy it.

We can't actually plug the LAB color defined data-type into some color input port and expect it to be understood. The fact that we can pass structures around from a <QC˛Structure> output port to a structure input port hints at OOP possibilities but there's no way to link to methods so there's no OOP coding happening unless you are actually writing a Plugin in Cocoa or C++.

That would be a pretty cool development of QC: into declaring subclasses and methods that could be implicitly (transparently without re-writing every patch that handles that data class) understood by subsequent patches. I can't guess as to how it could be done though. Especially if you could actually do this in the QC Editor with a new code based patch (JS & XML?) for defining new object classes using inheritance from a new set of prime objects. Then have these classes recognised broadly in QC. That way say just for example, ParticleTools generator patches could be written to output a data-type that other non-ParticleTools could actually receive and work with or generate for itself.

This "can a visual programming environment be OOP?" question made me think of that Alice language (written in JAVA) that was intended to introduce JAVA style techniques to young (in particular female) students, championed by that 'The Last Lecture' professor, Randy Pausch. So i looked it up an found this interesting commentry by Richard G. Baldwin

dickBaldwin.com wrote:

Alice is not an object-oriented programming (OOP) language

While Alice is an outstanding product for teaching object-based programming, Alice is not an object-oriented programming language.

Unfortunately, much of what you read about Alice on the web strongly implies that Alice is an object-oriented programming language. In fact, as of this writing, the FAQ on the main Alice website contain the following statement:

"Alice is a modern programming environment designed to be a student's first exposure to object-oriented programming."

While that statement may be mushy enough to preserve "truth in advertising," in my opinion, it is very misleading, particularly to those who don't understand the rigors of OOP.

Alice is object-based but not object-oriented

In my opinion, while Alice is an object-based programming language, it definitely is not an object-oriented programming language. Insofar as the big picture is concerned, a true OOP language must make the following features available to the programmer:

Encapsulation
Inheritance
Polymorphism

While Alice does support encapsulation, and does make a weak gesture towards making inheritance available to the Alice programmer, there is no semblance of support for polymorphism.

Insofar as the detailed picture is concerned, there are numerous detailed features (such at type casting) that are expected from a true OOP language which are not available in Alice.

Alice is an outstanding object-based teaching environment…

…However, the fact that the Alice program is object-oriented doesn't mean that what you are able to produce using Alice will be object-oriented.

In the sense of the QC patches being multi-use sub-routines with local variables, yes that's modern programming but not what I understand OO programming to mean, I've never heard PASCAL described as the first object oriented Language (even if it was at the heart of the first Macintosh Apps).

To paraphrase Baldwin perhaps we can say QC is an object-based visual programming environment. The underlying code base may or may not (as cwright described) be in an OOP language but it's execution isn't OO in either case. Shifting QC a little more towards an OOP (or open) environment would be really interesting in my view. Flash for example is a true OOP environment from my limited understanding, relying heavily on Actionscript to implement the OOP aspects of it.

usefuldesign.au's picture
Re: Adobe Illustrator to QC?

Quote:
Where is that Mirek with his Obj-C in QC plugin anyway? ;-)

Yeah he offered me a beta to try out in return for buying shares in his publishing empire but I never got the thing to work, probably cause I'm not on intel ;)

cybero's picture
Re: Adobe Illustrator to QC?

You can export an xyz 0,0,0 kind of vertices position XML from Wings3D [ into which one has imported a version 7 AI file ] .

PreviewAttachmentSize
kerkytheaplane.zip20.09 KB

cybero's picture
Re: Adobe Illustrator to QC?

Haven't heard from him since March regarding that patch, I guess that's the sort of thing that could take in a structure, mind the 1024 math structure does something similar to what's being discussed once one's got the vert. norm and ind info from the vector file.

I like the way svg is "self scripting". Tidy. Also has extractable structures or positional data.

usefuldesign.au's picture
Re: Adobe Illustrator to QC?

I'm downloading the latest Noise Industries FX. nVeil are distributing through them it seems. Perhaps it leaves an SVG patch in QC — I can't find one from my previous install though.

If SVG to image can be done, as you noted, Cybero SVG is in an XML variant so perhaps can have it's text-based data modulated within the QC environment. Depends how fast it is to evaluate, but if it takes text as an input rather than a URL for a file then that could be a source of vector-art creation in QC not requiring other apps.

cybero's picture
Re: Adobe Illustrator to QC?

the SVG output in a standard SVG vector structure is of a format that would need re-formatting prior to presentation to whichever structure renderer one puts it through. looks mostly like embedded image data in some files though.

the following is the sort of SVG code I said would need re-formatting

<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20000802//EN"
"http://www.w3.org/TR/2000/CR-SVG-20000802/DTD/svg-20000802.dtd">
 
<!--
 
   Licensed to the Apache Software Foundation (ASF) under one or more
   contributor license agreements.  See the NOTICE file distributed with
   this work for additional information regarding copyright ownership.
   The ASF licenses this file to You under the Apache License, Version 2.0
   (the "License"); you may not use this file except in compliance with
   the License.  You may obtain a copy of the License at
 
       http://www.apache.org/licenses/LICENSE-2.0
 
   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
 
-->
<!-- ====================================================================== -->
<!-- Modification of a polygon attributes                                   -->
<!--                                                                        -->
<!-- @author tkormann@ilog.fr                                               -->
<!-- @version $Id: polygon.svg 475477 2006-11-15 22:44:28Z cam $ -->
<!-- ====================================================================== -->
 
<?xml-stylesheet type="text/css" href="../../resources/style/test.css" ?>  
 
<svg id="body" width="450" height="500" viewBox="0 0 450 500">
    <title>&lt;polygon&gt; attributes 'onload'</title>
 
    <text x="50%" y="45" class="title">&lt;polygon&gt; attributes in 'onload'</text>
 
    <script type="text/ecmascript">
 
    function initPolygon(evt, points) {
        var elt = evt.target;
        elt.setAttribute("points", points)
    }
 
    </script>
 
    <g id="test-content" >
 
        <polygon points="0 0" style="fill:gold; stroke:orange; stroke-width:4" 
           onload="initPolygon(evt, '219 175, 255 193, 268 235, 242 269, 199 270, 171 237, 179 195')" />
 
        <g style="fill:black; stroke:none; text-anchor:middle">
                <text x="225" y="300" >points</text>
        </g>
    </g>
</svg>

Really simple SVG, it can get much more detailed than that. I haven't even tried extracting the example image data.

I've got to say that exporting as DAE or as an XML file makes for easily manipulated data.

Of for a coffee.

gtoledo3's picture
Re: Adobe Illustrator to QC?

What is the point of writing to XML when there is more support for DAE, even the source struct is a 2D thing?

gtoledo3's picture
Re: Adobe Illustrator to QC?

The change between nodebox 1 and the nodebox 2 was a MAJOR surprise. However, the toolset is still sort of limited... it's amazing to me though, that the few things that it can do well trounce QC, yet the system as a whole is not even close to as well developed.

gtoledo3's picture
Re: Adobe Illustrator to QC?

Something doesn't have to be Cocoa to be Object Oriented ( I know you know this, I just found your response odd).

QC and it's patches are analogous to an abstraction of how the OS works with apps.

To take this further - apps are bundles. They cannot execute without the OS as the shell, in the same way that plugins need QC as the shell. Nodes in QC can send to other nodes, and then "stuff happens". It's not strictly modular.. You know that I opine that the OS is a "BIG APP" that works on top of the kernel.

I'm going to make a wild leap that since QC doesn't HAVE TO BE lazy eval, it's just currently implemented as such, doesn't mean that it's limited to that. There are ways for QC to be event driven, and not evaluate until something happens - the fact that the underpinnings don't take that into account doesn't mean that the model itself isn't a dumbed down version of delivering many of the advantages of OOP.

cybero's picture
Re: Adobe Illustrator to QC?

As you can easily see in the post above, I too consider DAE export as really useful and preferable, XML being a good fall back option. How often do I find it necessary for model structures - hardly ever. Should I need it it's there.

usefuldesign.au's picture
Re: Adobe Illustrator to QC?

gtoledo3 wrote:
What is the point of writing to XML when there is more support for DAE, even the source struct is a 2D thing?
I'm not talking about bringing 2D/3D models into QC. I'm talking about generating the content within QC.

— In crude terms pluging an LFO feed into four (X,Y) anchor points and joining them with a curve. Don't all DAE models have straight line meshes joining the vertexes? Maybe I've missed something there, I haven't tried it.

Edit— this was in regard to writing SVG code inside QC with various Text Patches that could have evaluating (changing) variables. I mistook where your comment was threaded when I wrote this, gt, sorry for confusion.

cwright's picture
Re: Adobe Illustrator to QC?

gtoledo3 wrote:
Something doesn't have to be Cocoa to be Object Oriented ( I know you know this, I just found your response odd).

I was going more for the opposite: no one I know that would consider plain C to be object oriented. There are tons of OO tools, but plain C isn't one of them (though an OO runtime can be built on it fairly well -- objc, for example).

gtoledo3 wrote:
QC and it's patches are analogous to an abstraction of how the OS works with apps.

To take this further - apps are bundles. They cannot execute without the OS as the shell, in the same way that plugins need QC as the shell. Nodes in QC can send to other nodes, and then "stuff happens". It's not strictly modular.. You know that I opine that the OS is a "BIG APP" that works on top of the kernel.

This again delves into semantics -- you've separated the kernel from the OS (which is very practical), while a purist considers the OS the kernel. Apps cannot work without libc and other support libraries, and actually those libraries are what interact with the kernel (at large), not the apps directly. It's therefore entirely possible to make the libraries do the actual hard work, and not even have a kernel (though then you've successfully re-invented DOS, more or less.)

Also, bundles live in a processes address space, while the kernel is "above" that -- this barrier (and lack thereof in bundle space) has some interesting implications that make things less simple. Mentally, the model you've presented is largely sound, but I can't say the details would all hold without thinking about it a lot more.

gtoledo3 wrote:
I'm going to make a wild leap that since QC doesn't HAVE TO BE lazy eval, it's just currently implemented as such, doesn't mean that it's limited to that. There are ways for QC to be event driven, and not evaluate until something happens - the fact that the underpinnings don't take that into account doesn't mean that the model itself isn't a dumbed down version of delivering many of the advantages of OOP.

Push or Pull, there are still algorithms that don't sit well. For example, let's say I give you an unsorted structure, and ask you to sort it in QC without using JS or a built-in structure sort patch. How would you go about doing it? Or let's say you wanted a render in image patch that had a depth output. How would you do that? 2 passes? that's twice as much work (and unnecessary outside of QC). Or what if you wanted to solve the traveling salesman problem? implement a compression algorithm? A video codec? verify a cryptographic signature? Arbitrary precision arithmetic? These are all things that are trivial and fast even in lousy java runtimes (and pretty good in good JVMs), but totally intractable in QC. I have no idea what it would take to make those kinds of problems solvable in a visual environment, but there's a lot of things to solve when writing apps that QC cannot address very well.

usefuldesign.au's picture
Re: Adobe Illustrator to QC?

gtoledo3 wrote:
QC and it's patches are analogous to an abstraction of how the OS works with apps.
With respect, I don't think this is useful. Presumably you mean the OS<=>QC while Apps<=>Patches. I don't think you can describe any characteristic of the QC Editing environment as truly or even partially OOP. Where is the inheritance, subclassing & methods let alone polymorphism and so on. Maybe the color object has a method in that you click on a color well and the Apple color picker comes up — that's about as good as it gets and that's not what I understand OOP to be about.

If one can use XCode to make QC plugins (I can't) then you can make a case for QC being part of an (immense and cutting edge) OOP environment. If one can't use XCode to make plugins (in C, C++, ObjC, Ruby or whatever) then QC is probably best described (as cwright did!) as a functional programming environment with lazy evaluation with certain native object types like colors, numbers and strings (that are not immutable (contradiction_alert!) ) and with side effects being the non-trivial matter of the screen rendering and I/O patches that post data.

Now reading cwright's comment I'd add that this discussion really does get semantic and I didn't know I'd been using a Functional language in QC and I didn't even know what the hallmarks of a functional language are until a bit of recent light reading. If ever a 'language' proved that programming paradigms are not mutually exclusive, it surely is QC. Has hallmarks of functional programming yet conditional branching and looping (imperative programming). But then it is heavily recursive (each graph execution).

I guess the important distinction I'm arguing for is that where it's easy to create new object types and modify existing types, create all sorts of usage rules and so on in OOP, in QC this is impossible without plug-ins and even there your restricted as to how much these objects can interact with the rest of the graph.

Conclusion: QC is not really extensible in terms of just using the graph to do stuff.

gtoledo3's picture
Re: Adobe Illustrator to QC?

I get your points, and they are well taken.

I guess the reason I think of the kernel as separate from the OS, is because of the differences in kernels from NeXTStep to OpenStep to OS X.

Again, when there is something that QC "can't do" with the current feature set, one has the ability to expand it with a patch that can be used again and again without altering the original patch. This is analogous to having a bunch of frameworks that one can leverage, imo. That's all I'm saying, not that it's currently as flexible "in editor"... in it's own box.

gtoledo3's picture
Re: Adobe Illustrator to QC?

A class is analogous to a protocol (whether Apple or user defined), and an object is like a macro.

Dynamic dispatch, happens when I make something like a macro that sense whenever I move mouse and "does something", but also responds to X/Y on a slider, or when I pop a file term in a string and because of the file type and some parsing, it gets pushed to the correct kind of loader. It happens from combinations of patches.

Methods are like nodes (patches).

Message handling is abstracted by connecting patches.

Inheritance - when I made the "QCButton" patch, it has all traits of the "RectHit" macro that I had to make first, plus.

Encapsulation sort of happens in the fact that you can take a set of patches, and in turn, make them back into a single patch, whether virtual, or as the main part of a plugin.

Polymorphism is inherent and part of the interface of QC ( I can make a bunch of macros where all the renderers change color when they get a signal, but the renderers might change different colors).

Right about now, I know that people are gagging. Also, I think that much of this applies a whole other level "up" when it comes to extending QC through plugins/patches.

I think you're probably wrong about the extent of the ability of a patch to control the graph, but who knows.

I understand where you're coming from. I look at it from the standpoint that one thing essentially a microcosm of another, that is a microcosm of another... which isn't really mainstream, and I recognize the validity in your points, while not necessarily agreeing with them.

dust's picture
Re: Adobe Illustrator to QC?

does anybody remember having to make clipping paths in photoshop in order to have a transparent background when you brought your photo into quark or pagemaker ? (or am i just getting old. sorry a bit off topic but sort of relevant to bezier paths in illustrator.) don't know if anybody mentioned this or not as i didn't read all this thread but you can save an AI file as a pdf and bring it into QC. not sure if QC rasterizes the image or keeps it scalable though ?

cybero's picture
Re: Adobe Illustrator to QC?

.pdf format - outputs a transformable and scaleable image, but not accessible to structure scaling.