How to modify the materials used in this animation blend file?

Solved

Hi all! I'm a blender noob who wants to try all the shiny things. In this quest I have encountered this really neat repository (more specifically, ca-demo.blend) that uses blender to render 3D cellular automata.

I've been playing with it for a while now but I can't seem to change the materials used in the rendering/animation. I'm not really sure if material is the right word or if I'm confusing it with texture actually, but I'm going to refer to it as material. The general appearance of an object post-rendering.

I have noticed that each object has a name with a number prefix between 1 and 4, but every object has it's own material, which is confusing. I'm not seeing anything in the scripting workspace that leads me to believe it's done programatically, so I assume it's a setting but I've thoroughly searched all the UI buttons and didn't find anything. I tried changing the materials on single objects to see if they all change with it, but that also didn't happen.

Can anyone help this newbie out?

Posted Dec 26, 2021, 6:16 PM UTC

118
b_a_t_m_4_n•

I suggest doing some tutorials on Blender materials and UV mapping. This is a fundamental part of 3D and is not going to be explainable in a few paragraphs of reddit post.

2
_NexorOP•

Not sure why you were downvoted, thank you for your answer. Can you suggest a tutorial or series for version 3.0?

1
b_a_t_m_4_n•

This is an introduction to materials

This is another good one

This is a good intro to UV maps

These should at least get you to where you can ask the right questions.

2
_NexorOP•

I think the links didn't go through

1
b_a_t_m_4_n•
2
kuboa•

If you select the very first object, you'll see that it has a material called "Material", and if you look at that in the Shader Editor you'll see that it's that material that's coloring everything in the animation. You can change the three colors using the ColorRamp there. How it's using only that single material for all the others even though they have their own materials, I don't know actually.

2
kuboa•

How it's using only that single material for all the others even though they have their own materials, I don't know actually.

They're using the method here: https://blender.stackexchange.com/questions/79665/can-i-use-objects-custom-properties-inside-cycles-materials/93621#93621 employing custom properties of the objects.

2
_NexorOP•

Mine looks kinda different. Are you using version 3.0? Why is there no mention to color or material on these custom properties?

1
_NexorOP•

Nice! You managed to change the materials, right? How did you do it exactly? I don't understand how there can be only one Material Output on the Shader Editor though. Aren't there supposed to be more since there are more on the rendering? Also, on your screenshot the material is called "Material" but on mine it's called "Default OBJ" and I don't see as many cards as you in the Shader Editor... Also when I change its color, nothing happens on the render.

1
kuboa•

Ah, sorry, the "Material" material is not actually assigned to any object in the scene, I did that but then forgot I did it! Here's a screenshot where I tried to point out most of the things you need to look at to understand the structure of the file: https://i.imgur.com/ZBwbMjs.png

If you open a Text Editor, and click the browse button in the top middle, you'll see there are two texts saved in the blend file. One is just a log file, the other is the python script that's doing all the work. Even though "Material" is not assigned to any object, the script is overriding the "Default OBJ.xxx" materials according to some rules, using the index numbers "Material" is getting from the Object Info node, and a custom property added to all the objects ^(my screenshot has extra properties there called hops, kitops etc, those come from my installed addons, ignore them, only "iteration" and "xplane" matter here). You can look at "Material" simply by selecting an object in the viewport and assigning it from the browser in the top middle of the Shader Editor. Doesn't matter what material you assign to whichever object, since the script is overriding them anyways. Then you can change the color from the ColorRamp node.

How exactly the interaction happens between the script, the object index numbers and the custom properties is the advanced part I'm not equipped to understand and explain, maybe you can do that? :) It was still fun to figure out this much though.

2
_NexorOP•

Thank you for the detailed answer! Hopefully I'll get it to work and report back soon

1
_NexorOP•

By the way, did you add those cards with the color and stuff to the Shader Editor? I don't see them in mine

1
kuboa•

What do you mean by "cards"? Do you mean the colors in ColorRamp? You click the little tabs then the color bar below.

1