Hey y’all,
I was wondering if it might be feasible to get a script that can update scenes with materials created in Vray 2 to Vray 3 format? Possibly it would create a log of the materials that it processed to facilitate checking through the asset editor to see if the settings transferred accurately. Also, some kind of way to globally switch off the ‘linear workflow’ checkbox for the older materials. I mean, is that helping anybody? I don’t know of anyone who needs that box checked on their older materials…over and over, anyone who uses Vray 3 for the 1st time has to ask on a forum why all their materials look so dark, then start the laborious process of opening every material in every project and switching off the linear workflow check box. For those of us who have tons of long term projects and keep having these old Vray 2 scenes pop up that need all of these conversions done, some kind of automation to make the process easier would be a huge help. (not sure if this should be in the ‘wishlist’ section or not…I feel like it might deserve to be the ‘Bug’ section…)
We have a migration script in place that makes sure that V-Ray 2 materials are upgraded to the new version.
It is executed automatically once a scene is loaded.
The linear workflow checkbox is enabled by this script assuming that you had the global linear workflow enabled in V2.
If you never used it in the previous version then the migration will unfortunately make your materials darker.
Here’s a script that can disable the material option for all scene materials in V3:
VRay::LiveScene.active.select{|p|p.type == "BRDF"}.each{|brdf|
if brdf.has_param?(:linear_workflow)
brdf[:linear_workflow] = false
end
}
VRay.refresh_ui
Hello Konstantin,
Thank you for your response and specially for the script, it will be nice time-saver. I have another big older project that revisions just came in for…so I’ll see if the migration script has been updated, I seem to remember all the Vray 2.0 materials still being the old layered material and I would have to manually create new {microfacet GGX}materials to replace them.
Also, I’d like to apologize - I just re-read my original post and it seems to come across a little on the crabby side. My bad, didn’t mean to sound so ‘complain-y’…so, very sorry about that. (no excuse, but I had too much too drink the night before, and due to becoming an old man…hangovers are getting worse and worse.):-x
‘Window’ --> ‘Ruby Console’ --> then, just copy & paste the code, from Konstanin’s post above, into the ruby console listener and depress the Enter key.
I did a quick ‘fake test’ on new scene I already had open and it worked great.
In general, the migration will not update the shader structure.
The ‘old’ way of building layered materials is still an option so in case you load a scene with a Diffuse and Reflection layers for example, it will be loaded as it was originally set up.
Replacing the 2 layers with a single VRayBRDF is recommended bun not necessary.
Hey Konstantin,
I see what you are saying. That makes sense. I guess I was wondering more on the lines of if it was possible for someone to write a script, just like ‘turn off linear workflow’ script you shared above, that could automatically update the layered materials to the new style. I’ve had a problem recently while collaborating with someone who refuses to update to Vray 3. So every time I get a file back from them all of my BRDF materials are ruined. (it seems that if you open a vray 3 file on on a system running vray 2, it reverts it back to layered.) I’ve had to make them unload Vray before opening any of my files…(but they still accidentally do it from time to time, and it’s a pain to import/replace from another file.) I already can’t remember how to use the layered format…I’ve already got so used to the new Vray 3 material. (I’ve used vray for max for a while though, so I was pretty happy when this came along.)
Although just to be clear, I’m not asking anybody to write this script…I’m pretty happy & thankful to have the ‘linear workflow = false’ script. Just wanted to point this out as your latest post brought this to mind and see if anyone had any input about it.