MoonDoggie
10-23-2008, 08:54 PM
This is exhibited in VRay when changing the vrayproperties of an xref and then rendering over a network:
To replicate:
1. create a new scene and xref a box in
2. Script traversing the xrefs in the file and modifying the userproperties of
execute this script
fn setXRefScenesToMatte = (
if (local xrefCount = xrefs.getXRefFileCount()) != 0 then (
for i = 1 to xrefCount do ( -- get each xref scene in the file
local xrscene = xrefs.getXRefFile i -- xrscene equals the xref scene in which is loaded
for x in (xrscene.tree.children) do ( -- for each object in the xref scene
try (
setUserProp x "VRay_Matte_Enable" true -- sets the object to a matte object
setUserProp x "VRay_Matte_Alpha" -1 -- sets the alpha contribution to -1, consider using 0 as well
) catch ()
) -- end each object in scene
) -- end all xrefs done
true
) else false
)
fn resetXRefScenes = (
if (local xrefCount = xrefs.getXRefFileCount()) != 0 then (
for i = 1 to xrefCount do ( -- get each xref scene in the file
local xrscene = xrefs.getXRefFile i -- xrscene equals the xref scene in which is loaded
for x in (xrscene.tree.children) do ( -- for each object in the xref scene
try (
setUserProp x "VRay_Matte_Enable" false -- sets the object NOT to a matte object
setUserProp x "VRay_Matte_Alpha" 1 -- sets the alpha contribution to 1
) catch ()
) -- end each object in scene
) -- end all xrefs done
true
) else false
)
3. execute this in the listener
setXRefScenesToMatte()
4. Do a test render, the object is correctly matted !!!
(I am setting all xref objects to matte by traversing the xref files and navigating xrefScene.tree.children and setting the vrayproperty "VRay_Matte_Enable" to "on")
5. Network submit this render and your render will be completely unmatted.
I am going to try registering a callback to matte them at #preRenderFrame but I haven't tested it thoroughly. Any ideas why this information isn't saved over the network?
Thank you,
Colin
To replicate:
1. create a new scene and xref a box in
2. Script traversing the xrefs in the file and modifying the userproperties of
execute this script
fn setXRefScenesToMatte = (
if (local xrefCount = xrefs.getXRefFileCount()) != 0 then (
for i = 1 to xrefCount do ( -- get each xref scene in the file
local xrscene = xrefs.getXRefFile i -- xrscene equals the xref scene in which is loaded
for x in (xrscene.tree.children) do ( -- for each object in the xref scene
try (
setUserProp x "VRay_Matte_Enable" true -- sets the object to a matte object
setUserProp x "VRay_Matte_Alpha" -1 -- sets the alpha contribution to -1, consider using 0 as well
) catch ()
) -- end each object in scene
) -- end all xrefs done
true
) else false
)
fn resetXRefScenes = (
if (local xrefCount = xrefs.getXRefFileCount()) != 0 then (
for i = 1 to xrefCount do ( -- get each xref scene in the file
local xrscene = xrefs.getXRefFile i -- xrscene equals the xref scene in which is loaded
for x in (xrscene.tree.children) do ( -- for each object in the xref scene
try (
setUserProp x "VRay_Matte_Enable" false -- sets the object NOT to a matte object
setUserProp x "VRay_Matte_Alpha" 1 -- sets the alpha contribution to 1
) catch ()
) -- end each object in scene
) -- end all xrefs done
true
) else false
)
3. execute this in the listener
setXRefScenesToMatte()
4. Do a test render, the object is correctly matted !!!
(I am setting all xref objects to matte by traversing the xref files and navigating xrefScene.tree.children and setting the vrayproperty "VRay_Matte_Enable" to "on")
5. Network submit this render and your render will be completely unmatted.
I am going to try registering a callback to matte them at #preRenderFrame but I haven't tested it thoroughly. Any ideas why this information isn't saved over the network?
Thank you,
Colin
