I want to call up the function of the ‘+’ in the render dialog for use in a script so that is has the same function of that in the render dialog. See attached the button I refer to.
What’s the best way to go about this? Thanks.
I’ve tried renderers.current.mtlOverride_includeMode
But this is only a boolean and comes back as only true or false.
for i in selection do appendifunique renderers.current.overrideMtl_exclude i
renderers.current.overrideMtl_exclude is simply an array and you can add and remove items from it
Thanks very mucho, it’s easy when you know how. Now, I’m trying to create the code to rightclick the button to remove it from the array. I’ve tried mulitple things but I think this is the closest I’ve gotten.
on btn_matoverrideexclude rightclick do
(
for i in selection do deleteItem renderers.current.overrideMtl_exclude i
)
But the error is: -- Runtime error: array index must be positive number, got: $Box:Box003 @ [809.705383,50.000000,264.243652]
You have to find the right index of the object first. You can’t simply delete the node, you have to delete the node by index (that’s also what the error message tells you). I hope you already downloaded the .chm version of the maxscript documentation If not, do it now - it’s all you need
for i in selection do(
arr = renderers.current.overrideMtl_exclude
id = findItem arr i
if id != 0 then (
deleteItem arr id
)
)