ZBrushCentral

Use zscript to turned off the shadow of the lights(lightcap)

I am using lightcap, I hope to retain only the shadow of the selected lighting is on, the shadow of the lights will be turned off, I would like to ask whether it can be done(one button).

Thank you very much! !

If I understand correctly what you are trying to do, yes, it is possible to turn off the shadows for a LightCap so that they are all off except the selected light. This is basically how it’s done:


[IButton,"Turn off Shadow","Turn off shadows for other lights",
  //get the current light
[VarSet,currentLight,[IGet,Light:Light Cap:LightIndex]]
//get the number of lights
[VarSet,lightNo,[IGetMax,Light:Light Cap:LightIndex]]
//loop through lights turning off shadow
[Loop,lightNo,
  [ISet,Light:Light Cap:LightIndex,[Val,n+1]]
  [If,[Val,n+1]!=currentLight,
    [ISet,Light:Light Cap:Shadow,0]
  ]  
,n]
//reset to current Light
[ISet,Light:Light Cap:LightIndex,currentLight]
]//end button

HTH,

marcus_civis,

Thank you very much!
I would like to ask how to use this code, I try to use it as a macro, it can not be loaded.:wink:

OK, it needs to be edited a little for a macro.

  1. Download the attached file and save it to your ZBrush ZStartup/Macros/Misc folder.
  2. Press Macro>Reload All Macros, or restart ZBrush

You will then have a new button called ‘Turn Off Shadows’ in the Macros>Misc sub-palette.

Download here:

marcus_civis,
Thank you very much! :smiley:

Hello, i can’t see donload link, could you please post this again.

Hey I’ve found this script on a Michael Pavlovich’s tutorial:
Here is the tutorial:

Here is the script:

https://drive.google.com/file/d/16jBGUMboiBhI4zx1ZHRyWqsz0BH_0Wd0/view

Hope it helps !
cheers