[convert] area lights to mesh planes

Hi,

Does anyone have an idea if such a script exists already? What I want is to convert vray plane lights into mesh planes, but keeping the position and dimensions of the original lights.

Many thanks,

Comments

Comment viewing options

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

...

This fn works with vray lights (sphere and plane type)
You have two arguments:
- if "turn" is set to "on" then existing lights will stay enabled ei. on
or you can set all selected light off
- "assigneLightMtl" - when is "on" every plane or sphere geometry will
have VRayLight material with same color and multipliar as actual light

Select some vray lights and run code below. Also twick args in the last line of code

fn vrlightToMesh turn:off assigneLightMtl:on = 
(
	if selection.count == 0 then messageBox "select some vray light first!" title:"Warning" beep:off else
	(
		for light in selection where iskindof light VRayLight do
		(
			light.on = turn
			material = if assigneLightMtl do VRayLightMtl compensate_exposure:on multiplier:light.multiplier color:light.color
			case light.type of
			(
				0: plane transform:light.transform length:(light.size1*2) width:(light.size0*2) lengthsegs:1 widthsegs:1 material:material wirecolor:yellow
				2: sphere transform:light.transform radius:light.size0 segs:16 material:material wirecolor:yellow
			)
		)
	)
)
vrlightToMesh turn:off assigneLightMtl:on

barigazy

Comment viewing options

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