PDA

View Full Version : Apply custom material to Maya Hair...


polyman
04-10-2011, 09:54 AM
Hi, I'm trying to figure out how to apply a MIA material onto Maya Hair.

I was reading a tutorial on it, but I can't seem to follow it


http://blog.the3dagency.com/2010/02/15/mental-ray-override-material-maya/

He talks about creating a dynamic attribute called miMaterial and then was able apply a shader groupnode to the hair. I can't get those attributes to show up!

any help thanks

tonytrout
04-10-2011, 03:34 PM
Haven't tried that method but you can replace the default paint effects hair shader using the p_shader replacer node from puppet shaders. Then you can insert the mia_materialSG into the shading group slot rather than the supplied p_hairTKSG node but it didnt shade too good when I tried it.
http://www.djx.com.au/blog/2009/04/14/p_hairtk-p_hairtk_shadow-p_shader_replacer/

Edit: I followed the tutorial you mentioned and didnt have a problem. You need to select the pfxHair (transform) node then run his scripts to add the attributes he mentions . They appear in the extra attributes at the bottom of the pfxHair node. Hook it up with the connection editer like he says, select your mia material SG node for the left and the pfxhair on the right, you should be able to see the miMaterial there to connect to. Wasnt impressed with the results on the quick test I did but who knows :)

polyman
04-10-2011, 04:11 PM
thanks Tony I'll try it again!

tonytrout
04-10-2011, 04:32 PM
No problem. Whats interesting was I used the miMaterial method and hooked up a p_HairTK shading group (with the p_hairshadow) instead of the mia materialSG and it renders fine. This means you dont have to create the dummy geo or use the p_shaderReplacer method I think, but didnt test it much. There may be some wrinkles with puppets replacer node that allow extra attributes

polyman
04-10-2011, 05:33 PM
wow good:thumbsup:

addAttr -ln "miExportMaterial" -at bool -defaultValue 1;
addAttr -ln "miMaterial" -at message ;

I tried running those 2 lines in the Script editor for both Pfxhair, and Hairsystem node- but nothing shows up!

But I'll try out the miMaterial method with HairTK

tonytrout
04-10-2011, 05:38 PM
You should see the miExportmaterial node at the bottom of the pfxhairnode if you ran the script correctly with the pfxHair node selected as in the pic above. You wont be able to hook up the p_HairTK otherwise.

polyman
04-10-2011, 05:58 PM
Ha damn I suck-Yeah I guess can't get past the 1st part

Here is a pic - no attributes show up for me

http://i1120.photobucket.com/albums/l499/pixelbook/juyhygt.jpg

tonytrout
04-10-2011, 06:34 PM
Geez I dont know. scroll down on the extra attributes? try cntl+enter to run the script? check the node in connection editor?

polyman
04-10-2011, 06:56 PM
Thanks Tony! I'll figure it out later- at least I know it's possible to do!:thumbsup:



EDIT: Got it to work- holding cntl+enter to execute the script did the trick
thanks!!

tonytrout
04-10-2011, 07:24 PM
Excellent :)