Announcement

Collapse
No announcement yet.

scripting Output size

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

  • scripting Output size

    Hi all,
    I wonder how to script the image size. I know both Rhinoscript and PythonScript, and I saw that the "SetRenderOutputSize" is exposed.
    What are the parameter to pass to this module to make it working?
    It asks for parameter but I can't find the right Key.

    this is the message (RhinoPython)
    "Message: Error while invoking SetRenderOutputSize. A required parameter was omitted."


    Thanks.
    Riccardo

  • #2
    Holy cow! Great find! I haven't double-checked the available methods since before the last build, and I never noticed this one. This is great! Here's the syntax:

    Sub SetRenderOutputSize (ByVal image_width as long, ByVal image_height as long)

    and it works great!

    so for python:
    -------------
    import Rhino
    import rhinoscriptsyntax as rs


    objPlugIn = rs.GetPlugInObject("V-Ray for Rhino")


    if objPlugIn is not None:
    objPlugIn.SetRenderOutputSize(1000,500)
    -------------

    and for rhinoscript:
    -------------
    Option Explicit


    Dim VRay
    Set VRay = Rhino.GetPluginObject("V-Ray for Rhino")


    Dim x,y
    x = 1000
    y = 500


    Vray.SetRenderOutputSize x, y
    --------------


    I'm using iTripoli's free Type Library viewer to see the available methods in the vrayforrhino.tlb file

    I have some homework to do... =)
    Last edited by fooprobe; 03-04-2013, 09:17 AM.
    emil mertzel
    vray4rhinoWiki

    Lookinglass Architecture and Design

    Comment


    • #3
      GREAT!!!!!!!
      I'll try now.

      Tanks also for the Tripoli's tip!

      I'll share my script asap.

      Comment


      • #4
        I would be curious for a button script to set a render size. I would like to create some buttons for my preferred sizes.
        www.simulacrum.de - visualization for designer and architects

        Comment


        • #5
          Micha, you can just paste the rhinoscript code into a button but you have to tell it it's a script. so paste this:
          ---------


          -_RunScript (
          Option Explicit




          Dim VRay
          Set VRay = Rhino.GetPluginObject("V-Ray for Rhino")




          Vray.SetRenderOutputSize 500,300
          )



          ----------

          insert whatever you want instead of 500 (width) and 300 (height). I'm working on adding this to my little UI project.
          emil mertzel
          vray4rhinoWiki

          Lookinglass Architecture and Design

          Comment


          • #6
            also skysurfer, i passed the x & y variables in the rhino code i posted, but of course you can pass the values directly as shown in my reply to Micha above
            emil mertzel
            vray4rhinoWiki

            Lookinglass Architecture and Design

            Comment


            • #7
              Thank you, works great.
              www.simulacrum.de - visualization for designer and architects

              Comment


              • #8
                An other question - is it possible to enable/disable the VfR output size. My idea is: often I need two resolutions during a project, one for preview and one for final output. I could set the preview size at the Rhino options and the final output at the VfR options. Now it would be good to setup up two render buttons - one for VfR output and one for Rhino output size.
                www.simulacrum.de - visualization for designer and architects

                Comment


                • #9
                  Here my first release.
                  This is a beta version, it works but I have to tweak a couple of thinghs.

                  fooprobe: may you help me in let the assign button also close down the form? I can't reach a good solution.

                  To Do List:
                  Short version button, to have just some major options
                  Get the current resolution and display it
                  credits.
                  Attached Files

                  Comment


                  • #10
                    Micha, unfortunately there is no way to script the "override viewport" checkbox at this time. i've added it to my wishlist thread, ha ha. in the meantime, why not just have the second toolbar button for preview just use a smaller output size in the script? why do you need it to disable the override-viewport option?
                    emil mertzel
                    vray4rhinoWiki

                    Lookinglass Architecture and Design

                    Comment


                    • #11
                      skysurfer - wow that's pretty intense. i don't know windows forms, but can't you just call the Close() function in the assign button after you're done with the rhino script?

                      edit: yes that works, if you add the following line:

                      self.Close()

                      right after you call SetRenderOutputSize then the window will close when you click the button.

                      here's the updated toolbar:
                      Vray_Output_Size.zip
                      Last edited by fooprobe; 04-04-2013, 09:21 AM.
                      emil mertzel
                      vray4rhinoWiki

                      Lookinglass Architecture and Design

                      Comment


                      • #12
                        Ha ha ha... I'm triyng till this morning with self.close() and wasn't working! ha ha!

                        MANNAGGIA ALLE MAIUSCOLE!!! ( fair translation: Oops, the Uppercase)
                        Thanks for your help, of course it works!

                        Note: I would add a button to reduce the number of option.

                        Ciao
                        Riccardo

                        Comment


                        • #13
                          yes, i don't like that python is case-sensitive. we can take the coding discussion offline, i'd like to ask for your help with something too, i'll send you a PM
                          emil mertzel
                          vray4rhinoWiki

                          Lookinglass Architecture and Design

                          Comment


                          • #14
                            My workflow is that my client ask me for a final resolution in a defined ratio - for example 3200x2000. The smaller previews should be in the same ratio, but for example 800x500. So, I don't know what the best way is. I would like to setup a button LMB full res and right mouse button preview res.
                            www.simulacrum.de - visualization for designer and architects

                            Comment


                            • #15
                              full res:
                              --------


                              -_RunScript (

                              Option Explicit

                              Dim VRay
                              Set VRay = Rhino.GetPluginObject("V-Ray for Rhino")

                              Vray.SetRenderOutputSize 3200,2000
                              )


                              -----------
                              preview res:
                              -----------


                              -_RunScript (
                              Option Explicit

                              Dim VRay
                              Set VRay = Rhino.GetPluginObject("V-Ray for Rhino")

                              Vray.SetRenderOutputSize 800,500
                              )


                              or were you trying to ask for user input somehow?
                              emil mertzel
                              vray4rhinoWiki

                              Lookinglass Architecture and Design

                              Comment

                              Working...
                              X