Architectural rendering - Only one Vray sun enable at a time

Hi, guys
I'm looking for a script who automatically turn off other Vray suns when one is enable.
In architectural rendering, we make multiple point on view with many suns positions, but on earth, there is only one sun in one position at a time...

AttachmentSize
sunscams.jpg43.53 KB

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Tokamak's picture

Thanks!

Woh! Thanks Kostadin! It works well, even in Vray light Lister.
Time saver when testing different sun positions in ActiveShade!

Do you know if its possible to add an "auto enable vraysun on select"? There is no keyboard or Quads shortcut to enable/disable vraysun.

miauu's picture

.

	function EnabledVRaySunOnSelect =
	(
			if selection.count == 1 do
			(
				selObj = selection[1]
				if classOf selObj == VRaySun do
				(
					selObj.enabled = true
					for o in lights where o != selObj and classOf o == VRaySun and o.enabled == true do o.enabled = false
				)
			)
	)
	callbacks.removeScripts id:#Miauu_EnabledVRaySunOnSelect
	callbacks.addScript #selectionSetChanged "EnabledVRaySunOnSelect()" id:#Miauu_EnabledVRaySunOnSelect
Tokamak's picture

EnabledVRaySunOnSelect.....Perfect!

Thanks again Kostadin!
This version is way better than the first one. No need to click somewhere, just selecting one sun is enough to test a different scene lighting.
I thing you can propose this script as a new time sever tool for architectural rendering guys.
It's especially useful when your are in meeting with an architect and he ask you to test many lighting conditions.

miauu's picture

.

Thank you.
I will release it as a new script when I have free time.

miauu's picture

.

Try this:

vraySunAutoDisable_ade234 = undefined
	function DisableEnabledVRaySun ev n =
	(    
		obj = getAnimByHandle n[1]
 
		if obj != undefined do 
		(
			if classOf obj == VRaySun do 
			(
				if obj.enabled == true do
				(
					for o in lights where o != obj and classOf o == VRaySun and o.enabled == true do o.enabled = false
				)
			)
		)
	)
 
	vraySunAutoDisable_ade234  = NodeEventCallback modelOtherEvent:DisableEnabledVRaySun

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.