PapaBlueMarlin opened this issue on Aug 18, 2006 · 87 posts
PapaBlueMarlin posted Fri, 18 August 2006 at 5:55 PM
Is there a way to use the materials room to make a figure appear bruised or beaten?
jonthecelt posted Fri, 18 August 2006 at 6:48 PM
Ok, so I'm not bagginsbill, but thought I'd offer an opinion here.
To my mind, bruising is something better left to a texture map, rather than procedural node-work. Why? Well, because (haveing recently injured myself in a bike accident and got the evidence to back it up) bruising tends to happen in specific places, at the points of contact. For example, I've had a bruise on my left knee for a week and a half now wwith an unharmed area in the centre, based on something (I don't know what, exactly) which protected that section. Bruising can also take the shape of the specific object which left the mark - the assailant's fist, for example. Thse specific shapes and locations for the damage would, I think, prove beyond the capabilities of a node-based solution.
Of course, I now look forward to bagginsbill to come along and tell me I'm wrong... : :)
jonthecelt
Dead_Reckoning posted Fri, 18 August 2006 at 7:02 PM
Quote - Ok, so I'm not bagginsbill, but thought I'd offer an opinion here.
To my mind, bruising is something better left to a texture map, rather than procedural node-work. Why? Well, because (haveing recently injured myself in a bike accident and got the evidence to back it up) bruising tends to happen in specific places, at the points of contact. For example, I've had a bruise on my left knee for a week and a half now wwith an unharmed area in the centre, based on something (I don't know what, exactly) which protected that section. Bruising can also take the shape of the specific object which left the mark - the assailant's fist, for example. Thse specific shapes and locations for the damage would, I think, prove beyond the capabilities of a node-based solution.
Of course, I now look forward to bagginsbill to come along and tell me I'm wrong... : :)
jonthecelt
This is a section from Bagginsbill's wonderful Jessi Eye Makeup Parmatic file at rdna Forum.
I'm no expert, but it looks like you can map the location in the script. It was setup for the eye, but I'm guessing some of the wizards here could rework it for various other parts.
Cheers
DR
def JessiEyeMakeup(surface, opacity = .3, mclr1 = Color(.5, 0, 1), mclr2 = Color(.7, .5, 1)):
# I'm taking advantage of the perfect symmetry of the texture mapping
# so I can let x be the distance from the center of the image map.
x = Abs(U - .5)
# These two x values define the limits of the eye part of the map
# in the x (U) dimension.
x0 = .026
x1 = .095
# Now I'm scaling that range to be from 0 to 1. So x=0 is
# at the beginning of the lacrimal, and x=1 is at the outermost
# edge of the eyebrow.
x = Scale(x, x0, x1)
# For y (V), the limits of the region of interest are given by
# y0 and y1.
y = V
y0 = .485
y1 = .55
# Scaling y to those limits, y = 0 is at the lacrimal, and
# y = 1 is just under the peak of the eyebrow.
y = Scale(y, y0, y1)
# Now I compute two curves, y0 traces the upper eyelid
# and y1 traces the bottom of the eyebrow.
y0 = Interpolate(x, ['ibias', .6, 0, .37, .43, .45, .38, .2, .18])
y1 = Interpolate(x, ['ibias', .6, .2, .65, .8, .9, 1, .9, .5])
# Scaling between eyelid and eyebrow gives me a y factor that
# varies from 0 to 1. When yf=0, I'm at the eyelid, when yf=1,
# I'm at the eyebrow.
yf = Scale(y, y0, y1)
# This calculation of blendf gives me a varying strength of the
# eye makeup. I'm making it start strong near the eyelashes,
# then fading to 0 as we approach the eyebrow.
blendf = Interpolate(yf, [0,.9, 1, .8, .4, 0])
# Retrieve the base color - I'm assuming it's in the Alternate_Diffuse
# attribute, as used in demoSkin1 below.
baseclr = surface.Alternate_Diffuse
# Calculate the diffuse reflection from the makeup, blending the
# colors passed in to this function using the gradient from eyelid
# to eyebrow which is in yf.
blendclr = Diffuse(HSV(Blend(mclr1, mclr2, yf)).labelled('PM:EyeMakeup:*'))
# Now just combine the base with the makeup, using the
# specified opacity and the blendfactor computed above.
f = blendf * InRange(x, 0, 1)
f = (opacity * f)
surface.Alternate_Diffuse = Blend(baseclr, blendclr, f).labelled('PM:EyeMakeup:Blending')
# Return the now modified surface.
return surface
It can then be controlled with the Parnatic Dials.
"That government is
best which governs the least, because its people discipline
themselves."
Thomas Jefferson
bagginsbill posted Sat, 19 August 2006 at 7:56 AM
Attached Link: My gallery posting of Jessi with makeup algorithm
Mariner is spot on.If you want bruises everywhere, I think it would be pretty easy to do - very similar to the freckles algorithm. But this is usually not what you want, right?
Most people don't don't think in terms of 150 shader nodes, so it's easy to conclude you can't make precisely positioned shapes with shader nodes. But you can, and that is why I wrote Matmatic. 50 nodes, 100 nodes, no big deal, it's still two or three lines of code.
If you want precisely positioned bruises (or makeup, or scars) these can be done using a mathematically defined region, bounded by two interpolations. This is what I did to put Jessi's eye makeup exactly where I want it.
Here's the technique I used. I put Jessi's texture on the one-sided square. That's right, the OSS. Why? Because the geometry has nothing to do with the algorithm. It only cares about UV coordinates. The OSS let's me clearly see where on the texture map I'm making an effect. Also, the OSS renders really fast.
So develop the coordinates for your region of interest on the OSS, iteratively changing the values and rendering to see where the region ends up.
When you're done, apply the material to your figure instead.
Do you guys think this is long enough for Beta on Matmatic? Most people seem to think its working right, but I haven't seen anybody else post an original Matmatic material. So as far as I know, everybody is just using my demos. Which concerns me because I tend not to use certain nodes, and they could be buggy. Opinions?
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)
Dead_Reckoning posted Sat, 19 August 2006 at 9:16 AM
Quote - Do you guys think this is long enough for Beta on Matmatic? Most people seem to think its working right, but I haven't seen anybody else post an original Matmatic material. So as far as I know, everybody is just using my demos. Which concerns me because I tend not to use certain nodes, and they could be buggy. Opinions?
I would love to be able to write one of my own Bagginsbill. I am just not up on what the P6 Nodes would look like in Text Code strings as in your examples.
I could also use a Parmatic mm1.txt like your Jessi Eye Makeup one, but without the eye makeup for James ???????
Could you show and example of James with bruise on the Cheek? or some other location? I can wrap my head around the co-ordinates, not necessarily the OSS Technique.
Cheers
DR
Here is a Parmatic Jessi Render.
http://excalibur.renderosity.com/mod/gallery/index.php?image_id=1274079&member
"That government is
best which governs the least, because its people discipline
themselves."
Thomas Jefferson
Tyger_purr posted Sat, 19 August 2006 at 10:29 AM
Quote - Do you guys think this is long enough for Beta on Matmatic? Most people seem to think its working right, but I haven't seen anybody else post an original Matmatic material. So as far as I know, everybody is just using my demos. Which concerns me because I tend not to use certain nodes, and they could be buggy. Opinions?
I tried matmatic once, but never got it to work but i think it was me.... I'll need to go back and try again when i have more time.
My Homepage - Free stuff and Galleries
bagginsbill posted Sat, 19 August 2006 at 2:11 PM
In the next six postings, I'll show you the Matmatic script and what it produced.
In each iteration, I changed some things, but I'm presenting the whole script, so you can work through the steps yourself if you like.
I defined no functions, loops, or ifs, so indentation is not a problem. Cut and paste should work.
I started with the premise that a round bruise would not work, but in the end it looks fine to me. If you can't do an interpolation and want me to explicitly reshape the bruise for you, I can. Make a copy of the final image here, and draw an outline of roughly where you want the bruise, then I'll do the interpolation function.
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)
bagginsbill posted Sat, 19 August 2006 at 2:12 PM
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)
bagginsbill posted Sat, 19 August 2006 at 2:12 PM
clr = ImageMap(":Runtime:Textures:Poser 6 Textures:James_Face_Color.jpg")
s = Surface(clr, 1, 1, .2, .5)
bruiseclr = Color(.5, .2, .7)
cx = .4
cy = .45
x = U - cx
y = V - cy
r = sqrt(x * x + y * y)
br = .1
bruiseblender = Scale(r, br, br / 2)
#Finally I simpley blend the original Diffuse_Color (from above) with the bruise color
#using the bruiseblender I just calculated.
s.Diffuse_Color = Blend(s.Diffuse_Color, bruiseclr, bruiseblender)
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)
bagginsbill posted Sat, 19 August 2006 at 2:13 PM
clr = ImageMap(":Runtime:Textures:Poser 6 Textures:James_Face_Color.jpg")
s = Surface(clr, 1, 1, .2, .5)
bruiseclr = Color(.5, .3, .6)
cx = .4
cy = .5
x = U - cx
y = V - cy
r = sqrt(x * x + y * y)
br = .06
bruiseblender = Scale(r, br, br / 2)
#Finally I simpley blend the original Diffuse_Color (from above) with the bruise color
#using the bruiseblender I just calculated.
s.Diffuse_Color = Blend(s.Diffuse_Color, bruiseclr, bruiseblender)
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)
bagginsbill posted Sat, 19 August 2006 at 2:13 PM
clr = ImageMap(":Runtime:Textures:Poser 6 Textures:James_Face_Color.jpg")
s = Surface(clr, 1, 1, .2, .5)
bruiseclr = Color(.5, .3, .6)
cx = .4
cy = .55
x = U - cx
y = V - cy
r = sqrt(x * x + y * y)
br = .06
maxblend = .7
bruiseblender = maxblend * Scale(r, br, br / 2)
#Finally I simpley blend the original Diffuse_Color (from above) with the bruise color
#using the bruiseblender I just calculated.
s.Diffuse_Color = Blend(s.Diffuse_Color, bruiseclr, bruiseblender)
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)
bagginsbill posted Sat, 19 August 2006 at 2:14 PM
clr = ImageMap(":Runtime:Textures:Poser 6 Textures:James_Face_Color.jpg")
s = Surface(clr, 1, 1, .2, .5)
bruiseclr = Color(.5, .3, .6)
cx = .4
cy = .525
x = U - cx
y = V - cy
r = sqrt(x * x + y * y)
br = .07
maxblend = .4
bruiseblender = maxblend * Scale(r, br, br / 2)
#Finally I simply blend the original Diffuse_Color (from above) with the bruise color
#using the bruiseblender I just calculated.
s.Diffuse_Color = Blend(s.Diffuse_Color, bruiseclr, bruiseblender)
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)
bagginsbill posted Sat, 19 August 2006 at 2:14 PM
clr = ImageMap(":Runtime:Textures:Poser 6 Textures:James_Face_Color.jpg")
s = Surface(clr, 1, 1, .2, .5)
cx = .4
cy = .525
x = U - cx
y = V - cy
r = sqrt(x * x + y * y)
br = .07
bruiseclr = ColorRamp(
IColor(90, 44, 112),
IColor(90, 56, 113),
IColor(90,70, 153),
IColor(90, 41, 154),
Scale(r, 0, br)
)
maxblend = .3
bruiseblender = maxblend * Scale(r, br, br / 2)
#Finally I simply blend the original Diffuse_Color (from above) with the bruise color
#using the bruiseblender I just calculated.
s.Diffuse_Color = Blend(s.Diffuse_Color, bruiseclr, bruiseblender)
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)
bagginsbill posted Sat, 19 August 2006 at 2:22 PM
In the end it's only 12 nodes.
One pretty easy way to adjust the shape of the bruise is to make multiple bruise blenders. Use other cy, cy, br values. Then you'd combine two bruises to make a new poly-bruise by combining their blender functions. One for the color, one for the final blend.
I'd combine them using the Min function. In otherwords, your "r' value would be the minimum "r" with respect to all your cx, cy, br coordinates.
If that's not clear, I can post an example.
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)
bagginsbill posted Sat, 19 August 2006 at 2:29 PM
For example, here I made the bruise 2 times wider than before. I did it by making the following change in the script
x = (U - cx) / 2
To make it 3 times wider do:
x = (U - cx) / 3
To make it 12 times taller do:
y = (V - cy) / 12
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)
tekn0m0nk posted Sat, 19 August 2006 at 3:29 PM
Wouldnt it be easier to just paint it in PS ? Or you could just paint a bruise image and layer it onto the skin map using nodes. Would look more real too i bet...
bagginsbill posted Sat, 19 August 2006 at 4:42 PM
Define "easier". I did the whole 6 step tutorial, including writing all the comments, saving multiple versions of the script, and generating and saving a bunch of test renders, in exactly 30 minutes.
If I wasn't making a step-by-step tutorial, it would have taken no more than 5 minutes.
Now how quick can you paint a bruise then test it in a render? Then change your mind about the colors, size, position, several times. I can't do it in 5 minutes.
Another thing is, if you want a bruise on one of the seams, like the back, you're in for a treat trying to paint that. You actually have to paint two separate bruises and get them to line up.
Painting a bruise separately, then blending with nodes, that seems more reasonable. But I still couldn't do it faster than I did.
The thing you have to remember, is that the algorithms are reusable. You really can't judge the effort of creating the algorithm versus painting one bruise. Instead, imagine you are doing a movie. The director tells you to produce 30 different bruises on 5 characters, The story spans enough time that the bruises have to evolve, changing colors and fading as five movie "days" go by. That's 150 different bruise images. But if you have an algorithmic way to make them, then you just call it with new parameters.
I agree that I didn't make it look realistic, but I was only trying to demonstrate the possibilities, as requested. Given enough time, a very realistic reusable bruise generator is totally possible.
Finding the algorithms can be tricky, but once they are defined, using them is really easier than painting ANYTHING. For example, I recently was asked how to make reptile and goldfish scales. I spent two hours on the algorithm. Now people can have scales of any size, any color, any shape, any orientation, in seconds.
Check out these images by me and others using the scales. With a painted image they'd all be the same. With the procedural approach, no two are alike.
http://www.renderosity.com/mod/gallery/index.php?image_id=1274107
http://www.renderosity.com/mod/gallery/index.php?image_id=1266453
http://www.renderosity.com/mod/gallery/index.php?image_id=1254884
http://excalibur.renderosity.com/mod/gallery/index.php?image_id=1264358
http://www.poserclub.jp/ph_view2.htm?ph_no=2010&phid=1154574595
http://www.runtimedna.com/mod/forum/messages.php?forum_id=43&ShowMessage=233907There's lots more, all using the same one-page script, but you get the point.
My point is, I think algorithmic shaders give so much more variety and are much more useful than image based shaders. Sure, there are times when the image based shader is the only way to go, but not always. So I always encourage their use.
I think maybe the "hobbyist" market, which seems to be mostly what Poser caters to, doesn't care that much about saving a lot of time. Maybe I should be peddling my "medicine" to the pros? :) LOL
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)
Fazzel posted Sat, 19 August 2006 at 5:43 PM
Plus with procedurals you don't clutter up your hard drive with a bunch of jpeg files.
Now big drives are getting cheaper, but you still have to wade through that mess
to find the one you are looking for, and if it's been a few weeks since you used
it last it's even harder to remember where you put it.
Dead_Reckoning posted Sat, 19 August 2006 at 6:02 PM
As always, Thank you very much for all of your expertise and sacricing your time to explain this all to us. As a mariner, I am fairly certain that i know how to interpolate and comprehend coordinates.
I agree with you 100%. I like the idea of scripting to do the bulk of it for me. As you mention, it really is quick and easy to change values for a new look. I tend to enjoy what the program can do on it's own, without doing Post Work. I rarely ever do any Post Work. I would rather go back into poser and see what i can do to improve the final render. For me Matmatic and parmatic make that sooo much easier now.
Cheers
DR
Quote - Define "easier". I did the whole 6 step tutorial, including writing all the comments, saving multiple versions of the script, and generating and saving a bunch of test renders, in exactly 30 minutes.
If I wasn't making a step-by-step tutorial, it would have taken no more than 5 minutes.
Now how quick can you paint a bruise then test it in a render? Then change your mind about the colors, size, position, several times. I can't do it in 5 minutes.
Another thing is, if you want a bruise on one of the seams, like the back, you're in for a treat trying to paint that. You actually have to paint two separate bruises and get them to line up.
Painting a bruise separately, then blending with nodes, that seems more reasonable. But I still couldn't do it faster than I did.
The thing you have to remember, is that the algorithms are reusable. You really can't judge the effort of creating the algorithm versus painting one bruise. Instead, imagine you are doing a movie. The director tells you to produce 30 different bruises on 5 characters, The story spans enough time that the bruises have to evolve, changing colors and fading as five movie "days" go by. That's 150 different bruise images. But if you have an algorithmic way to make them, then you just call it with new parameters.
I agree that I didn't make it look realistic, but I was only trying to demonstrate the possibilities, as requested. Given enough time, a very realistic reusable bruise generator is totally possible.
Finding the algorithms can be tricky, but once they are defined, using them is really easier than painting ANYTHING. For example, I recently was asked how to make reptile and goldfish scales. I spent two hours on the algorithm. Now people can have scales of any size, any color, any shape, any orientation, in seconds.
Check out these images by me and others using the scales. With a painted image they'd all be the same. With the procedural approach, no two are alike.
http://www.renderosity.com/mod/gallery/index.php?image_id=1274107
http://www.renderosity.com/mod/gallery/index.php?image_id=1266453
http://www.renderosity.com/mod/gallery/index.php?image_id=1254884
http://excalibur.renderosity.com/mod/gallery/index.php?image_id=1264358
http://www.poserclub.jp/ph_view2.htm?ph_no=2010&phid=1154574595
http://www.runtimedna.com/mod/forum/messages.php?forum_id=43&ShowMessage=233907There's lots more, all using the same one-page script, but you get the point.
My point is, I think algorithmic shaders give so much more variety and are much more useful than image based shaders. Sure, there are times when the image based shader is the only way to go, but not always. So I always encourage their use.
I think maybe the "hobbyist" market, which seems to be mostly what Poser caters to, doesn't care that much about saving a lot of time. Maybe I should be peddling my "medicine" to the pros? :) LOL
"That government is
best which governs the least, because its people discipline
themselves."
Thomas Jefferson
Dead_Reckoning posted Sat, 19 August 2006 at 7:15 PM
Could post the Full JamesBruise.mm1.txt Parmatic Script please?
I know I will muck it up somewhere with the Cut and Paste.
This has been very helpful in understanding what you have done here.
Thanks again.
DR
Quote - OK I just went through the process of making a cheek bruise for James. Here's the final render. Now I'll show you how I got there.
In the next six postings, I'll show you the Matmatic script and what it produced.
In each iteration, I changed some things, but I'm presenting the whole script, so you can work through the steps yourself if you like.
I defined no functions, loops, or ifs, so indentation is not a problem. Cut and paste should work.
I started with the premise that a round bruise would not work, but in the end it looks fine to me. If you can't do an interpolation and want me to explicitly reshape the bruise for you, I can. Make a copy of the final image here, and draw an outline of roughly where you want the bruise, then I'll do the interpolation function.
"That government is
best which governs the least, because its people discipline
themselves."
Thomas Jefferson
bagginsbill posted Sat, 19 August 2006 at 9:19 PM
Unfortunately - renderosity will not let me post a text file.
Why the f**k this is not allowed - I have no idea.
The programmers here are really strange.
I say this with authority, as I am a professional programmer..
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)
bagginsbill posted Sat, 19 August 2006 at 9:21 PM
Just cut and paste - there are no tabs in this one.
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)
nruddock posted Sun, 20 August 2006 at 5:28 AM
Change the extension to DOC and then attach.
(Maybe add a comment to this thread -> http://www.renderosity.com/mod/forumpro/showthread.php?thread_id=2661596)
Dead_Reckoning posted Sun, 20 August 2006 at 6:25 AM
Couldn't have been Easier. Thanks again Bagginsbill.
Could you maybe post a Parmatic Version at RDNA?
Please, If you would , I would like to see a Parmatic one for James such as the JessiEyeMakeUp.mm1.txt that has SSS and uses this Bruise instead of her eye makeup.
I haven't figured out How to hack that one for James.
Also, it looks like I now have to get the body texture to match the Bruise Head texture.
Cheers
DR
"That government is
best which governs the least, because its people discipline
themselves."
Thomas Jefferson
Dead_Reckoning posted Sun, 20 August 2006 at 6:27 AM
Did I make any mistakes, or is this the way it should run?
Thanks
DR
"That government is
best which governs the least, because its people discipline
themselves."
Thomas Jefferson
Dead_Reckoning posted Sun, 20 August 2006 at 6:56 AM
I really like this one Bagginsbill.
I used Blender and added a Granite Node. Left the color dark just to display better.
Cheers
DR
"That government is
best which governs the least, because its people discipline
themselves."
Thomas Jefferson
bagginsbill posted Sun, 20 August 2006 at 7:09 AM
Dude you're cracking me up. ;-) Did you have coffee yet this morning? LOL
It says:
Processing script ....JamesBruise.mm1.txt->material
-> node count 12
So that was fine - worked perfectly. There is nothing wrong with your bruise script.
Then it says:
Processing script ....SeaWaterMAT.mm1.txt->material
MATMATIC Script Error: expected an indented block (line 21)
So, I'm just guessing here, but I'd have to say that your sea water file is bad and an indented block is expected on line 21, and it is not indented because it got lost in a cut and paste.
Next time you want to post the Matmatic output for me, just cut and paste the text - no screen shot image needed.
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)
bagginsbill posted Sun, 20 August 2006 at 7:12 AM
Yeah that's a great looking bruise DR.
You've got the idea - once the basic algorithm is in place, then you vamp on the colors to your hearts content.
Post your script code for the bruise pattern - get used to sharing like that. Also, I can spot things for you and point out other ways to say/do it. You don't need to post the whole script. just show me the part you are experimenting with.
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)
bagginsbill posted Sun, 20 August 2006 at 7:28 AM
maxblend = .5
bruiseblender = maxblend * Scale(r, br, br / 2)
bruiseblender = bruiseblender * Marble3(.5, 1, scale=.5)
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)
Dead_Reckoning posted Sun, 20 August 2006 at 8:36 AM
Quote - Dude you're cracking me up. ;-) Did you have coffee yet this morning? LOL
Next time you want to post the Matmatic output for me, just cut and paste the text - no screen shot image needed.
ROFL - Noooo, I am certain that i haven't had enough Caffeine today.
Thanks, I keep forgetting to use the Keystrokes for cut & paste on that. The mouse doesn't work.
Cheers
DR
"That government is
best which governs the least, because its people discipline
themselves."
Thomas Jefferson
Dead_Reckoning posted Sun, 20 August 2006 at 8:46 AM
Post your script code for the bruise pattern - get used to sharing like that. Also, I can spot things for you and point out other ways to say/do it. You don't need to post the whole script. just show me the part you are experimenting with.
[ /quote]
I would love to share the script BB, what I did was add the Blender in the Mat Room.
Could you do a short section on "adding the second Blender and then how to combine in the final output please???? Thanks
Ps: My Forte is sailing large merchant ships around the world. Poser is my addiction when I am home on vacation.
DR
"That government is
best which governs the least, because its people discipline
themselves."
Thomas Jefferson
Dead_Reckoning posted Sun, 20 August 2006 at 9:10 AM
maxblend = .5
bruiseblender = maxblend * Scale(r, br, br / 2)
bruiseblender = bruiseblender * Marble3(.5, 1, scale=.5)
Post your script code for the bruise pattern - get used to sharing like that. Also, I can spot things for you and point out other ways to say/do it. You don't need to post the whole script. just show me the part you are experimenting with.
===========================================
I would love to BB, still not cetain How to write that part?
Would it be something like your latest example:
maxblend = .5
bruiseblender = maxblend * Scale(r, br, br / 2)
bruiseblender = bruiseblender * Granite3(.5, 1, scale=.5)
This looks fantasic, I could see this done on the nose as a Heavy Drinker with years of consumption.
Maybe on the hand, leg, ankles etc as vericose veins.
I will have to go back and find the Seawater script and save as, Tks
Cheers
DR
"That government is
best which governs the least, because its people discipline
themselves."
Thomas Jefferson
Dead_Reckoning posted Sun, 20 August 2006 at 10:22 AM
In reading through the Matmatic Extras, I see that you explain How you did the Marble and Wood.
Would it be possinlt to put together the Statements to use the 3D Nodes please?
I think if I new How to insert the Various Nodes Statements that i could certainly experiment away after that.
I tried substituting Granit, but got and err because I hadn't defined Granit
Cheers
DR
"That government is
best which governs the least, because its people discipline
themselves."
Thomas Jefferson
tekn0m0nk posted Sun, 20 August 2006 at 11:20 AM
Quote - Now how quick can you paint a bruise then test it in a render? Then change your mind about the colors, size, position, several times. I can't do it in 5 minutes.
Another thing is, if you want a bruise on one of the seams, like the back, you're in for a treat trying to paint that. You actually have to paint two separate bruises and get them to line up.
I think you are kinda underestimating just how powerful texture painting tools are these days.
Quote - I think maybe the "hobbyist" market, which seems to be mostly what Poser caters to, doesn't care that much about saving a lot of time. Maybe I should be peddling my "medicine" to the pros? :) LOL
Well im not exactly sure how using procedurals makes anyone more of a 'pro'. Just because Poser didnt get a material system till recently doesnt make the technology cutting edge or anything. Quite the opposite in fact... most other apps have had them for so long that their use has become a cliche. Heck back when you didnt have texture mapping the only thing people used were procedurals. What you are doing here is exactly what they did in the 80s and early 90s (which might be fine for a retro look of course.) Try looking at some of the old CG shorts by Pixar and others and you will see what i mean.
bagginsbill posted Sun, 20 August 2006 at 11:43 AM
Tekn0m0nk:
I'm not underestimating texture painting tools - I know there are some that make painting across seams trivial and so on, like ZBrush, Modo, and others. Most Poser users don't have those - they're expensive tools. Even if you have them, I've actually tried painting with ZBrush and I can't do it. The results are always horrible. I can't paint.
Quote: Well im not exactly sure how using procedurals makes anyone more of a 'pro'.
I'm glad you're not sure of that becuase 1) it's wrong and 2) I never said that. I didn't offer a definition of professional, I simply used the word "pros". And by that, I meant people who do computer generated imagery for a living, not a hobby. For those people, time is money, and saving time means making more money. That's all I meant, it was an offhand comment that hobbyists aren't generally going to need time saving techniques because the purpose of a hobby is to spend your time doing something you like doing. When a CG pro paints a texture, it isn't because he/she enjoys it, it's because it is the best way to get results in the time available. If a procedural method is faster and just as good, then they use it.
Anyway if you have those tools, which I don't, and can paint well, which I can't, and you like making things one at a time, go ahead and paint.
My hobby is not painting. It's not even rendering. I'm not an artist. I enjoy solving puzzles, especially puzzle solutions that others find useful. So when someone asks (for me, by name) how to do a tricky thing procedurally, I work on that. I may not succeed, or I may produce inferior results, but I will at least answer the question.
Remember the original question?
Is there a way to use the materials room to make a figure appear bruised or beaten?
The correct answer is "yes". The incorrect (or at least not helpful) answer is "no - I'd paint it so you should too"
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)
bagginsbill posted Sun, 20 August 2006 at 11:51 AM
Tekn0monk:
I just looked at your gallery. Those are really good renders. So you're working on a procedural skin shader, are you.
HEHEH
Shame on you, picking on procedurals.
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)
Dead_Reckoning posted Sun, 20 August 2006 at 11:52 AM
Quote - Remember the original question?
Is there a way to use the materials room to make a figure appear bruised or beaten?
The correct answer is "yes". The incorrect (or at least not helpful) answer is "no - I'd paint it so you should too"
Many Thanks Bagginsbill.
That's what I wanted to learn How to Do. I'm not at all into Post Work . My aim to to learn more about using Poser, not painting.
Cheers
DR
"That government is
best which governs the least, because its people discipline
themselves."
Thomas Jefferson
bagginsbill posted Sun, 20 August 2006 at 3:56 PM
To be fair, DR, tekn0m0nk wasn't talking about post work painting, but rather making the bruise as a texture file, which you apply in the material room as a shader tree, instead of the algorithmic shader tree I supplied. This is still pre-render and would not have to be done over and over again like post work.
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)
bagginsbill posted Sun, 20 August 2006 at 4:21 PM
IT IS NOT A DOC FILE - I HAD TO RENAME IT TO MAKE RENDO LOAD IT.
PLEASE REMOVE .doc FROM THE NAME>
It is a trivial conversion of the Jessi demo to use the James texture files. I also added the bruise code above as you requested. The skin features and bruise features all have Parmatic dials, so you can adjust him to your liking.
Will post an image next.
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)
Dead_Reckoning posted Sun, 20 August 2006 at 4:22 PM
Quote - To be fair, DR, tekn0m0nk wasn't talking about post work painting, but rather making the bruise as a texture file, which you apply in the material room as a shader tree, instead of the algorithmic shader tree I supplied. This is still pre-render and would not have to be done over and over again like post work.
Thanks for the Clarification Bagginsbill.
What would happen with sizing that way? and How would you align it?
Could you please show me the text to define the Granite Node ?
Many Thanks
DR
"That government is
best which governs the least, because its people discipline
themselves."
Thomas Jefferson
bagginsbill posted Sun, 20 August 2006 at 4:25 PM
Bruise U: .57
Bruise V: .6
Bruise R: .07
Bruise Blend: .5
Skin Hue: 1
Skin Value: .7
SSS: 1
Specular_Value: .1
Freckles:Blending: .8
SKin:Saturation: 1.1
Blinn:Reflectivity: .5
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)
bagginsbill posted Sun, 20 August 2006 at 4:33 PM
Aligning a bruise texture file is pretty easy - you just plug in UV offsets into the ImageMap node.
To make any node in Parmatic, look up the node in the Node Reference. I listed them all. The parameters are documented. You usually want to set the parameters when you create the node, in the argument list. This is all covered in the manual.
So to make the nodes you showed me in your screen shot:
myNoiseNode = Noise()
#The granite has the noise plugged into the first parameter and all the rest are default:
myGraniteNode = Granite(myNoiseNode)
#The granite was plugged into the blender second color (for the bruise):
s.Diffuse_Color = Blend(s.Diffuse_Color, bruiseclr * myGraniteNode, bruiseblend)
That's all I need to do to match what you modified in my shader.
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)
Dead_Reckoning posted Sun, 20 August 2006 at 4:43 PM
Quote - Aligning a bruise texture file is pretty easy - you just plug in UV offsets into the ImageMap node.
To make any node in Parmatic, look up the node in the Node Reference. I listed them all. The parameters are documented. You usually want to set the parameters when you create the node, in the argument list. This is all covered in the manual.
So to make the nodes you showed me in your screen shot:
I'll do this step by step instead of one big statement
First the noise - since all the parms are default value, I need no arguments
myNoiseNode = Noise()
#The granite has the noise plugged into the first parameter and all the rest are default:
myGraniteNode = Granite(myNoiseNode)#The granite was plugged into the blender second color (for the bruise):
s.Diffuse_Color = Blend(s.Diffuse_Color, bruiseclr * myGraniteNode, bruiseblend)
That's all I need to do to match what you modified in my shader.
This was very Helpful BagginsBill.
I think this is what has been holding those of us who what to do a script back. We are to thickdense to understand How to add the P6 Materila Room Nodes as lines of text in the script. Your explainations make it much easier.
Definitely needs work here, size is off and coloring is wrong. But at least it shows what I am attempting to do with the Vericose Vein idea. Vericose Veins and SSS would certainly go along way to making and Older Persons' Skin.
I tried it on G2 James. The positioning was off, so I would say the Maps are different between P6James and G2 James.
Cheers
DR
"That government is
best which governs the least, because its people discipline
themselves."
Thomas Jefferson
Dead_Reckoning posted Sun, 20 August 2006 at 4:45 PM
This was very Helpful BagginsBill.
I think this is what has been holding those of us who what to do a script back. We are to thickdense to understand How to add the P6 Materila Room Nodes as lines of text in the script. Your explainations make it much easier.
Definitely needs work here, size is off and coloring is wrong. But at least it shows what I am attempting to do with the Vericose Vein idea. Vericose Veins and SSS would certainly go along way to making and Older Persons' Skin.
I tried it on G2 James. The positioning was off, so I would say the Maps are different between P6James and G2 James.
Cheers
DR
"That government is
best which governs the least, because its people discipline
themselves."
Thomas Jefferson
Dead_Reckoning posted Sun, 20 August 2006 at 4:49 PM
Quote - Parmatic dial settings:
Bruise U: .57
Bruise V: .6
Bruise R: .07
Bruise Blend: .5
Skin Hue: 1
Skin Value: .7
SSS: 1
Specular_Value: .1
Freckles:Blending: .8
SKin:Saturation: 1.1
Blinn:Reflectivity: .5
Thanks
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?
Or
Can I cut and paste the JessiEyeMakeup Parmatic Script?
Thanks
DR
"That government is
best which governs the least, because its people discipline
themselves."
Thomas Jefferson
Dead_Reckoning posted Sun, 20 August 2006 at 5:04 PM
Quote - So to make the nodes you showed me in your screen shot:
I'll do this step by step instead of one big statement
First the noise - since all the parms are default value, I need no arguments
myNoiseNode = Noise()
#The granite has the noise plugged into the first parameter and all the rest are default:
myGraniteNode = Granite(myNoiseNode)#The granite was plugged into the blender second color (for the bruise):
s.Diffuse_Color = Blend(s.Diffuse_Color, bruiseclr * myGraniteNode, bruiseblend)
That's all I need to do to match what you modified in my shader.
So, this shoiuld be the script then? I ran it and had no errors. 13 Nodes.
=========================
##Bagginsbill's Bruise Script
clr = ImageMap(":Runtime:Textures:Poser 6 Textures:James_Face_Color.jpg")
s = Surface(clr, 1, 1, .2, .5)
bruiseclr = Color(.5, .2, .7)
cx = .4
cy = .45
x = U - cx
y = V - cy
r = sqrt(x * x + y * y)
br = .1
bruiseblender = Scale(r, br, br / 2)
myNoiseNode = Noise()
#The granite has the noise plugged into the first parameter and all the rest are default:
myGraniteNode = Granite(myNoiseNode)
#Finally I simpley blend the original Diffuse_Color (from above) with the bruise color
#using the bruiseblender I just calculated.
#The granite was plugged into the blender second color (for the bruise):
s.Diffuse_Color = Blend(s.Diffuse_Color, bruiseclr * myGraniteNode, bruiseblender)
====================================
Thanks Very much
DR
"That government is
best which governs the least, because its people discipline
themselves."
Thomas Jefferson
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)
bagginsbill posted Sun, 20 August 2006 at 5:37 PM
So, this shoiuld be the script then? I ran it and had no errors. 13 Nodes.
Yeah that looks right. Just load it and look at it.
In general, you will get really good at Matmatic shader writing if what you do is build up small and look at the resulting shader tree.
Try simple things like:
Surface(Granite())
Surface(GREEN * Granite())
Surface(Blend(GREEN * Granite(), .5 * Spots(RED, BLUE), .5))
Do fifty of these, getting progressively more complicated expressions. Type in every example I did in the manual and look at the resulting shader tree.
I spent 15 full days writing the manuals and all those examples. You should be able to go through them one by one, making a file of your own, reproduce my results, than modify each a little bit. It's like anything else, you need to build new connections in your brain, and that comes from practice, especially repetition.
After a while bells will ring, lights will come on, and you will wonder how you didn't see the connections right away as scripts.
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)
Dead_Reckoning posted Sun, 20 August 2006 at 5:56 PM
Quote - 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.
Thanks again. I never really understood what you were trying to teach us the first go around with Parmatic.
With these examples, I certainly understand it much better.
Cheers
DR
"That government is
best which governs the least, because its people discipline
themselves."
Thomas Jefferson
Dead_Reckoning posted Sun, 20 August 2006 at 6:00 PM
Quote - Do fifty of these, getting progressively more complicated expressions. Type in every example I did in the manual and look at the resulting shader tree.
I spent 15 full days writing the manuals and all those examples. You should be able to go through them one by one, making a file of your own, reproduce my results, than modify each a little bit. It's like anything else, you need to build new connections in your brain, and that comes from practice, especially repetition.
After a while bells will ring, lights will come on, and you will wonder how you didn't see the connections right away as scripts.
Understood. In the beginning I never really understood the now defunct Microsoft DirectX Direct Animation scripts either. After doing a 100 or more it sunk in so that many things became routine.
Thanks for all the help Bagginsbill.
DR
"That government is
best which governs the least, because its people discipline
themselves."
Thomas Jefferson
Dead_Reckoning posted Sun, 20 August 2006 at 9:36 PM
I have something off a bit with the Bruising, but the rest is great.
DR
Quote - DR Here ya go. Attached is JamesDemo.mm1.txt.
IT IS NOT A DOC FILE - I HAD TO RENAME IT TO MAKE RENDO LOAD IT.
PLEASE REMOVE .doc FROM THE NAME>
It is a trivial conversion of the Jessi demo to use the James texture files. I also added the bruise code above as you requested. The skin features and bruise features all have Parmatic dials, so you can adjust him to your liking.
Will post an image next.
"That government is
best which governs the least, because its people discipline
themselves."
Thomas Jefferson
tekn0m0nk posted Mon, 21 August 2006 at 4:50 AM
Quote - I just looked at your gallery. Those are really good renders. So you're working on a procedural skin shader, are you. HEHEH
Shame on you, picking on procedurals.
Heh ! Well i just like using the right tool for the job so using an algorithmic approach to something like a bruise seemed a bit overcomplex to me is all. But i admit that everyone likes working differently and what i consider 'best' may not be something another person would like in their workflow.
So it was just a thought, no hard feelings or anything i hope :)
infinity10 posted Mon, 21 August 2006 at 9:47 AM
OMG - varicose veins.... V3's legs are going to get some treatment, methinks....
Well, bagginsbill, as always, I remain a fan of your Matmatic.
Eternal Hobbyist
Ghostofmacbeth posted Mon, 21 August 2006 at 9:57 AM
Dang .. Code .. Ugh. Photoshop is still MUCH easier to me :)
Dead_Reckoning posted Mon, 21 August 2006 at 11:52 AM
Bagginsbill's method works for me. I enjoy learning things like this.
One text file, such as the one he posted here, can create multiple mc6 file in a heartbeat.
With Parmatic you can tweak away with the Dials that are created in the Properties on the Pose Page.
You can always Paint Away afterwards.
Cheers
DR
"That government is
best which governs the least, because its people discipline
themselves."
Thomas Jefferson
Dead_Reckoning posted Mon, 21 August 2006 at 1:28 PM
OK I have this one working PM style:
clr = ImageMap(":Runtime:Textures:Poser 6 Textures:James_Face_Color.jpg")
s = Surface(clr, 1, 1, .2, .5)
cx = Add(.4).labelled("PM:Bruise CX")
cy = Add(.525).labelled("PM:Bruise CY")
x = Add((U - cx) / 3).labelled("PM:Circular X")
y = Add((V - cy) / 12).labelled("PM:Circular Y")
.
r = sqrt(x * x + y * y)
br = Add(.07).labelled("PM:Bruise BR")
bruiseclr = ColorRamp(
IColor(90, 44, 112),
IColor(90, 56, 113),
IColor(90,70, 153),
IColor(90, 41, 154),
Scale(r, 0, br)
)
maxblend = .5
bruiseblender = maxblend * Scale(r, br, br / 2)
bruiseblender = bruiseblender * Marble3(.5, 1, scale=.5)
s.Diffuse_Color = Blend(s.Diffuse_Color, bruiseclr, bruiseblender)
How would I do "s", "r" and "bruiseblender"? I tried adding and extra set of brackets around the vale alond with "add" and "lanebeled etc" with No Joy.
Cheers
DR
"That government is
best which governs the least, because its people discipline
themselves."
Thomas Jefferson
Ghostofmacbeth posted Mon, 21 August 2006 at 2:28 PM
Sadly, what is a heartbeat is days and days for me. I hate coding stuff and that is what that stuff is. I am still fighting something I have been working on for over a year trying to deal with these stupid nodes without much luck, at times.
bagginsbill posted Mon, 21 August 2006 at 3:36 PM
DR:
How would I do "s", "r" and "bruiseblender"?
You can't do "s" because "s" is the whole surface and you can't make a single parameter out of a whole surface.
You don't want to do "r" because r is not a set parameter, it s a per-pixel calculated value. It represents how far you are from the cx,cy coordinate. We use that as input to the Scale function inside the ColorRamp.
I assume you wanted to control "bruiseblender", or in other words, the maximum strength of the effect. But that is the variable "maxblend" which we use as one of the factors in calculating bruiseblender. So just make the ".5" be the parameter:
maxblend = Add(.5).labelled("PM:Bruise Max Blend")
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)
Faery_Light posted Mon, 21 August 2006 at 3:43 PM
Bookmark.
Let me introduce you to my multiple personalities. :)
BluEcho...Faery_Light...Faery_Souls.
Dead_Reckoning posted Mon, 21 August 2006 at 4:19 PM
Quote - I assume you wanted to control "bruiseblender", or in other words, the maximum strength of the effect. But that is the variable "maxblend" which we use as one of the factors in calculating bruiseblender. So just make the ".5" be the parameter:
maxblend = Add(.5).labelled("PM:Bruise Max Blend")
Thanks, Yes that is what I wanted to do.
DR
"That government is
best which governs the least, because its people discipline
themselves."
Thomas Jefferson
bagginsbill posted Mon, 21 August 2006 at 4:58 PM
clr = ImageMap(":Runtime:Textures:Poser 6 Textures:James_Face_Color.jpg")
bump = ImageMap(":Runtime:Textures:Poser 6 Textures:James_Face_Bump.jpg")
effect = Bias(Scale(inv(Abs(2.5 * FBM(1, 4, 3, 3, .2, .2, .2, 0, .5, .3) - .5)), .2, 1), .8)
effectclr = RED * clr
effectdisp = effect
s = Surface(clr, 1, 1, .1, .5)
s.Bump = .03 * bump
cx = Add(.4).labelled("PM:Effect CX")
cy = Add(.525).labelled("PM:Effect CY")
x = (U - cx) / Add(1).labelled("PM:Effect X Scale")
y = (V - cy) / Add(1).labelled("PM:Effect Y Scale")
er = Add(.07).labelled("PM:Effect Radius")
es = Add(.25).labelled("PM:Effect Strength")
ed = Add(.03).labelled("PM:Effect Displacement")
r = sqrt(x * x + y * y)
effectInR = Clamp(Scale(r, er, er/4)) * effect
s.Diffuse_Color = Blend(clr, effectclr, es * effectInR)
s.Displacement = ed * effectdisp * effectInR
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)
bagginsbill posted Mon, 21 August 2006 at 5:52 PM
clr = ImageMap(":Runtime:Textures:Poser 6 Textures:James_Face_Color.jpg")
bump = ImageMap(":Runtime:Textures:Poser 6 Textures:James_Face_Bump.jpg")
effect = Spots(0, 1, .06, .25, .4)
effectclr = IColor(220, 190, 40) * clr
s = Surface(clr, 1, 1, .1, .5)
s.Bump = .03 * bump
cx = Add(.5).labelled("PM:Effect CX")
cy = Add(.54).labelled("PM:Effect CY")
x = (U - cx) / Add(4).labelled("PM:Effect X Scale")
y = (V - cy) / Add(1).labelled("PM:Effect Y Scale")
er = Add(.07).labelled("PM:Effect Radius")
es = Add(.35).labelled("PM:Effect Strength")
r = sqrt(x * x + y * y)
effectInR = Clamp(Scale(r, er, er/4)) * effect
s.Diffuse_Color = Blend(clr, effectclr, es * effectInR)
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)
Dead_Reckoning posted Mon, 21 August 2006 at 6:04 PM
Bagginsbill:
This is the only one, for some reason unknown to me, that I cannot duplicate.
I am using the JamesDemo.mm1.txt that you posted and the settings posted below. No Errors and it renders fine, just no black eye.
If your coordinates are reversed from mine, shouldn't I still have the Right eye with the bruise?
I've tried this several times with no sucess.
Thanks
DR
Quote - Parmatic dial settings:
Bruise U: .57
Bruise V: .6
Bruise R: .07
Bruise Blend: .5
Skin Hue: 1
Skin Value: .7
SSS: 1
Specular_Value: .1
Freckles:Blending: .8
SKin:Saturation: 1.1
Blinn:Reflectivity: .5
"That government is
best which governs the least, because its people discipline
themselves."
Thomas Jefferson
bagginsbill posted Tue, 22 August 2006 at 7:07 AM
DR:
In the JamesDemo file, I made the default value of Bruise Blend to 0 because I didn't think you'd normally want a bruise as soon as you load one of the materials. Perhaps you did stuff out of order?
I downloaded the file again, so I made sure I have what you have. Then I did:
Works every time, but my bruise is on his left cheek.
Go into the Material room, select his head, and look at the preview - does it show a bruise? Go find the PM:Bruise Blend node, make sure it is not 0. When you change it, you should be able to see the bruise in the preview.
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)
bagginsbill posted Tue, 22 August 2006 at 7:27 AM
DR:
It just occured to me that you might be using SR3? If so, there is a problem with the original Parmatic. SR3 changed some Poser's python callback events. They actually fixed a bug, a bug that I had worked around by looking for a different event than I should be using. If you're using SR3, do the following.
Now run that.
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)
Dead_Reckoning posted Tue, 22 August 2006 at 12:08 PM
You are a "Mind Reader" as well as a Wizard Bagginsbill.
yes, I do have P6 SR3 installed. I corrected as you mentioned and it runs correctly now. It finds and loads as well as updates when I cahnage a value dial.
Sorry, still No Bruise visible though. In all of the other cases that work really great, I can see the Bruise pn the Face Map in the Material Room. In this one I do not see the Bruise anywhere on the Face Map in the Material Room. Maybe it's alignment???
Also I tried playing with the texture that looks like vericose veins on james's Body. I did good moving it in a clockwise direction, until I got to the center of his back and then it stopped. I guess that must be where the seam is? pretty sure I can go counterclockwise as well with same stopping point. Is there a way to Bridge the Seam Joint?
What I was attempting was to seriously bruise both of his Butt Cheeks, like he had received 40 whacks with a Frat paddle.
Slowly it is permeating that layer of concrete around my skull.
DR
"That government is
best which governs the least, because its people discipline
themselves."
Thomas Jefferson
Dead_Reckoning posted Tue, 22 August 2006 at 12:54 PM
Quote - Go into the Material room, select his head, and look at the preview - does it show a bruise? Go find the PM:Bruise Blend node, make sure it is not 0. When you change it, you should be able to see the bruise in the preview.
BB, please ignor my post further on down this page. I did as you suggested and changed the zero value to 0.5 in the Material Room and it worked fine. For some reaso using the PM Dial doesn'tseem to be working on him. Thanks for setting it to Zero for normal renders. Always thinking.
Interesting, I set the value to 0.5 in the material Room and it appeared and worked fine. In the Pose Room I set the Value to Zero, PM updated, but the bruise did not go away.
Cheers
DR
"That government is
best which governs the least, because its people discipline
themselves."
Thomas Jefferson
Dead_Reckoning posted Tue, 22 August 2006 at 3:05 PM
I am now able to run it with my Granite Bruise in the script.
I added:
myNoiseNode = Noise()
myGraniteNode = Granite(myNoiseNode)
and change this: Diffuse(bruiseclr) to this: Diffuse(bruiseclr * myGraniteNode)
When I attempted to add Add(.05).labelled("PM:Granite"), it wouldn't let me. It said I was allowed only five(5) Arguments.
Thanks
DR
"That government is
best which governs the least, because its people discipline
themselves."
Thomas Jefferson
bagginsbill posted Tue, 22 August 2006 at 4:34 PM
I'm not sure what's going on with Parmatic not copying the dial setting to your shader. Is it just this one parameter or are others not updating? All of them?
When I attempted to add Add(.05).labelled("PM:Granite"), it wouldn't let me. It said I was allowed only five(5) Arguments.
Attempted to add it where? Which parameter are you trying to feed PM:Granite into?
Earlier you asked about the seam. The problem is that the test for nearness to cx, cy fails when one of those coordinates gets to the edge of the unwrapped figure. The other edge, which is physically right next to it in 3d space, is far away in UV space. There is a pretty simlple formula for doing the "wraparound" test when in UV space the figure brings U=0 next to U=1, but the body coloring doesn't span the whole UV space. Look at the texture map. You'll see that the same is not at the edge of the image and it's curved. That would be a lot of math, probably more trouble than it's worth.
Much easier would be to do two bruises, one for the left side of the map and one for the right. Merge them together the same way one bruise is merged with the original color. Just repeat.
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)
Dead_Reckoning posted Tue, 22 August 2006 at 6:05 PM
Quote - I'm not sure what's going on with Parmatic not copying the dial setting to your shader. Is it just this one parameter or are others not updating? All of them?
When I attempted to add Add(.05).labelled("PM:Granite"), it wouldn't let me. It said I was allowed only five(5) Arguments.
Attempted to add it where? Which parameter are you trying to feed PM:Granite into?
Earlier you asked about the seam. The problem is that the test for nearness to cx, cy fails when one of those coordinates gets to the edge of the unwrapped figure. The other edge, which is physically right next to it in 3d space, is far away in UV space. There is a pretty simlple formula for doing the "wraparound" test when in UV space the figure brings U=0 next to U=1, but the body coloring doesn't span the whole UV space. Look at the texture map. You'll see that the same is not at the edge of the image and it's curved. That would be a lot of math, probably more trouble than it's worth.
Much easier would be to do two bruises, one for the left side of the map and one for the right. Merge them together the same way one bruise is merged with the original color. Just repeat.
A. It seems to be just the Bruise Dial
B. I added it in the string with the other PM Dial assignments. What I wanted to do is control the strength of the Granite.
Thanks for the Information on the seam. I undrerstand it. im my world 0 deg North & 180 deg East would be next to 0 Deg North & 180 deg West,
Now the question: do I basically do another statement or two or four with a different name and co-ordinates in the same script?
Many Thanks
"That government is
best which governs the least, because its people discipline
themselves."
Thomas Jefferson
bagginsbill posted Tue, 22 August 2006 at 8:01 PM
Ah now I understand.
You tried to add it to this:
ApplyBruise(c.Head, Add(.4).labelled("PM:Bruise U"), Add(.525).labelled("PM:Bruise V"),
Add(.07).labelled("PM:Bruise R"), Add(0).labelled("PM:Bruise Blend"),
)
This is the invocation of the "ApplyBruise" function that I made for that script. You are trying to pass an extra argument, but there is no parameter in the function declaration to receive it. Have I overwhelmed you with computer jargon? I tried to covere this in the manual where I "gently" introduce you to Python.
We can do one of two things:
Add a parameter to the ApplyBruise function, so you can pass the argument.
Just forget about the parameter - build it into the function automatically.
The latter is quicker, but less flexible. It all depends on how you want to use the function and the resulting shader.
To add a parameter to the function we could do this:
def ApplyBruise(s, cx, cy, br, maxblend, graniteamount):
Then inside we have to figure out how to use the graniteamount value.
To my mind a very simple way is to just use it to blend between two alternatives. We just need to change one line - the place where you create the granite:
myGraniteNode = Blend(WHITE, Granite(myNoiseNode), graniteamount)
Blend takes two values and blends them using the third. It will generate a Blender node, most of the time. However, if Matmatic sees that graniteamount is always 0, it will skip the blend and just use WHITE. And later when you multiply bruiseclr * WHITE, it will reduce that to bruiseclr. In other words, when you turn things off, Matmatic will optimize away crap you don't use in the shader. Cool huh?
If you pass an Add node for the argument to graniteamount, then Matmatic can see that it is not constant - it can change. So it will produce the Blender node and wire it in.
Now you can add the additional PM value to the invocation with all the others.
Now for the coolest part. Because we wrote the ApplyBruise function in such a way that it just adds some more stuff to the Alternate_Diffuse shader tree, you can call it MORE THAN ONCE!
For example, if you want a matched pair of bruises separated by some distance, you could make yet another function:
def ApplyBruisePair(s, cx, cy, br, separation, maxblend, graniteamount):
ApplyBruise(s, cx - separation/2, cy, br, maxblend, graniteamount)
ApplyBruise(s, cx + separation/2, cy, br, maxblend, graniteamount)
Then change your call at the bottom from ApplyBruise to ApplyBruisePair and add another argument for the separation parameter, which you probably want to be a PM value.
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)
Dead_Reckoning posted Tue, 22 August 2006 at 9:02 PM
I added These:
myGraniteNode = Blend(WHITE, Granite(myNoiseNode), graniteamount)
I got and Error - graniteamount undefined.
def ApplyBruisePair(s, cx, cy, br, separation, maxblend, graniteamount):
ApplyBruise(s, cx - separation/2, cy, br, maxblend, graniteamount)
ApplyBruise(s, cx + separation/2, cy, br, maxblend, graniteamount)
I got and Error -
MATMATIC Script Error: invalid syntax (line 190)
Traceback (most recent call last):
File "C:Program FilesCurious LabsPoser 5RuntimePythonmatmaticcompiler.py", line 232, in processScript
File "
x = U - cx
^
SyntaxError: invalid syntax
!! Matmatic stopping because of error !!
------ MATMATIC COMPILER DONE ----
, Add(0.5).labelled("PM:BruiseL Blend"), Add(0.5).labelled("PM:BruiseR Blend")
I can understand the graniteamount undefined. Could I go like this?
graniteamount = (22/7)
No clue why I got and error for x = U - cx unless I need to have a cx1 and cx2
Thanks for all of your time and help.
DR
"That government is
best which governs the least, because its people discipline
themselves."
Thomas Jefferson
bagginsbill posted Tue, 22 August 2006 at 9:50 PM
Did you define it first? I quote myself:
To add a parameter to the function we could do this:
def ApplyBruise(s, cx, cy, br, maxblend, graniteamount):
Then inside we have to figure out how to use the graniteamount value
I'm beginning to wonder if you have rearranged things and didn't realize the significance of what you did. I'm still puzzled by the fact that your bruise won't show up.
Post your latest script, and I'll review it in the morning.
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)
Dead_Reckoning posted Wed, 23 August 2006 at 5:31 AM
Good Morning Bagginsbill
The attached 1BruisetestA.mm1.txt.doc runs with No Errors in Matmatic. If I do not assing a value to Bruise Blend, the dial doesn't seem to work. Parmatic show no activity when i cahnge Dial Values. It works fine as long as I give it a value in the script.
I get an error if I do not assign a value to graniteamount.
If I Add this:def ApplyBruisePair(s, cx, cy, br, separation, maxblend, graniteamount):
ApplyBruise(s, cx - separation/2, cy, br, maxblend, graniteamount)
ApplyBruise(s, cx + separation/2, cy, br, maxblend, graniteamount)
I get an error.
I tried using your example: Clouds(RED, GRAY3) and was told that "Red" was not defined. I suspect it would also tel me that "Gray3" was not defined if it had continued on running.
I can follow this:
myNoiseNode = Noise()
myGraniteNode = Granite(myNoiseNode)
I guess I could do this:
myCloudsNode = Clouds(Red,Gray3)
myTurbulenceNode = Turbulence(myCloudsNode)
except I cannot get Matmatic to recognize the colors as defined.
myGraniteNode = Blend(Turbulence(myCloudsNode), Granite(myNoiseNode)
If I could get the Clouds Colors to work for me, how would I add that in the staement above?
I tried an extra set of brackets with no luck.
Thanks
DR
"That government is
best which governs the least, because its people discipline
themselves."
Thomas Jefferson
bagginsbill posted Wed, 23 August 2006 at 9:05 AM
Just got back in this - I haven't sorted through all of this yet, but one comment jumped out at me.
I tried using your example: Clouds(RED, GRAY3) and was told that "Red" was not definedChuckle chuckle. Look at what you said. You claimed that you used "RED" in the code, but it told you "Red" was not defined. "Red" is not the same as "RED". If Python complained that "Red" is not defined, then you must have said "Red", not "RED" the way I did. And, yes, "Gray3" isn't right either. It's "GRAY3".
Here are all the predefined colors:
BLACK = Color(0, 0, 0)
WHITE = Color(1.0, 1.0, 1.0)
RED = Color(1, 0, 0)
GREEN = Color(0, 1, 0)
BLUE = Color(0, 0, 1)
YELLOW = Color(1, 1, 0)
CYAN = Color(0, 1, 1)
MAGENTA = Color(1, 0, 1)
GRAY1 = Color(.1)
GRAY2 = Color(.2)
GRAY3 = Color(.3)
GRAY4 = Color(.4)
GRAY5 = Color(.5)
GRAY6 = Color(.6)
GRAY7 = Color(.7)
GRAY8 = Color(.8)
GRAY9 = Color(.9)
ORANGE = Color(1, .5, 0)
SKY = Color(0, .5, 1)
SKIN = IColor(223, 175, 160)
Case matters.
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)
Dead_Reckoning posted Wed, 23 August 2006 at 9:23 AM
Quote - Here are all the predefined colors:
BLACK = Color(0, 0, 0)
WHITE = Color(1.0, 1.0, 1.0)
RED = Color(1, 0, 0)
GREEN = Color(0, 1, 0)
BLUE = Color(0, 0, 1)
YELLOW = Color(1, 1, 0)
CYAN = Color(0, 1, 1)
MAGENTA = Color(1, 0, 1)
GRAY1 = Color(.1)
GRAY2 = Color(.2)
GRAY3 = Color(.3)
GRAY4 = Color(.4)
GRAY5 = Color(.5)
GRAY6 = Color(.6)
GRAY7 = Color(.7)
GRAY8 = Color(.8)
GRAY9 = Color(.9)
ORANGE = Color(1, .5, 0)
SKY = Color(0, .5, 1)
SKIN = IColor(223, 175, 160)Case matters.
Ahhhhh, Lesson learned - Thanks
DR
Curious how I would combine three or four nodes together. Particularly with things such as Clouds with colors defined, Turbulence with colors defined etc. Apllying nodes to both sockets in the Blend Node etc.
I am attempting to practise using the Agatedemo.mm1.txt as my starting point.
"That government is
best which governs the least, because its people discipline
themselves."
Thomas Jefferson
Dead_Reckoning posted Fri, 25 August 2006 at 10:57 AM
Bagginsbills
Could you post some very basic Matmatic PM Scripts.
I have been through your tutorials several times now until my eyes spin.
I am looking for basics like:
A cloud Node and maybe a granite node combined and then used as a "Bump" and as a "Displacement" - Tks
I find it much easier to comprehend what you have done when i can look at the script and the resulting P6 Material Room Results.
Cheers
DR
"That government is
best which governs the least, because its people discipline
themselves."
Thomas Jefferson
bagginsbill posted Fri, 25 August 2006 at 12:01 PM
The render above is using the twelve materials from the script below.
It has no indentation, so cut-and-paste will work too.
########### Let's start with simple color arithmetic.
n1 = Cellular(BLACK, 1, WHITE, 1, .1, .1, .1, cellMode = 3)
n2 = Spots(IColor(133, 70, 185), IColor(223, 202, 151), 1, .1)
n3 = IColor(150, 255, 50) * FBM() # the FBM node has no color argument, but you can just multiply it with one
clr = n1 + n2 + n3
outputs += ["A", Surface(clr)]
clr = (n1 + n2 + n3) / 3
outputs += ["B", Surface(clr)]
clr = n1 * n2 * n3
outputs += ["C", Surface(clr)]
clr = n1 - n2
outputs += ["D", Surface(clr)]
clr = abs(n1 - n2)
outputs += ["E", Surface(clr)]
clr = (abs(n1 - n2) + abs(n1 - n3)) / 2
outputs += ["F", Surface(clr)]
clr = Blend(n2, n3, .3) # this is really just .7 * n2 + .3 * n3
outputs += ["G", Surface(clr)]
########## Important Technique - MODULATION
clr = Blend(n2, n3, n1) # n1 is my modulator (the Cellular)
outputs += ["H", Surface(clr)]
n4 = Brick(WHITE, BLACK, Mortar_Width = .3)
clr = Blend(n2, n3, n4) # n4 is my modulator (the Brick)
outputs += ["I", Surface(clr)]
clr = Spots(IColor(133, 70, 185), IColor(223, 202, 151), Brick(.1, 1, Mortar_Width = .5))
outputs += ["J", Surface(clr)]
clr = Spots(IColor(133, 70, 185), IColor(223, 202, 151), Scale(n3, 1.5, 4))
outputs += ["K", Surface(clr)]
clr = Spots(IColor(133, 70, 185), IColor(223, 202, 151), Scale(Bias(Specular(WHITE, 1, 1), .3), 1.2, .02))
outputs += ["L", Surface(clr)]
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)
bagginsbill posted Fri, 25 August 2006 at 12:05 PM
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)
bagginsbill posted Fri, 25 August 2006 at 1:02 PM
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)
bagginsbill posted Fri, 25 August 2006 at 1:10 PM
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)
Dead_Reckoning posted Fri, 25 August 2006 at 1:11 PM
Thank you very much Bagginsbill.
This will give me plenty to mull over. Right off the bat, I didn't know I could do this:
clr = (abs(n1 - n2) + abs(n1 - n3)) / 2
outputs += ["F", Surface(clr)]
Many Thanks
DR
"That government is
best which governs the least, because its people discipline
themselves."
Thomas Jefferson
Dead_Reckoning posted Sat, 26 August 2006 at 6:37 AM
The attached Script Works Fine.
When I change this:
def ApplyBruise(s, cx, cy, br, maxblend):
To this:
def ApplyBruisePair(s, cx, cy, br, maxblend):
ApplyBruise(s, cx, cy, br, maxblend)
ApplyBruise(s, cx, cy, br, maxblend)
or this:
def ApplyBruisePair(s, cx, cy, br, separation, maxblend):
ApplyBruise(s, cx - separation/2, cy, br, maxblend)
ApplyBruise(s, cx + separation/2, cy, br, maxblend)
or this:
def ApplyBruisePair(s, cx, cy, br, separation, maxblend, graniteamount):
ApplyBruise(s, cx - separation/2, cy, br, maxblend, graniteamount)
ApplyBruise(s, cx + separation/2, cy, br, maxblend, graniteamount)
I get the following Error Message
----- MATMATIC COMPILER -----
verbose 1
Warning: config scan dir not found: Runtime:Libraries:pose:MatmaticDemos
Processing script C:Program FilesCurious LabsPoser 6RuntimeLibrariesmaterialsMatmaticDemosRDNABruisesJames2Bruise.mm1.txt -> material
MATMATIC Script Error: invalid syntax (line 190)
Traceback (most recent call last):
File "C:Program FilesCurious LabsPoser 5RuntimePythonmatmaticcompiler.py", line 232, in processScript
File "
x = U - cx
^
!! Matmatic stopping because of error !!
------ MATMATIC COMPILER DONE ----
Cheers
DR
Quote - Ah now I understand.
You tried to add it to this:
ApplyBruise(c.Head, Add(.4).labelled("PM:Bruise U"), Add(.525).labelled("PM:Bruise V"),
Add(.07).labelled("PM:Bruise R"), Add(0).labelled("PM:Bruise Blend"),
)This is the invocation of the "ApplyBruise" function that I made for that script. You are trying to pass an extra argument, but there is no parameter in the function declaration to receive it. Have I overwhelmed you with computer jargon? I tried to covere this in the manual where I "gently" introduce you to Python.
We can do one of two things:
Add a parameter to the ApplyBruise function, so you can pass the argument.
Just forget about the parameter - build it into the function automatically.
The latter is quicker, but less flexible. It all depends on how you want to use the function and the resulting shader.
To add a parameter to the function we could do this:
def ApplyBruise(s, cx, cy, br, maxblend, graniteamount):
Then inside we have to figure out how to use the graniteamount value.
To my mind a very simple way is to just use it to blend between two alternatives. We just need to change one line - the place where you create the granite:
myGraniteNode = Blend(WHITE, Granite(myNoiseNode), graniteamount)
Blend takes two values and blends them using the third. It will generate a Blender node, most of the time. However, if Matmatic sees that graniteamount is always 0, it will skip the blend and just use WHITE. And later when you multiply bruiseclr * WHITE, it will reduce that to bruiseclr. In other words, when you turn things off, Matmatic will optimize away crap you don't use in the shader. Cool huh?
If you pass an Add node for the argument to graniteamount, then Matmatic can see that it is not constant - it can change. So it will produce the Blender node and wire it in.
Now you can add the additional PM value to the invocation with all the others.
Now for the coolest part. Because we wrote the ApplyBruise function in such a way that it just adds some more stuff to the Alternate_Diffuse shader tree, you can call it MORE THAN ONCE!
For example, if you want a matched pair of bruises separated by some distance, you could make yet another function:
def ApplyBruisePair(s, cx, cy, br, separation, maxblend, graniteamount):
ApplyBruise(s, cx - separation/2, cy, br, maxblend, graniteamount)
ApplyBruise(s, cx + separation/2, cy, br, maxblend, graniteamount)Then change your call at the bottom from ApplyBruise to ApplyBruisePair and add another argument for the separation parameter, which you probably want to be a PM value.
"That government is
best which governs the least, because its people discipline
themselves."
Thomas Jefferson
bagginsbill posted Sun, 27 August 2006 at 11:36 AM
So you get the short version instead.
What I said to do:
Change the ApplyBruise function definition to include your granite/noise nodes and a parameter to control them. Add a new function to make a symmetrical pair of bruises. Change your ApplyBruise call.
What you did:
Changed the definition of ApplyBruise to be the definition of ApplyBruisePair. Combined the code fot two in a way that isn't even legal python, let alone what you wanted it to do.
So I've attached a new version of the script where I made the changes correctly. Look for "###" triple sharp comments - those are the changes. Unless you change the numeric values, it makes a pair of bruises, one on each cheek of the head.
I really think this script is a bit too complicated to be used as a learning tool for you. You're trying to be a master chef, when you should be at the salad bar :-)
You need to be 100% clear on the meaning and use of function definition, function call, parameter, and argument. Go over the "Writing Scripts - Basics" document again, with a fine tooth comb. If you want to do more than just change my numbers and colors here and there, you need to understand every word of that.
Create small tasks for yourself, then find a way to write a python function to do it. Then call the functions you make in various ways and orders, until you start thinking naturally in terms of breaking a problem down into function definitions and parameters, and a set of calls to those functions with different arguments. On top of that, you have to figure out how to accomplish your desired effects with shader nodes. That too will come with lots of practice, but if the python stuff is getting in your way, you need to fix that first.
Once you do that, you'll become super fast at working through shader tree variations.
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)
Dead_Reckoning posted Sun, 27 August 2006 at 11:47 AM
Quote - Sigh, I just got done typing an excrutiatingly detailed reply for 45 minutes, then when I posted it Renderosity said "Error - No Global Variables" and my post was GONE.
So you get the short version instead.
I really think this script is a bit too complicated to be used as a learning tool for you. You're trying to be a master chef, when you should be at the salad bar :-)
You need to be 100% clear on the meaning and use of function definition, function call, parameter, and argument. Go over the "Writing Scripts - Basics" document again, with a fine tooth comb. If you want to do more than just change my numbers and colors here and there, you need to understand every word of that.
Create small tasks for yourself, then find a way to write a python function to do it. Then call the functions you make in various ways and orders, until you start thinking naturally in terms of breaking a problem down into function definitions and parameters, and a set of calls to those functions with different arguments. On top of that, you have to figure out how to accomplish your desired effects with shader nodes. That too will come with lots of practice, but if the python stuff is getting in your way, you need to fix that first.
Once you do that, you'll become super fast at working through shader tree variations.
Thanks very much BB.
I now have more than enough to start making Salads.
That really bites when you spend all that time on something, only to have a Froum dump it on you.
I started doing some longer replys in NotePad and then Cut & Paste, just for that reason.
Cheers
DR
"That government is
best which governs the least, because its people discipline
themselves."
Thomas Jefferson
RobynsVeil posted Thu, 29 October 2009 at 7:06 AM
Quote - Do you guys think this is long enough for Beta on Matmatic? Most people seem to think its working right, but I haven't seen anybody else post an original Matmatic material. So as far as I know, everybody is just using my demos. Which concerns me because I tend not to use certain nodes, and they could be buggy. Opinions?
I've read this thread a few times now - am finally using Parmatic... how cool is THIS!! - and I don't think anyone has answered your question on the Beta for Matmatic. I use it every day and besides the missing Texture Quality parameter, the thing works a treat: so, if you want to start marketing, I'll be first in the queue. I'll be the first to admit that I'm not a power-user, but consistency counts for something, doesn't it? I really am using it daily and thanks to your clear instructions can now even call .py files from within the scripts. This is a totally amazing tool: talk about extending the power of Python! Personally, I don't see a need for a GUI for it, but hey, if that's what they're clamoring for... whatever. I find it quicker and easier to debug without a GUI to insulate (hide) the source.
Okay: question. I hope you haven't already answered this somewhere else... is there some way to designate which PM: items show up in which order on the parameter dials window? Or, is that going to be in version .3?
Oh, and why am I not posting my code? Because it is the most unclever, unimaginative, uninspired Python code ever written. You've seen my stuff. Boring! I've finally gotten away from the naming-every-node-so-I-can-place-it lunacy... I name and place those nodes I want the user to see and manipulate (stuff they can't affect with parameter dials, like colours) and all the rest is just kinda strung out like your stuff is. So, the code is more readable, but heck, it's still boring.
It'll be a while before I start to synthesize in Python.
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]
ajsavill posted Sat, 31 October 2009 at 3:02 PM
BB - personally I'd love even a simple "front end" on Matmatic - and please please please do the same for VSS. Both these tools have redefined the way I see, use and understand 3D materials - they should be built in to Poser (though only with a hefty cut for your good self) or sold for a good solid price as a standalone.
Anyone who has used your work will jump on a commercial version - I'm a BB evangelist!