jonahhawk
11-19-2009, 06:38 AM
Anyone use both RPM and VRay?
This will create one pass per light in the scene but I'm having problems with VRaySun and with the VRaySun in a Daylight assembly head.
if not rmpasses.open do RPMdata.RMopenFloater()
global allLights = #()
for a in lights where classof a != Targetobject do --and classof a != objectset
(
append allLights a
)
global existPasses = RPMdata.GetPassCount() --store the existing number of passes
("PassCount:" + existPasses as string)
capSet = RPMCaptureProps.createCaptureObjectSet() -- create a new capture set. Would like to add the Name at this point
lightCapture = RPMCaptureProps.getMyPropDefinitions lightinputarray:#("On") --Define the properties
RPMCaptureProps.assignCaptureProperties #(1) lightCapture --Assign the properties to the capture set. Would like to use the appropriate index here if there were existing CaptureSets
RPMCaptureProps.addObjectsToSet 1 allLights suppressProgress:false -- Add all the lights to the CapSet
--Build a pass for each light
for i = 1 to allLights.count do
(
lightname = allLights[i].name
RPMdata.AddPassSetup setname:lightname noEdit:true
--turn off all lights
for k = 1 to allLights.count do
(
if (hasproperty allLights[k] "enabled") then allLights[k].enabled = false
else if (hasproperty allLights[k][2] "enabled") then allLights[k][2].enabled = false
else allLights[k].on = false
)
--turn on the corrisponding Light
if (hasproperty allLights[i] "enabled") then allLights[i].enabled = true
else if (hasproperty allLights[i][2] "enabled") then allLights[i][2].enabled = true
else allLights[i].on = true
RPMCaptureProps.OPcapture_object allLights
)
rmpasses.close()
RPMdata.RMopenFloater()
This will create one pass per light in the scene but I'm having problems with VRaySun and with the VRaySun in a Daylight assembly head.
if not rmpasses.open do RPMdata.RMopenFloater()
global allLights = #()
for a in lights where classof a != Targetobject do --and classof a != objectset
(
append allLights a
)
global existPasses = RPMdata.GetPassCount() --store the existing number of passes
("PassCount:" + existPasses as string)
capSet = RPMCaptureProps.createCaptureObjectSet() -- create a new capture set. Would like to add the Name at this point
lightCapture = RPMCaptureProps.getMyPropDefinitions lightinputarray:#("On") --Define the properties
RPMCaptureProps.assignCaptureProperties #(1) lightCapture --Assign the properties to the capture set. Would like to use the appropriate index here if there were existing CaptureSets
RPMCaptureProps.addObjectsToSet 1 allLights suppressProgress:false -- Add all the lights to the CapSet
--Build a pass for each light
for i = 1 to allLights.count do
(
lightname = allLights[i].name
RPMdata.AddPassSetup setname:lightname noEdit:true
--turn off all lights
for k = 1 to allLights.count do
(
if (hasproperty allLights[k] "enabled") then allLights[k].enabled = false
else if (hasproperty allLights[k][2] "enabled") then allLights[k][2].enabled = false
else allLights[k].on = false
)
--turn on the corrisponding Light
if (hasproperty allLights[i] "enabled") then allLights[i].enabled = true
else if (hasproperty allLights[i][2] "enabled") then allLights[i][2].enabled = true
else allLights[i].on = true
RPMCaptureProps.OPcapture_object allLights
)
rmpasses.close()
RPMdata.RMopenFloater()
