PapaBlueMarlin opened this issue on Aug 18, 2006 · 87 posts
bagginsbill posted Sun, 20 August 2006 at 5:30 PM
The script I have been working with was a Matmatic one. Can you show what i need to do to turn it into a Parmatic script with these values please?
Let's be clear: A Matmatic script is not a shader. It produces a shader. Parmatic is a script, but it doesn't read scripts. It looks at shaders and creates parameters for them, then keeps the shader in sync with the parameter settings. So your question is invalid - you do not make a Parmatic script - there is no such thing.
However, you do make your shader into a Parmatic one, by doing something very simple in Matmatic.
Rather than give you a full explanation of all the Parmatic trickery, let's just use a very simple scheme that works pretty well.
In your script, wherever you have a number, and you want to make that number be a Parmatic parameter, just wrap it in an adder and label it a special way.
For example, up above we have this statement:
cx = .4
This defines what we're using for the center x value of the bruise algorithm. We can Parmaticize it like this:
cx = Add(.4).labelled("PM:Bruise CX")
What I did there, was I made an Add node, with only one argument, .4. The second argument is 0, and since .4+0 is .4, it doesn't matter. Then I labelled it - that is the magic for Parmatic - the label. If the label begins with "P" "M" and a colon, then that node is important and gets a parameter. Simple isn't it?
Now suppose you wanted to make a granite node with a Parmatic adjustable scale, initially at .25.
First, this is how you'd create the node in Matmatic.
myGranite = Granite(Scale=.25)
Now we Parmaticize the .25
myGranite = Granite(Scale=Add(.25).labelled("PM:Granite Scale"))
Get it?
I don't have to do it in one line: I can do it in two steps for easier reading:
graniteScale = Add(.25).labelled("PM:Granite Scale")
myGranite = Granite(Scale = graniteScale)
Or yet another way:
graniteScale = Add(.25)
graniteScale.label = "PM:Granite Scale"
myGranite = Granite(Scale = graniteScale)
Lots of options - pick the style you like.
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)