PDA

View Full Version : Why don't user properties save when rendering over a network?


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

MoonDoggie
10-24-2008, 06:36 AM
Also, registering a callback at #preRender and #preRenderFrame and calling the function does absolutely nothing as well. I'm out of ideas.

DaveWortley
10-24-2008, 08:39 AM
It doesn't even save with the file, if you run your script then re-open your file your settings will be lost unfortunetly. I think Kramsurfer is the one who uses this technique, he uses a pre-render script to make it work over the network.

Gravey
10-24-2008, 09:10 AM
seems a few of us are working on similar things at the moment. I too am using callbacks to modifiy xrefs at render time over backburner. I'm using the #filePostOpen callback as Kramsurfer suggested in another thread. (search for filePostOpen and filter by Kramsurfer). You have to remember to make it persistant though.
ie: callbacks.removeScripts id:#myID
callbacks.addScript #filePostOpen <string / function> id:#myID persistent:true
For my callbacks I am currently either specifying a file on our network or building a string and parsing that. If you're having problems, I remember someone saying that they created a script string and stored it on a dummy as a custom attribute and the actual callback script was something simple like "execute $CallbackDummy.<custom attribute name>"

MoonDoggie
10-24-2008, 02:44 PM
thanks guys, I'll pursue this Gravey. Thanks to you too DaveWortley

CGTalk Moderation
10-24-2008, 02:44 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.