What means "Enabled with a script"? (Camera features)

  • Camera clipping user interface implemented. When the camera clipping is enabled with a script the appropriate UI controls (Clipping Near, Clipping Far) are listed in the Camera settings rollout

Hi,

I don’t understand how to get access to the new controls?

-Micha

Hi Micha,

After you run the following script ```

import rhinoscriptsyntax as rs
import System
rv = rs.GetPlugInObject(“V-Ray for Rhino”).Scene().Plugin(“/RenderView”)
rv.Param(“clipping”).Value = System.Boolean(True)


you should be now able to see the UI controls in the Asset Editor's Camera Settings - see attached image.
![vrayneui\_2021-03-26\_10-30-02.jpg|762x677](upload://7KcWulcTELTBwGIdqpDsrlZP7EJ.jpeg)

Great, thank you. Could it be possible to get a button which enable all advanced features? Maybe at the VfR toolbar? So, your advanced users could get a full interface with all the handy nice features. :wink:

Could it be possible to get a button which enable all advanced features? Maybe at the VfR toolbar?
Please, not all of us know how to script. But advanced users need those tools.

Can you guys advise how to run this script to enable the camera clipping?
for some reason, I got an error?

Best

I figured it out. The issue is that the camera clipping UI appears after I save the file. Is there any easy way to update the UI?

Best,

I don’t understand the problem. You get an UI and can change the parameter. Is it not easy? Or is something not working? I didn’t test it now.

Hi @javierrentas

Yes there is. There is a method called ‘RefreshUI’ you can call to push the changes to the UI
As an alternative you can make a transaction that will automatically push the changes

Also the script is using the old syntax. There is a wrapper python module in the installation that hides the details and makes it quite clean & neat to script V-Ray:


import rhVRay as vray

vray.Scene.RenderView.clipping = 1
vray.RefreshUI()

If you prefer the transaction way


import rhVRay as vray

vray.Scene.BeginChange()
vray.Scene.RenderView.clipping = 1
vray.Scene.EndChange()

I’ll make some changes to how the transactions work in the future releases, so it is even cleaner, neater and more intuitive

Cheers

Thank you Nikolay, The scripts did their job.

Best,

Starting V-Ray 5.20.04 for Rhino there is a simpler transaction syntax, inspired from this thread


import rhVRay as vray

with vray.Scene.Transaction() as f:
    vray.Scene.RenderView.clipping = 1