Jump to content
Developer Wiki and Function Reference Links ×

Exporting Image


Recommended Posts


The Result of my efforts should be, to export steps in a generative design-scripts as images on the disk. This would be the base, of an animation to see, what happens in a script.

This works in a Vectorscript without any problems as follows:

criteria="(INSYMBOL & INOBJECT & INVIEWPORT & (N='temp_name_domc'))"

vs.DoMenuTextByName('Paste As Picture',0)
h = vs.LNewObj()

#vs.ExportImageFile(hImage, 'BildExportTest.png')

In a Marionette Node, this will not work, because the copy command will not work.

My Questions:

1. Anyone knows another way (Instead of do menu Text) do export something as an image file?

2. Somebody knows, why copy (and cut) do not work inside a marionette Script? This is too bad.

Imagine, we could animate growing things in marionette. In a Vectorscript it works, so it just seems to be a limitation of Marionette.

The Workaround at the moment seems to be, to create layers for every step and export those layers as an image. Or use them as a flicker book.

Attached movie shows a simple example, of what I want to be able to do (without the flipper-book workaround just with marionette)

Edited by DomC
Link to comment

The Idea is, to have a generally node for that. The existing examples (as above) use a redraw command inside every move node (So we had to "hack" every node)

And I think, that will not nice in OpenGL, any 3D View or bigger networks (too slow)

Sure, we (I :grin: ) can do this with a code-script (also the export as images) without marionette. But "without marionette" is not the ambition.

I wanted to use this, to make nice documentations of marionette scripts.

Link to comment

Great idea!

I think the criteria is the problem.

The Copy command works fine in this node:

class Params(metaclass = Marionette.OrderedClass):
this = Marionette.Node( 'Copy and Paste As Picture' )
this.SetDescription( 'Do nothing node. It just passes the input to the output: y = x' )
x = Marionette.PortIn( [] )
x.SetDescription( "input" )

pic = Marionette.PortOut()   
pic.SetDescription( "Handle of the picture" )

def RunNode(self):
vs.DoMenuTextByName('Paste As Picture',0)

h_pic = vs.LActLayer()
# vs.LNewObj Failed in this situation!

if vs.GetTypeN(h_pic) == 14: # BitMap
	self.Params.pic.value = h_pic
	self.Params.pic.value = 'Something went wrong'

Link to comment

I heard a rumour, that we can just wait for one of the next versions :-)

I looked at : "vs.CreateImageFromPaint(paint, imageName)"

This converts an Image Resource from an imported Picture. "Paint" is an image in the drawing and "Image" is an image fill resource in this context.

I also looked for a way to make a handle as a criteria. Cause some of the very powerful script commands works with criteria.

there could be a way with pdf export to generate frames for a movie.

There are some python library to convert images to mp4 so there should be a way to automate exporting a movie.

For now I make it with created Layers inside Marionette and a seperate Python script, which exports the layers as jpg frames. And then the shareware

"Time Lapse Assembler.app" to connect jpgs to mp4. I will post some examples if they are ready to post.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...