Announcement

Collapse
No announcement yet.

V-Ray settings presets in a shelf button

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

  • V-Ray settings presets in a shelf button

    Hey all,
    I am trying to implement a set of buttons on the shelf so my colegues at work don't have to call me every time to change V-Ray settings from low quality previews / production quality blablabla. I know it can be done by loading a preset file but I know people are lazy and those few more clicks are gonna be too much for some.

    I created a new shelf button and by following ScriptEditor calls I inserted necessary lines to change settings and it looks like it works.

    I would like to make sure that every button adds denoiser render element and sets it to Mild like this:

    vrayAddRenderElement denoiserChannel;
    setAttr "vrayRE_Denoiser.vray_preset_denoiser" 0;

    then my small issue is that everytime you chose anotheer preset it will add another denoiser element on the top. Can I avoid it by putting some sort of IF STATEMENT that check if there is already a denoiser element active?

    Thanks in advance,
    Karol


    My Artstation
    Whether it is an advantageous position or a disadvantageous one, the opposite state should be always present to your mind. -
    Sun Tsu

  • #2
    I have a python version of that lying around that I use to add all my commonly used render passes.

    Code:
    import pymel.core as pm
    import maya.mel as mel
    
    elements = pm.ls(type='VRayRenderElement')
    
    if not 'vrayRE_Denoiser' in elements:
        mel.eval('vrayAddRenderElement denoiserChannel')
    __
    https://surfaceimperfections.com/

    Comment


    • #3
      Thank you very much dgruwier !!! Damn, after all this piece of Python code worka and looks so much like Java.
      My Artstation
      Whether it is an advantageous position or a disadvantageous one, the opposite state should be always present to your mind. -
      Sun Tsu

      Comment

      Working...
      X