Grasshopper

algorithmic modeling for Rhino

hi!

could somebody give me some clues to script animations in gh? I mean, to automate saving images to make an animated gif, for instance.

Views: 1983

Replies to This Discussion

Hi Miguel,

what do you mean by script animations? Are you looking to animate a single slider? Are you looking to record manual interaction?

--
David Rutten
david@mcneel.com
Poprad, Slovakia
David,

I mean, not only to animate one slider, but, when changing several parameters at the same time: sliders, colours, text, move things ..., to be able to save every change as an image like with the "animate" command in sliders.

I suppose it is a matter of knowing what is the routine for saving Rhino´s viewport as an image and insert it in a loop to save every iteration.

Hope I explained myself now.
yeah this would be great saving all possible sliders
will this work for multiple sliders only from one on/off button ?
and not only sliders, saving any parameter(s) within a script.
Hi Miguel,

you could save the viewport image using the ViewCaptureToFile command (you could call this command from a VB component, you just have to figure out how to properly increment the filename)

How are you going to change multiple parameters at the same time? If you want to animate two sliders simulataneously, why not use just a single slider to begin with? Or do you want to animate them in a non-linear fashion?

--
David Rutten
david@mcneel.com
Poprad, Slovakia
mmm, well I wasn´t thinking about sliders (at least not at the moment) but about values that come from a text file and then different variables change.

I have them within a loop in a script and I´d like to save every iteration to be able to see how the geometry is "produced".

what methods does ViewCaptureToFile? only the path?
ViewCaptureToFile allows you to specify the file name, file format, resolution (width and height) and whether or not to include certain basic objects such as the Grid and the World Axes.

In the Slider animation feature I do not use this approach. I ask the DisplayPipeline to draw itself into a memory bitmap which I then save to disk afterwards.

--
David Rutten
david@mcneel.com
Poprad, Slovakia
sorry David, I tried using the ViewCaptureToFile method but I didn´t the syntax or the namespace.
It's not a method in the SDK, it's a command you can call via app.RunScript("-_ViewCaptureToFile.......")

--
David Rutten
david@mcneel.com
Poprad, Slovakia
I never used that command :-s

I tried:

app.RunScript("ViewCaptureToFile(bla:\bla\bla\text.jpg)");

but I get an error in Rhino!
Miguel,

you have to supply the command string in the same format as you would type it by hand. Commands do not work like Functions in VB.NET. You're not allowed to use brackets for example.

In this case you'd use something like:

app.RunScript("-_ViewCaptureToFile ""C:\test.jpg"" _Width=800 _Height=600 _DrawGrid=_No _DrawWorldAxes=_No _Enter")

Have a look in the Rhino Helpfile for "Rhino Scripting" or "Command Scripting" (not to be confused with RhinoScript which is a programming language).

--
David Rutten
david@mcneel.com
Poprad, Slovakia
ok, David, I´ll have a look at the documentation on command scripting in Rhino

thanks for your help


(btw, I may be doing something wrong because the code you posted doesn´t seem to work :-))

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service