Announcement

Collapse
No announcement yet.

Grasshopper: Render fails silently if file path doesn't exist

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Grasshopper: Render fails silently if file path doesn't exist

    I noticed that the Vray Renderer for Grasshopper silently fails if you don't provide a valid file path for the "Out Img" parameter. If you have nothing connected it works fine. If you have a valid file path connected it works as well. But if for some reason you connect an invalid file path, say a relative file path, the renderer opens and just does nothing without giving any indication why.

    Normally in Grasshopper the renderer would turn orange or red and give an error description. I also tried to open the Vray message window and that does nothing on the Grasshopper renderer. Once again on the Vray render window launched from Rhino I can open the messages window, but not in Grasshopper.

    Check the attached .gh file in the zip.
    Attached Files

  • #2
    Hi, Seltzdesign,

    As you noticed, the V-Ray Render component in Grasshopper requires an absolute file path to be connected to the Output parameter.
    There's another option you might want to try that does not depend on the file path. Keep the component connected to the Out Img disabled and save the images directly from the VFB.
    Hope this helps!


    Kind regards,
    Natali
    Natali Velcheva
    V-Ray for SketchUp | V-Ray for Rhino | QA
    www.chaosgroup.com

    Comment


    • #3
      Originally posted by natali.velcheva View Post
      Hi, Seltzdesign,

      As you noticed, the V-Ray Render component in Grasshopper requires an absolute file path to be connected to the Output parameter.
      There's another option you might want to try that does not depend on the file path. Keep the component connected to the Out Img disabled and save the images directly from the VFB.
      Hope this helps!


      Kind regards,
      Natali
      Hi Natali.

      Thanks for the suggestion. We actually want to do automated batch rendering, so they need to save automatically.

      So the absolute path needs to exist, or can it create the necessary directories too?

      Will it silently overwrite images if it gets the same path twice? In fact, if I "Render Animation" will it always add the frame number to the file name, or can I have it so I give a distinct file name for each frame myself and it then doesn't add it?

      Lastly, could you please make the render node fully parametric and let us start/stop rendering images or animations using inputs please. There was a lengthy discussion on why it is bad practice to add functionality to right-click menus rather than just adding them as boolean inputs.

      Thanks for considering.

      Armin.

      Comment


      • #4
        Hi, Seltzdesign,

        Unfortunately, directories cannot be created post-process and they have to pre-exist. Also, existing files will be overwritten silently each time the renderer runs.

        Regarding animations, the saved images will always have the frame number added to the filename. Renaming multiple files in Explorer at once could be scripted afterwards.

        In respect to the design of V-Ray for Grasshopper, we always appreciate any feedback! Things are susceptible to change when possible and user input is always helpful! Unfortunately for certain functions a boolean input is not a viable option.

        As a workaround for starting / stopping renders, you could use a C# or Python components as a script access to V-Ray (example screenshots attached).

        HERE you can find more details regarding V-Ray Script Access in Grasshopper

        Kind regards,
        Natali
        Attached Files
        Natali Velcheva
        V-Ray for SketchUp | V-Ray for Rhino | QA
        www.chaosgroup.com

        Comment


        • #5
          Hi Natali,

          That's awesome, thank you!! Okay, if Script Access exists then that changes everything. I will create the script components you are showing and then just add them as user objects to GH to reuse them everywhere.

          Yes, I know once you start doing things sort of asynchronous to Grasshopper things aren't as easy and not everything can be solved with boolean inputs.

          So now the last puzzle piece to actually doing our own loops and either rendering or exporting things using the Vray Renderer are some callback functions. The way loops work is that it obviously waits for the whole GH solution to calculate before moving to the next iteration. You do the same when you render an animation using the timeline component.

          Is there script access to that too? If so, then we could add an output to the script component that for example just outputs a boolean TRUE once the render or export process is done.

          That way we could do a lot more automation like creating the folders, renaming files, etc. all in Grasshopper.

          What do you think?

          Comment


          • #6
            Hello again Natali.

            I just noticed something using the Script Access. If you trigger a Render in GH using the Script (that basic example with Python as you show), when you trigger it, it launches the Render Window. Now in Grasshopper you cannot right-click and drag (to move around) any longer.

            I think its due to the fact that the button's MouseDown event gets "lost", because as soon as it is triggered Grasshopper loses focus. You basically have to trigger the same button again for it to return to normal behaviour.

            This is a known bug in Grasshopper and I wonder if you a) have come across it and b) have told the Rhino Devs about it.

            Us users can mention these things and they hardly get noticed, but if a big developer like you calls them out on it, maybe something gets done.

            Comment

            Working...
            X