Grasshopper

algorithmic modeling for Rhino

Hi all,

I have been tweaking the animation/render components by Jacek Markusiewicz for a project of my own. The script contains two C# components:

1) ActivateRender, which controls how many frames there are to render, and outputs 'false' when the required number of frames have been generated.

2) DoRender, which adds GH objects to Rhino (without baking) and sends a 'render' command.

The problem

When I press 'start', the code runs as expected and renders are successfully created. But when the rendering loops are finished, the canvas freezes - you cannot move it, and most components become unresponsive. Neither GH nor Rhino have actually crashed - you can still access the drop down menus and save your GH file for example, but the canvas remains frozen. It can only be unfrozen by completely restarting Rhino.

The strange thing is that you can still press the 'start' button again, even when the rest of the canvas is frozen. When you do this, the rendering process starts again. When this loop of renders is finished, the canvas is now unfrozen!

If you press 'start' a third time, the canvas freezes again at the end of the process, in the same way as the first press. A fourth press runs the loops again and unfreezes the canvas, much like the second press. You can keep going forever - an odd number of presses will leave the canvas frozen, an even number unlocked.

What I need

1) For the file to work every time without freezing the canvas at the end of the rendering process

2) To understand what's going on, so I can avoid this error in the future.

Thanks in advance for your help :)

James

Views: 1050

Attachments:

Replies to This Discussion

My guess is it is because you're using a button. Somehow using a button and baking flips out the canvas. Chances are if you use a boolean toggle, it will work as expected.

Thanks, I was actually able to make it work with a toggle without problems. But for various UI reasons I would prefer to make it work with a button. It's quite perplexing why it works with one but not the other.

Do you think it's a bug in GH (possibly with the button control) or is there something in my code that's causing it?

Looks like the switching to the RenderWindow gets the Canvas UI confused.

What exactly did you change to get it working with a toggle?

It's something common in GH. I guess it has to do with the fact that a button has a UI callback at the end of the solution to show the button back in the "up" position, but I'm not too sure about this behaviour, perhaps david can shed some light on this matter?

Hannes, connect a toggle to 'start', edit the ActivateRender component to transmit 'true' when the toggle is true, and remove the use of the 'running' boolean. It should then work every time. I'd prefer not to use a toggle as, to run the process a second time, you would have to turn the toggle back to false and then back to true - a clumsy solution.

Arend, now that you mention it, I have noticed strange behaviour in the button before in other GH work, although not as catastrophic. Yes, David, if you're reading, your insight would be highly appreciated :)

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