We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProcessing DevelopmentLibraries,  Tool Development › Adobe Illustrator Export (Beta)
Pages: 1 2 
Adobe Illustrator Export (Beta) (Read 8445 times)
Adobe Illustrator Export (Beta)
Sep 7th, 2005, 11:19pm
 
AIExport for beta has just been released here:

http://www.mark-hill.co.uk/AIExport

This is a conversion of William Allan Martin's original alpha code. Please refer to the original alpha docs until we get the new ones finished. Currently only the main changes are listed on the beta site (enough to get you going anyway).

http://pantheon.yale.edu/%7Eawm9/aiexport





Re: Adobe Illustrator Export (Beta)
Reply #1 - Sep 24th, 2005, 5:38pm
 
Thank you!
Re: Adobe Illustrator Export (Beta)
Reply #2 - Nov 15th, 2005, 1:26am
 
The example of AIExport (Beta) works in Processing 95. Yet, if used in a script together with the video library, it leads to the message:

java.lang.NoSuchMethodError: processing.core.PApplet.dataPath(Ljava/lang/String;)Ljava/lang/String;

How can I fix it?


Re: Adobe Illustrator Export (Beta)
Reply #3 - Nov 15th, 2005, 10:34pm
 

Post or email your code and I'll look into it. I've not started with the newer releases of BETA, so I'll try to see if its version specific or whatever.

Thanks.
Re: Adobe Illustrator Export (Beta)
Reply #4 - Nov 17th, 2005, 2:32pm
 
Thanks. This is the code I was trying with.

Lucio

import processing.video.*;
AIExport ai;

int numPixels;
int blockSize = 10;
Movie myMovie;
color myMovieColors[];

void setup()
{
 size(700, 700);
 noStroke();
 background(0);
 myMovie = new Movie(this, "drawing_quick.mov");
 myMovie.loop();
 numPixels = width / blockSize;
 myMovieColors = new color[numPixels * numPixels];

// 2 layers
ai = new AIExport( this, 2 );
ai.monitorOff();
ai.setContinuousRecordingFrameRate( 2 );
ai.turnTransparencyOn();
}

// Read new values from movie
void movieEvent(Movie myMovie)
{
 myMovie.read();
 for(int j=0; j<numPixels; j++) {
   for(int i=0; i<numPixels; i++) {
     myMovieColors[j*numPixels + i] = myMovie.get(9*i, 9*j);
   }
 }
}

// Display values from movie
void draw()
{
ai.run();
  for(int j=0; j<numPixels; j++) {
   for(int i=0; i<numPixels; i++) {
     fill(myMovieColors[j*numPixels + i]);
     ai.ai_rect(3.6*i*blockSize, 3.6*j*blockSize, 0.9*blockSize, 0.9*blockSize);
   }
 }
}


void keyPressed(){
     if( key=='e' ) ai.exportOneFrame();
     if( key=='s' ) ai.takeSnapShot();
     if( key=='d' ) ai.dumpSnapShots();
     if( key=='r' ) ai.toggleContinuousRecording();
}
Re: Adobe Illustrator Export (Beta)
Reply #5 - Nov 17th, 2005, 7:46pm
 

This should work (well it does on 93) Smiley

If you want to take a snapshot press s, and when you want to save press d, also you can toggle continous recording, but if you want a sequence of files use exportOneFrame.

Code:



import processing.video.*;
AIExport ai;

int numPixels;
int blockSize = 10;
Movie myMovie;
color myMovieColors[];

void setup()
{
size(700, 700, P3D);
noStroke();
background(0);
myMovie = new Movie(this, "3cr.mov");
myMovie.loop();
numPixels = width / blockSize;
myMovieColors = new color[numPixels * numPixels];

// 2 layers
ai = new AIExport( this, 1 );
// ai.monitorOff();
ai.turnTransparencyOn();
}

// Read new values from movie
void movieEvent(Movie myMovie)
{
myMovie.read();
for(int j=0; j<numPixels; j++) {
for(int i=0; i<numPixels; i++) {
myMovieColors[j*numPixels + i] = myMovie.get(9*i, 9*j);
}
}
}

// Display values from movie
void draw()
{
ai.run();
for(int j=0; j<numPixels; j++) {
for(int i=0; i<numPixels; i++) {
ai.ai_fill(myMovieColors[j*numPixels + i]);
ai.ai_rect(3.6*i*blockSize, 3.6*j*blockSize, 0.9*blockSize, 0.9*blockSize);
}
}
}


void keyPressed(){
if( key=='e' ) ai.exportOneFrame();
if( key=='s' ) ai.takeSnapShot();
if( key=='d' ) ai.dumpSnapShots();
if( key=='r' ) ai.toggleContinuousRecording();
}

Re: Adobe Illustrator Export (Beta)
Reply #6 - Nov 18th, 2005, 9:18pm
 
I'm getting reports in of code not working in the newer Beta releases.

To do anything about it, I need samples of code not working to try and track them down.

It's looking like there are changes in Beta I'm unaware of as some of you report field not found type stuff, but I need to check.
Re: Adobe Illustrator Export (Beta)
Reply #7 - Nov 20th, 2005, 8:02am
 
Yes...

"java.lang.NoSuchFieldError: rawShapeRecorder
at processing.opengl.PGraphicsGL.render_triangles(PGraphicsGL.java:430)"

The newest Beta (95) has caused issues. Reverting to 93 works fine.

Also, there seem to be issues with rectMode() when using default settings placement seems off (and files opened in AI will crash not save). Using CORNERS seems to eliminate this issue.
Re: Adobe Illustrator Export (Beta)
Reply #8 - Nov 20th, 2005, 10:33pm
 
I will try to look at  the obvious compatibility issues that arise out of using AIExport on the newer releases of Processing.

I'm a bit under the hammer at the moment, so I apologise for any hold ups!

I'm still on p93!

p.s Give me some stripped down examples of where the errors are popping up, as it'll make tracking easier.
Re: Adobe Illustrator Export (Beta)
Reply #9 - Nov 22nd, 2005, 9:47pm
 
Great!
Re: Adobe Illustrator Export (Beta)
Reply #10 - Nov 22nd, 2005, 10:27pm
 
there were some api changes in 95 for how files are loaded and some other bits underneath (in case you were accessing non-documented fields) so it's likely that things were thrown off a bit.
Re: Adobe Illustrator Export (Beta)
Reply #11 - Mar 1st, 2006, 2:03pm
 
Spotted a bug which can be worked around but is kind of annoying. It makes working on limited access computers at school really annoying because you can't alter the processing folder because it's protected in Applications.

The path for loading and saving files is obviously changed to the Processing application folder because that is where the AIExports are usually saved. But when one needs to draw resources from the "data" folder in one's sketch you find that you get an openstream() exception. This is because all of Processing's resource loading and saving commands have been altered by the library.

The workaround is to have a computer with admin access so you can stick all of your data files in the Processing directory.

But it would be nice if someone could patch the library.
Re: Adobe Illustrator Export (Beta)
Reply #12 - Mar 1st, 2006, 5:35pm
 
Why not run the processing application from the Desktop. Its an executable. I do my work primarily on limited access computers and although we may have different limits I think in general since proceessing doesnt require and installation and most limited access computers permitt installation prcoessing and you have contorl over what you download on your user account desktop you should be able to run aiexport fine. Do you have the same issues w/ using the save image/screenshot functions?
Re: Adobe Illustrator Export (Beta)
Reply #13 - Mar 3rd, 2006, 5:39pm
 
What happens when you specify a different path when using setFilename()?

Sorry not in front of the code to test, to see Whether this would work.
Re: Adobe Illustrator Export (Beta)
Reply #14 - Mar 6th, 2006, 12:40pm
 
setFileName() doesn't change the file finding, I put it before my data folder reading routines and it doesn't care. It's everything that should be in the Data folder that can't be accessed. loadFont, loadStrings, loadImage don't work unless the stuff is in the Processing executable foder.

As for sticking Processing on the desktop -> I have a machine I can work from, I've become a dab hand at guessing admin passwords.

I've just tried exporting as an application and it works fine it seems. The data files get packed into the .jar. I think as an app, I would be using a file browser to pull in the source files anyway. So it's still a bug, but I think we can all live with it until it's been found. Generally usage of libraries applies specifically applications.

I tried reading the "folder" variable and it's set to the Processing executable folder. I tried reading it outside of an AIExport sketch and I couldn't get it to appear. Besides which, I think that's just the executable location, not the data folder location.

Text also doesn't seem to work. Any ai.ai_text() I put in corrupts the file. I'm using illustrator CS to open the file and it says that some legacy text needs converting. Then it refuses to open the file.
Pages: 1 2