PDA

View Full Version : shave and haircut and renderman (solution)


eljofa
10-02-2003, 03:29 AM
ok!

so i guess i have to put this up for those of us who want
to make of renderman our main pipeline driver with maya :)
so here is the info on how to render hair from shave and haircut
with mtor in renderman


my thanks to rdavis for helping out so much
on figuring out how to make renderman render the
hair generated by shave and haircut by joe alter

first
1) generate your hair in maya
2) once you have hair in your surface
2b) write this in the script editor

shaveWriteRib("c:\\file.1.rib","1");

explain: shaveWriteRib is the mel that will do the conversion
in the parenthesis are both the filename + its location, and the frame number

so it is like this

shaveWriteRib("c:\\filename.rib","frame#");

**there is no mistake on the 2 slahes, thats how it has to be
for shave to specify the path. Now!!! if you are puting the ribs into
a folder you would do this

shaveWriteRib("c:\\folder\folder\file.1.rib","1");

you only need the 2 slashes at the beginning of the sentence :)


3) once rib is done
3b) create a RIBbox in mtor with slim
and on the ribbox put the following line

ReadArchive "c:/file.1.rib"

when you click on the edit button of the ribbox you will get a
text editor window. (remember, once you put the line

ReadArchive "c:/file.1.rib"

dont close the editor window, without saving the document,
beware it will not prompt you to enter a filename when you press
control s, or do file--->save;

what it will do is just save that line on the ribbox, so that way when you open hit the edit button you will see your line there.

back to explaining the procedure

ReadArchive "c:/file.1.rib"

of course ReadArchive "c:/filename.frame_number.rib"

in the frame number if you have many frames rendering as an animation
or something like that
you can put

ReadArchive "c:/filename.$f.rib"

that will take the ribs on a frame by frame basis as the $f is number
it will also call that number for that frame.

so your file has to be called
ReadArchive "c:/filename.1.rib"
ReadArchive "c:/filename.2.rib"
ReadArchive "c:/filename.3.rib"
etc...
ReadArchive "c:/filename.10.rib"
ReadArchive "c:/filename.20.rib"
etc...

pretty much without padding, Now!! if you like to have padding
just use
ReadArchive "c:/filename.$f4.rib"

4) attach the ribbox to your surface
4b) PUT LIGHTS IN YOUR SCENE :)
5) render with prman
6) hair!!! :)

very nice
if something you dont understand feel free
to email at eljofa@yahoo.com
or my msn name is eljofa1984@msn.com
you can chat with me there
or eljofa84 for aol instantmessenger

hope you enjoy
and thank rdavis for helping me figure it out

cheers

eljofa

singyin
10-03-2003, 07:38 AM
i am a MtoR beginner.....shave and haircut can be apply on maya polygon....then in your case, are you using polygon object to grow hair.........and then render the hair by renderman........and do shave and haircut still work even i convert the polygon into renderman subdivision surface....

eljofa
10-03-2003, 12:50 PM
hi


as for your question, if your model will maintain the hair and hair
style after converting to subdivision surface???

the answer is no!

even mtor doesnt maintain,

After a geometry has been converted
it turns into something else, so my suggestion is that you apply
your hair to your final model, or if the model is not final, at least
you know that if you do any conversion on it will loose the shave
connections

the reason why i wanted to learn to do it in renderman is because
after trying the shave renderer, unless you have really nice
computers, it will be way too slow,
but with renderman its like 3 times faster

hope this helps
fabian cabrera

singyin
10-03-2003, 02:51 PM
thanks for your knidly reply........finally question.....then what you mean is that firstly.......i have to use maya polygon to model and then convert it into renderman subdivsion surface (certainly have the UV layouted)....secondly........i use the polygon cage of the subd surface to apply shave and haircut...........or i have no choice..if i use renderman subd surface, i cant use shave and haircut......if i use shave........i cant use renderman subd

playmesumch00ns
10-03-2003, 03:14 PM
Just use the original polygon cage to write the rib, then render with a duplicate subd model. easy.

thinking about it, have you tried rendering with the original surface as a subdiv? It shouldn't make any difference at all to the ReadArchive

eljofa
10-03-2003, 05:53 PM
hi

as playmesumch00ns has said
you can do that

you just have to make sure that :::

let say you model a head,
and you attach shave hair to it

for renderman to take it you have to rib it
so you do the

shaveWriteRib("filename+path","frame");

mel command and the thing is this
any change you do!!

you have to rib that change,

so if you change the color of the hair
you have to rib before rendering

and since when you do the conversion from poly to subd
your shave hair node will be detached from the subd model
or better said as said before, the connection of hair to that
object is gone, it is no longer :(

so!
you have to select your subd, attach shave
and then what playmesumch00ns said you can use
after attaching the shave to it
you can rib your shave hair and then
you can select your rib and attach it to the subd

and render, and everything should be as good as expected, if not
as good as expected, tweak, render, tweak and so on :)

hope this helps
fabian cabrera

singyin
10-04-2003, 02:04 AM
really.........thank a lot

lotusexige
11-08-2003, 10:31 AM
Great stuff

I have added the script to a shelf icon, but of course its hard coded to a particular frame

Is there a way to use a variable in the script syntax to get it to generate the current frame I am working in?

kpalazov
11-10-2003, 08:35 PM
Hi ,
Thanks very much for taking the time to post this information, as I was just trying to do this my self this is really a god send.
I have a small problem however .

Typed - shaveWriteRib("C:\\HairDir\SpHair.1.rib","1");
Maya Message -Error: Too many arguments. Expected 1, found 2.

BTW The directory does exist. I'm running Maya 5 with Shave 2.4.20.

If I type - shaveWriteRib("C:\\myHair.rib",10); - as the manual suggests
I receive the following message - Error: Invalid object or value: 10.

Thanks for any help

K

eljofa
11-11-2003, 05:32 PM
you should be able to do just fine with the line

shaveWriteRib("c:\\file.1.rib","1");

if you cant, then u have not installed that melcommand properly
so, and therefore getting command errors

try installing shave again and making sure that all the melscripts
are finely installed

hope this help
altough i never had a problem with the shaveWriteRib must tell you

BUT!! if misspelled or badly specified, you surely will have an issue...

again, try this:
shaveWriteRib("c:\\file.1.rib","1");
and you should do fine

enjoy

eljofa

lazzhar
11-12-2003, 10:06 AM
I'm getting the same error messages as said kpalazov.

eljofa
11-12-2003, 10:26 AM
Originally posted by lazzhar
I'm getting the same error messages as said kpalazov.


well then,

one thing u can try is copying all those
scripts into the script folder

i was using shave 2.2.7

maybe in shave 2.4... u need to try something else
but it definetely is a mel problem that u have
for the syntax of it is right

enjoy
f

kpalazov
11-13-2003, 05:01 AM
Well although shifting all the shave scripts failed I tried it with v2.2.7 and it works fine. Now my only problem is , figuring out how to apply my custom hair shader? any ideas?

Thanks once again this is really great, the difference in rendering times is huge when going for high quality hair!....I also realised how to reference geomatry so this has been a huge help...thankyou.

Kiril

lazzhar
11-13-2003, 05:09 PM
lol, I'm always after kpalazov ;)
Today I tryde copying all script files to my Maya scripts folders but noway :(
Bu when I removed the second parameters (wich is the frame number) the script worked fine and I've got the rib file that I tested with MTor as eljofa explained and it was damn fast !!
I still have the problem If I try to render a suquences.
Thanks

pigglet
11-15-2003, 09:48 AM
I think you can use additional mel commands for generating RIB sequense. Something like this ;)

int $frame;
for ($frame=1; $frame<100;$frame++) {
shaveWriteRib("myfile.$frame.rib); }

kpalazov
11-15-2003, 08:48 PM
High guys ,
after doing some testing with the Stuart Little Hair shader everthing looks great accept for the fact that we can't cotrol the hair thikness the in the rib out put. I think this is a crucal part of hair rendering and I wanted to ask if anyone has any idea's on how to output hair with say top of 0 thickness?

thanks in advance

K

kfc
11-16-2003, 12:20 PM
according to Joe Alters reply in his mailing list. He stated that the new shave version doesn't need to include frame number when we output for single frame.
shaveWriteRib("c:\\file.1.rib") - is sufficient for getting rib out from the file.

While if u wanna output multiple frames. say 10 frames, then u've to use
shaveWriteRib("c:\\file.1.rib","10");


This always work to me. the only changes here is we doesn't need a frame number input for single frame.
If any of u guys got good result from rendering shave in renderman. please post it here!!:bounce:

CGTalk Moderation
01-16-2006, 05:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.