RobynsVeil opened this issue on Jan 24, 2009 · 490 posts
RobynsVeil posted Wed, 25 February 2009 at 8:24 AM
Quote - > Quote - Understanding the association between math and node set-up should save you having to teaching remedial Poser nodes, so you can get to the exciting stuff, like what all is contained in the Diffuse Channel.
Have you thought about using matmatic in this process? Matmatic is a script that automatically converts math (Python mathematical expressions) to Poser nodes. Quite often, it may help you to see how to do something with nodes. Quite often it will find a simpler way than you realized was possible. And, unlike you using the material room manually, matmatic can take advantage of hyper colors and hypo colors, colors you cannot enter by hand because of how the material room editor is restricting you.
For example, try typing:
Surface(2 * Spots(BLACK, (GREEN + WHITE) / 2) <= 1.5 * Clouds((RED - GREEN + WHITE) / 2, WHITE)
You might be surprised. The nodes are actually more powerful from matmatic than from direct manual manipulation.
The only problem with using it to see how things work is that sometimes it will collapse the nodes (optimize) because they are not needed.
For example, the upper half of that node setup computes (GREEN + WHITE) / 2. However, matmatic would do that directly and produce Color(.5, 1, .5) wherever you were using that expression.
Took your advice, Bill, and have actually written my very first successful Matmatic script. I was looking at existing scripts to get an idea how the whole thing flowed, and kept generating errors about ltype and all that, so I decided to go with as simple as I possibly could, and in a blank text file named BasicsBase01.mm1.txt entered the following line:
Surface()
Compiled. Felt the thrill of accomplishment because this simple thingie didn't generate the errors that :
def makeSurface():
s = Surface(0,0,0)
s.Alternate_Diffuse = SimpleColor(RED)
return s
outputs += makeSurface()
did. Come to find out outputs+= doesn't really apply here. All ya gotta do is call the makeSurface() function by naming it.
So:
def makeSurface():
s = Surface(0,0,0)
s.Alternate_Diffuse = SimpleColor(RED)
return s
makeSurface()
creates this real flash material, where this SimpleColor node with a color value of RED is plugged into the Alternate_Diffuse channel. Yeah, I know, exciting. But hey, it is. Basic math generates nodes, and the assignment operator ( = ) connects them to whatever channel is to the left of that = sign. Oh, and those zeros arguments for Surface? Actually result in black for color and 0 for value for Diffuse_Color/Value, Specular_Color/Value and Ambient_Color/Value.
Now that I have the basic idea of how this works, I can can start making more interesting materials.
Monterey/Mint21.x/Win10 - Blender3.x - PP11.3(cm) - Musescore3.6.2
Wir sind gewohnt, daß die Menschen verhöhnen was sie nicht verstehen
[it is clear that humans have contempt for that which they do not understand]