Author Topic: Overide Material shortcut  (Read 2490 times)

2016-05-10, 19:23:22

Alexandre SCELLIER

  • Active Users
  • **
  • Posts: 31
    • View Profile
    • www.alexandre-scellier.fr
Hi,
Is it possible to use a macroscript, via a shortcut or within the toolbar, to exclude objects from the overide material ? In this case, could you share it ?
I use it a lot in my worflow and it's pretty borring having to open the render setting window every time so :)

Thx.

2020-03-12, 12:55:18
Reply #1

SandrineC

  • Active Users
  • **
  • Posts: 21
    • View Profile
Same request :)
Maybe just the maxscript command will be nice to make it

Thx.

2020-03-12, 13:44:55
Reply #2

Jpjapers

  • Active Users
  • **
  • Posts: 1650
    • View Profile
You can list all available endpoints with

Code: [Select]
show renderers.current
The ones concerning mtlOverrides are

Code: [Select]
.mtlOverride_enabled (main_mtlOverrideEnabled) : boolean
  .mtlOverride_includeMode (main_mtlOverrideIncludeMode) : boolean
 .mtlOverride_preserveDisplacement (main_mtlOverridePreservesDisplacement) : boolean
.mtlOverride (main_mtlOverride) : material
  .mtlOverride_preserveLightMtl (main_mtlOverridePreservesLightMtl) : boolean
  .mtlOverride_preservePortalMtl (main_mtlOverridePreservesPortalMtl) : boolean
  .mtlOverride_preserveUnsupportedMtl (main_mtlOverridePreservesUnsupportedMtl) : boolean
  .mtlOverride_preserveGlassMtl (main_mtlOverridePreservesGlassMtl) : boolean
.overrideMtl_exclude (main_mtlOverrideExclude) : node array

2020-03-16, 21:46:54
Reply #3

Mr.Max

  • Active Users
  • **
  • Posts: 76
    • View Profile
it's tricky to do but David from DPict  wrote a script for that years back for V-Ray .
So I did use the same workaround and wrote this one that works with Corona .
run the script then add shortcut/button to it ,you can find it under dPict Tools category.

Code: [Select]
macroScript AddToOverrideExclCorona
category:"dPict Tools"
tooltip:"Add to Override Exclude List Corona "
(
vr=renderers.current
newExclList=vr.overrideMtl_exclude

--cleanup existing exclusion list for undefined
for i = newExclList.count to 1 by -1 do
(
if newExclList[i] ==undefined then
(
deleteItem newExclList i
)
)
if selection.count>0 then
(
For o in selection where superClassOf o == geometryClass do
(
if (findItem newExclList o)==0 then
(
append newExclList o
)

)
vr.overrideMtl_exclude= newExclList
)
else
messageBox "Nothing Selected"
)
Simply, I love to put pixels together! Sounds easy right : ))
https://www.behance.net/NawrasRyhan