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

Export dynamically created vectors

Explorer ,
Jan 28, 2019 Jan 28, 2019

I am using animate CC to create generative art. My ActionScript is resizing, rotating and colouring movie clips and spreading them across the stage. Is there a way to export these creations as an SVG or PDF or something? I am using a Mac but have used a PC in the past and I am pretty sure that on a PC you could test the movie, right click and print to PDF. Unfortunately, the option to print to PDF is not there on a Mac.

Any help greatly appreciated. Thanks.

752
Translate
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

correct answers 1 Correct answer

Explorer , Jan 30, 2019 Jan 30, 2019

I've found it! The answer is to go one step further than I was going. When you test a movie you can right click and select print. This gives you the page setup options but there is no print to PDF option here. However, click OK to go to the next dialog and viola, the option to save as PDF is available!! Yay!  

Translate
Advocate ,
Jan 28, 2019 Jan 28, 2019

Hi Psychrome

Intriguing question. Generative art, huh? I did once something similar back in the Flash days with AS2. Can't really test it anymore in today's Animate.

Screenshot 2019-01-28 at 14.55.39.png

Still image from my Random Shape Generator ©2009

Anyway I used then in AS2 some dynamic shape methods like lineStyle(), moveTo(), beginFill(), curveTo() and lineTo() with lots of Math.random() * stage.width or .height.

This is of course pure theory, but it should be possible to write a kind of interface that translates all these methods of random-dynamic numerical data from Actionscript or - maybe - Javascript into SVG-XML code that would be saved in regular, adjustable intervals. Well, yes, I know that's a project one could be busy for months.

On the other hand, when I opened this Generator today in the contemporary Flash Player 30, which by the way still plays it well in spite of AS2, I saw in the Context menu the commant Print ... . I haven't got a printer configured currently, though isn't it somehow possible to set up a PDF Printer which actually doesn't print but saves a print file to disk in PDF format? If you have something like Adobe Acrobat installed on your system. I wonder of course: would dynamic vector graphic inside the Flash Player translate via PDF Print into vector graphic within the resulting PDF document?

Raster graphic in this context is a NO brainer. You could just make a screen capture. But you want SVG or PDF, right? Otherwise it is possible to use Apple Automator or Applescript to program a screenshot mechanism (utilizing the usual Shift-Cmd-4 or 5 routines) to capture the visual creations in regular intervals.

Perhaps not entirely helpful, more meant as thoughts, ideas and suggestions ...

Klaus

Translate
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 ,
Jan 28, 2019 Jan 28, 2019

If by "export" you just mean print, then AS3 has a fairly full-featured printing API.

If you mean exporting by writing an SVG file, only AIR can write to the local file system. You might be able to locally construct a downloadable "file" version ot the SVG by using data URIs.

Translate
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
Advocate ,
Jan 29, 2019 Jan 29, 2019

Hi ClayUUID (and Psychrome)

I actually didn't say export but Psychrome did. And he means export because he wants to export/save the generative creations of his "app" as SVG (ideally) or PDF, well, on the harddisk of his Mac, I presume.

But I admit, I got a bit carried away. I felt intrigued by his generative art concept, something I'm myself keen on. That, what I said about PDF Printer, was a bit speculative. In the meantime I looked into this a bit more closely and it seems that one would be able to select Adobe PDF Printer within the System Preferences (mac os) or Control Panel (windows) under Printers, these days are long gone. When I read Psychrome's question yesterday, the memory of those days washed right over me.

So for example on Create PDFs by printing to file one can choose File > Print. Select Adobe PDF as the printer on Windows but seemingly not on MacOS. It was once possible and I used to use it.

Of course only AIR can write to the local file system, that's true. I had the feeling from Psychrome's concept that the entire experiment would run in an Arts Lab environment and not let's say for the public on a website. So, no problem with building the thing as AIR for Desktop.

never mind

Klaus

Translate
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 ,
Jan 29, 2019 Jan 29, 2019

Thanks for the responses. 

I am putting my own artwork into a movie clip and getting random colours from the Colour Lovers API:

https://www.colourlovers.com/api

I have used this on an animation which was pretty cool...

https://www.instagram.com/p/BgzSeZ7jQQA/

But I want to take a frame of the animation and use it to make a pattern or something which I could make into something real (like a canvas or a t-shirt etc). Since it is all vector I don't want to just capture an image of it. I want to get an SVG or PDF which I can open in Illustrator and adjust anything manually and maybe make into a pattern swatch. I hope that makes sense? Thanks for your help. 

Translate
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
Advocate ,
Jan 29, 2019 Jan 29, 2019

Hi Psychrome

Really cool!!

I see on Instagram it's shown as a video. So it's not vector anymore. But how about in Animate you publsh it Fullscreen?

It depends now whether you're working AS3 or Canvas?

In AS3 you'd use StageDisplayState.FULL_SCREEN

In Canvas you'd use the Make Responsive section under Publish Settings in tandem with the Javascript Fullscreen API.

Then you'd have your cool graphics fully blown up and even if you just take screen captures (raster), you at least get huge resulutions for your t-shirt plans etc.

If I have another idea in regards of getting vector out of it, I will post it here.

good success

Klaus

Translate
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 ,
Jan 29, 2019 Jan 29, 2019

Thanks. It's been a while since I've done stuff like this. Before I used a PNG encoder class to click a button and download a PNG with a transparent background. This was great because I could then layer up multiple different generations in Photoshop. Unfortunately, this stopped working with future releases and I've never got back into figuring it out. I have tried a separate approach using HTML but I can't save an SVG from that either... http://psychro.me/svg-generator/shoe.php

I really want control of the vectors because a random generation looks good but you always get one item that's the wrong colour or in the wrong place. So, if anyone knows a way of doing it in Flash or HTML then it would help a lot. Thanks.

Translate
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 ,
Jan 30, 2019 Jan 30, 2019

I've found it! The answer is to go one step further than I was going. When you test a movie you can right click and select print. This gives you the page setup options but there is no print to PDF option here. However, click OK to go to the next dialog and viola, the option to save as PDF is available!! Yay!  

Translate
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
Advocate ,
Jan 30, 2019 Jan 30, 2019

Hurray! This is what I meant in my first reply when I wrote:

I saw in the Context menu the commant Print ...

Klaus

Translate
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 ,
Jan 30, 2019 Jan 30, 2019
LATEST

Thanks a lot mate. I appreciate the help. Like most solutions, the answer is usually right under your nose.  

Translate
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