RobynsVeil opened this issue on Jan 24, 2009 · 490 posts
bagginsbill posted Thu, 26 February 2009 at 8:31 AM
Another thing you're doing, but may not realize why you can...
When you construct a node, I let you specify no arguments if you like. In which case, all the parameters are set to their default values.
s = Surface()
As well, you can set them using positional arguments. The first argument is assumed to be the Diffuse_Color. The second is the Diffuse_Value. The third is the Specular_Color, and so on. These are all documented in the node reference.
s = Surface(GREEN, .7, WHITE, .4, .01)
Now when you have a node, such as the Surface node, that has a jillion parameters, it is not fun to have to say all of them just to set the 11th one. So after using any positional arguments, you can then use named arguments.
s = Surface(GREEN, .7, Bump = .03 * Turbulence())
See how I skipped a bunch of parameters and specified the Bump value by name. In the argument list, once you start using named parameters, you cannot go back to position parameters. All the rest have to be named.
Of course you don't have to set any in the constructor. (The "constructor" is that call you make by naming the node you want. It constructs a node as specified.) Once constructed, the object you get back can be further modified as you've seen.
s = Surface(GREEN, .7)
s.Bump = .03 * Turbulence()
Renderosity forum reply notifications are wonky. If I read a follow-up in a thread, but I don't myself reply, then notifications no longer happen AT ALL on that thread. So if I seem to be ignoring a question, that's why. (Updated September 23, 2019)