DomC Posted August 17, 2016 Share Posted August 17, 2016 (edited) Hi 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.SelectObj(criteria) vs.DoMenuTextByName('Copy',0) vs.DoMenuTextByName('Paste As Picture',0) h = vs.LNewObj() vs.DelName('temp_name_domc') #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 August 17, 2016 by DomC Quote Link to comment
AlanW Posted August 18, 2016 Share Posted August 18, 2016 (edited) Dom, Not sure if this helps. Animates the hands on the Clock. Alan Edited August 18, 2016 by Alan Woodwell Quote Link to comment
DomC Posted August 18, 2016 Author Share Posted August 18, 2016 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. Quote Link to comment
DomC Posted August 24, 2016 Author Share Posted August 24, 2016 Not tried, but I think I found it. vs.CreateImageFromPaint(paint, imageName) Quote Link to comment
Patrick Winkler Posted August 25, 2016 Share Posted August 25, 2016 Great idea! I think the criteria is the problem. The Copy command works fine in this node: @Marionette.NodeDefinition 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' ) this.SetListAbsorb() x = Marionette.PortIn( [] ) x.SetDescription( "input" ) pic = Marionette.PortOut() pic.SetDescription( "Handle of the picture" ) def RunNode(self): vs.DoMenuTextByName('Copy',0) 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 else: self.Params.pic.value = 'Something went wrong' Quote Link to comment
Patrick Winkler Posted August 25, 2016 Share Posted August 25, 2016 (edited) I was able generate and export a range of images but unfortunately they look all the same. I have also tried to iterate trough the list of objs in a loop but this leads to the Error: 'Menu Copy is disabled'. vs.CreateImageFromPaint(paint, imageName) crashes VW. Edited August 25, 2016 by Patrick Winkler Quote Link to comment
DomC Posted August 25, 2016 Author Share Posted August 25, 2016 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. Quote Link to comment
Recommended Posts
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.