All posts related to V2
By jimminy
#358735
Is there any way to batch change a particular setting in an MXM for all the materials in, say, a folder or directory?

At the moment I want to change the Shadow setting in the Materials Properties for all the materials in a particular folder (from disabled to enabled) and presently I have to open each of about 200 MXMs and change it manually if I want to do this.

Seems like it would be a pretty straightforward script for someone who knows how to do that kind of thing.
User avatar
By Mihai
#358741
Right now the only way would be to write a Python script, and we should probably release a few useful scripts like this. But in your case, not sure why you want to do this for so many materials? Usually you just need it for one, for example the floor so it catches shadows. Or, you could temporarily apply one material to all the objects you want to catch shadows and turn on the shadow from it, then render a shadow pass.
By jimminy
#358743
Hmmm, good question. maybe I'm doing it wrong, but if I want to render and have a shadow pass channel going at the same time, don't I need all the materials to have the shadow option enabled?

Without it, I think I just get white. Maybe you are saying the better way to go is to do it as a separate render, which I can see would work. What would be the benefit?

Usually I'm doing this for an exterior building rendering and it's nice to have some control of the shadows. So I will have many materials and all of them would be receiving shadows.
User avatar
By Mihai
#358744
Well, just in this case so you don't have to switch on/off shadows in 200 materials. But even if you had this possibility, having a shadow pass doesn't mean the main render won't get any shadows 'built-in' to the render. So you can only add more to certain shadows if you want, but not take away. But in my opinion it's a great way to have a weird unrealistic render if you're just controlling the shadows. Instead it would be better to add some well placed lights to make it more interesting.
By jimminy
#358783
So if I understand you, I would render my scene as usual without a shadow pass, then do a separate rendering using an override material, shadows enabled on the override MXM, rendering just the shadow channel.

Makes sense, I'll have to try it out on my next renders. Does it also make more sense to do material IDs the same way then? I noticed my last renders that had shadow pass and material ID pass enabled took a very long time to get to a decent SL.
User avatar
By Mihai
#358785
The shadow pass will add the most time, material ID should render pretty fast and not slow down the main render too much. I don't think it's necessary to do this for the MatID channel, each material gets its own color by default.
By jimminy
#358794
Now that you mention it, it seems that a lot of my materials have a material ID that's exactly the same grey color, which causes me to have to change each material's ID one by one, much as I was saying I had to do with the shadow option.

Of course, this is more than just being able to batch enable/disable an option, this would be batch randomizing the material ID color, which seems more complicated.

I guess no matter what stuck making some change to multiple MXMs, one by one, each time I set up a new render, unless I go and change them in the library, and that means doing it hundreds of times before it's finally fixed.

Thanks Mihai for the help with the shadow pass though.
Help with swimming pool water

I think you posted a while back that its best to u[…]

Sketchup 2026 Released

Considering how long a version for Sketchup 2025 t[…]

Greetings, One of my users with Sketchup 2025 (25[…]

Maxwell Rhino 5.2.6.8 plugin with macOS Tahoe 26

Good morning everyone, I’d like to know if t[…]