Announcement

Collapse
No announcement yet.

fish eye lens and other types via Script?

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

  • fish eye lens and other types via Script?

    Back in V-Ray 2, we had fish eye lenses in V-Ray for SketchUp.
    I'm excited to see that they are becoming available again per the latest update but...

    Originally posted by Release notes
    • Custom camera types (spherical, cylindrical, fish-eye, pinhole, etc.) can now be selected via script. The corresponding camera parameters are automatically displayed in the Asset Editor / Camera rollout
    • Custom camera clipping can be enabled via script. The near and far clipping plane options are automatically displayed in the Asset Editor / Camera rollout
    First: Why?

    Why 'available through script'? Why not just add it to the drop down menu in camera?

    Then: How?

    If we need to use a script, please tell us where to type and what to type please?

  • #2
    Hello, Martha,
    The custom camera types were generally very rarely used and thus "culled" from the V-Ray 3 UI in order to keep it as streamlined as possible without taking away additional functionality.
    The ability to set up custom camera types was occasionally requested by users over the past few years and when it was decided to reintroduce them access via script was the most best way to make them available again without intruding extra controls in the common settings sections.

    Here is an example ruby script (sets a cylindrical ortho camera with field of view 360 degrees and a height of 180):
    Code:
    def deg_to_rad(angle)
    angle * Math::PI / 180
    end
    
    cam = VRay::Context.active.scene["/SettingsCamera"]
    cam[:type] = 3
    cam[:fov] = deg_to_rad(360)
    cam[:height] = 180
    
    VRay.refresh_ui
    Make sure to use VRay.refresh_ui each time you use such scripts to keep the UI updated.
    You can find descriptions of each parameter and its values here:
    https://docs.chaosgroup.com/vray_app...settingscamera
    Please keep in mind that this documentation only encompasses V-Ray plugins and their parameters. The V-Ray for SketchUp UI also utilizes userdata parameters. They can be found by exporting a .vropt files and looking for parameters with userdata flags that are of interest to you.

    Regarding camera clipping, you can display the extra controls in the UI by running the following lines in the Ruby console:
    Code:
    VRay::LiveScene.active["/RenderView"][:clipping] = true
    VRay.refresh_ui
    The far and near distance can also be controlled via script, e.g.:
    Code:
    VRay::LiveScene.active["/RenderView"][:clipping] = true
    #clipping distance is measured in inches
    VRay::LiveScene.active["/RenderView"][:clipping_near] = 39.3701
    VRay::LiveScene.active["/RenderView"][:clipping_far] = 196.85
    VRay.refresh_ui
    Hope this helps!

    Kind regards,
    Peter
    Peter Chaushev
    V-Ray for SketchUp | V-Ray for Rhino | Product Specialist
    www.chaos.com

    Comment


    • #3
      yess

      Thanks for the explanation

      I've managed to get it to work. And it works into the cloud as well so I'm happy with that.
      One minor issue: distance, curve & auto fit controls in the asset editor, when they're exposed, don't seem to trigger a change in the interactive render.

      Comment

      Working...
      X