Does anyone know how to access/open the V-ray Global switches > override material > include/exclude dialog window via maxscript?
Announcement
Collapse
No announcement yet.
Global Material Override via Maxscript
Collapse
X
-
Code:vr = renderers.current showinterfaces vr
Code:V_Ray_DEMO_3_30_03:V_Ray_DEMO_3_30_03 Interface: VRay Properties: .excludeListOverrideMtl : node array : Read|Write .includeListOverrideMtl : node array : Read|Write .excludeListRenderSubset : node array : Read|Write .includeListRenderSubset : node array : Read|Write Methods: <integer>saveCausticsPhotonMap <filename>fileName <integer>saveGlobalPhotonMap <filename>fileName <integer>loadIrradianceMap <filename>fileName <integer>saveIrradianceMap <filename>fileName <integer>clearIrradianceMap() <integer>saveLightCache <filename>fileName <integer>clearLightCache() <integer>showLastVFB() Actions: OK
Code:vr.includeListOverrideMtl
-
Thank you joconnell! I'm headed home for the night but will dig into this a bit more in the morning. At first glance, I think this may do it or at least help but I need to look into populating the exclusionListDlg() with these arrays since I essentially need to recreate that section of the Vray UI in a separate tool. I've never messed around with the Maxscript side of the exclusion list dialog before so I don't even know if it is possible to pass it arrays when opening. Was hoping for the equivalent of a VRAYexclusionListDlg() but I'll spend some more time with it in the morning. Thanks for the help!
Comment
-
Originally posted by joconnell View PostYeah it should be just a normal list of objects that you can set or append to.www.dpict3d.com - "That's a very nice rendering, Dave. I think you've improved a great deal." - HAL9000... At least I have one fan.
Comment
-
Thanks guys. As expected, I stumbled into a dead end as I can not find a way to pass an array to the exclusionListDlg() so unless anyone can enlighten me to a blatant oversight, I'm dead in the water short of coding my own Include/Exclude dialog I can pass the .excludeListOverrideMtl and .includeListOverrideMtl arrays to. It seems crazy to me you can't pass this dialog an array to have it open already populated. What am I missing!?!?!?Last edited by bhh; 21-01-2016, 03:20 PM.
Comment
-
What is it that you're trying to accomplish? I've written scripts to add or remove the selected objects to the override list. They don't open the dialog box though, they just add them to the list. I can post if it helps.www.dpict3d.com - "That's a very nice rendering, Dave. I think you've improved a great deal." - HAL9000... At least I have one fan.
Comment
-
We're developing a "Quick Render" dialog that automates all of the vray settings for key phases of our workflow. In the Camera Development phase for example, we currently use a simple Override Mtl on everything except glass, mirrors, etc. I'm able to loop through the scene geometry and automatically add *glass*, *mirror*, etc. to the exclusion list but since the user is no longer using the standard Render Setup window, if they want to manually add or remove exclusions, they need to open that dialog up and navigate into the global switches to do so. I was hoping to do it all from within this new tool.
The workaround I may look into is to just create a .net list view with checkboxes that essentially works as a simple, alternate exclusionListDlg() where I could give the user a GUI interface to the .excludeListOverrideMtlLast edited by bhh; 21-01-2016, 04:10 PM.
Comment
-
I'm not the best at maxscript but couldn't you simply use a selectbyname dialog to build an array of objects that the user selects and add them to the override list? See below...
Code:vr=renderers.current oldExclList=vr.excludeListOverrideMtl tempExclList=#() currentSel=$ fn geo obj = ( superclassof obj==GeometryClass ) clearSelection() clearNodeSelection redraw:false select vr.excludeListOverrideMtl tempExclList=selectbyname showHidden:false title: "Select Objects for Override Exclusion" filter:geo select currentSel if tempExclList!=undefined then vr.excludeListOverrideMtl = tempExclList ---do your render here--- vr.excludeListOverrideMtl = oldExclList
Last edited by dlparisi; 21-01-2016, 10:59 PM.www.dpict3d.com - "That's a very nice rendering, Dave. I think you've improved a great deal." - HAL9000... At least I have one fan.
Comment
-
Nice post dlparisi! I'm certainly not the best at maxscript either but that selectbyname dialog looks perfect for this application. Thank you for sharing because I wasn't familiar with it. The GUI stuff always seems to cause me the most difficulty.
Edit: So I just spent a little time with the docs and this Dialog suffers from the same issue that the exclusionListDlg() does in that you can not have this dialog open with items pre-selected. Ideally, the interface would open with the vr.excludeListOverrideMtl items pre-selected. I could do this with a dot net list view, for example, where it lists all the objects in a scene and then loops through the vr.excludeListOverrideMtl to "select" those items so the user can edit and manipulate the exclusions and not have to start-over each time they launch the dialog.Last edited by bhh; 22-01-2016, 08:51 AM.
Comment
-
Originally posted by bhh View PostIdeally, the interface would open with the vr.excludeListOverrideMtl items pre-selected. I could do this with a dot net list view, for example, where it lists all the objects in a scene and then loops through the vr.excludeListOverrideMtl to "select" those items so the user can edit and manipulate the exclusions and not have to start-over each time they launch the dialog.www.dpict3d.com - "That's a very nice rendering, Dave. I think you've improved a great deal." - HAL9000... At least I have one fan.
Comment
-
You're right! I completely missed it the first time, the scene I had open didn't have anything stored in that array and I didn't catch what the "select vr.excludeListOverrideMtl" was doing when I skimmed through the code. This is going to work perfectly, thank you so much for following up and helping out! Makes me wonder if there is something similar with the exclusionListDlg() that I haven't found as well.
Thanks again. I really appreciate it.
Comment
-
Great. Glad I could help out.www.dpict3d.com - "That's a very nice rendering, Dave. I think you've improved a great deal." - HAL9000... At least I have one fan.
Comment
Comment