Vray light "Fit to texture"

Hello, thanks for looking in. This is a minor thing, but it would be nice to somehow be able to see your maps on the vray light in the viewport (so we know if they are facing the right direction) or maybe having a box that sets the width and height to the dimensions of the map.

No biggie if it’s hard or a pain, just find myself rendering to check alignment instead of just flowing along.

It’s supposed to work.
I don’t recall the exact setup (realistic viewport/DX blablabla…) but for us in 2014 it doesn’t work, that’s why I coded this little script here.
What it basically does is creating a non-renderable plane at the light with the texture to visualize it. Currently only works for rectangular area lights.

macroScript GradientLight category:"#Pinkschwarz" tooltip:"GradientLight" buttontext:"GradientLight"

(
	--material
	local matVerlaufMap		= VRaySoftbox name:"Licht_Verlauf" vertGradOn:true
	local matVerlaufMtl		= VRayMtl texmap_diffuse:matVerlaufMap showInViewport:true 

	--objekte
	local oLicht		= VRayLight size0:25 size1:25 pos:[0,0,300] type:0 color_mode:0 color:[255,255,255] texmap:matVerlaufMap normalizeColor:3 multiplier:500
	local oPlane		= Plane length:50 width:50 lengthsegs:1 widthsegs:1 pos:oLicht.position displayByLayer:false renderByLayer:false showFrozenInGray:false backfacecull:false mapcoords:true realWorldMapSize:false material:matVerlaufMtl renderable:false isFrozen:true parent:oLicht

	--modifier
	local mNormal			= Normalmodifier flip:true
		addModifier oPlane mNormal
	local mUVWXForm	= UVW_XForm U_Flip:1
		addModifier oPlane mUVWXForm
	local mDelMesh		= DeleteMesh()
		addModifier oPlane mDelMesh
		oPlane.Modifiers[1].enabledInViews 	= false
		oPlane.Modifiers[1].enabledInRenders 	= true

	--verbindungen
	paramWire.connect oLicht.baseObject[#size0] oPlane.baseObject[#Width] "size0*2"
	paramWire.connect oLicht.baseObject[#size1] oPlane.baseObject[#Length] "size1*2"
)

macros.run "#Pinkschwarz" "GradientLight"

Wow this is great! Thank you for sharing this.