Swap out Material Background colour of particular materials

Hi All,
Some assistance please, is it possible to create a dynamo script to change the background colour of selected materials. See image below for a more detailed explanation. Hope I make sense.

Thanks in advance

Hi @Ensilnj,

Use the Material Set Properties node from the Genius Loci package for this task.

Thanks Alban, I noticed you referencing this package in another post which is a great help.
How would I go about creating the first portion of the script which is selecting a specific material in the project as a user input

Use the Material.ByName node.


Thanks for all your replies, this is how far I got.
The last node inputs are wrong, any advice on what it wants?

The material input expect a material, you give him a string.
And you need to use a dynamo color.
Try this:

To make things easier, please see error message being displayed by node if that helps?
Sorry, total newbie so not sure what its telling me.

Brilliant, no longer any error messages, but after successful run it hasn’t actually changed anything?

Is this the same material?
Try to restart your graph and run again :slight_smile:

Yes, I have made the graph to start with a element selection so it can only be the correct material.

My bad, try this (check code block):

1 Like

Champion!!! Thank you so much!!!

1 Like

Sorry, I have a follow up question if you don’t mind.
I want to create a user input to choose between two colours. How would i go about that?

Maybe an integer input where 0 is and 1 = white for example?

Maybe an integer input where 0 is and 1 = white for example?

Yes that would work, or a true false node