PDA

View Full Version : Eliminate Hair Run-up on Batch Render


mswertfager
05-13-2010, 01:57 AM
How do you stop the run-up time on batch rendering for Maya Hair using Maya Software render?

All hairSystems already set to static and dynamic iterations at 0.

TWO ISSUES:
A) Each frame takes longer to render than the next...quickly becomes unmanageable by 100 frames
B) Very long RunUp time if starting batch on later frame

Example:A
- In application 2 min render time...any frame
- Batch render starting at frame 0.......90 minute ramp-up, 2 min to render frame
but by frame 76..... 8 minutes to render each frame

Example: B
- Batch render starting at frame 77.....90+ minute ramp-up, 8 minutes to render frame

The hairsystem is naturally attached to a skinned head which has blendshapes.

-Michael

This occured with my other characters on Maya 6.5 and 7.0 in 2005. However, the solution could not be found. Previous threads trying to find the answer to this.
- http://forums.cgsociety.org/showthread.php?f=87&t=319383
- http://forums.cgsociety.org/showthread.php?f=7&t=313100
- http://forums.cgsociety.org/showthread.php?f=87&t=285932

mswertfager
05-18-2010, 04:27 PM
Bump. Any ideas?

jaygarrison3d
05-18-2010, 10:32 PM
hmm...

I just posted a similar problem. I'm rendering out of mental ray though.

The render times for me our quite fast, but when batch rendering it's horribly slow. I thought it might be a run up time issue, but mine are set to static as well.

I'm wondering. Even though they're static, if doing a hair cache would speed it up? That even though it's not "moving" batch render doesn't understand this and solves for hair, just not animated hair??

I'm about to dive back into this myself. I'll post any results here.

mswertfager
05-18-2010, 11:22 PM
Please post if you have any luck with the hair caching. That nor geo caching on the head did not prove helpful. I am writing a MEL script to render frame by frame from inside Maya, as an alternative.

jaygarrison3d
05-19-2010, 02:39 AM
Please post if you have any luck with the hair caching. That nor geo caching on the head did not prove helpful. I am writing a MEL script to render frame by frame from inside Maya, as an alternative.

That's a good idea about the script. I'd love to have a copy of that if you're willing to share.

Also, what render method are you using? Rapid scanline (rasterizer) or traditional mental ray?

At first the "Production:Rapid Hair" preset seemed to do the trick. But now it hangs the render. I'm now having better luck using the traditional mental ray.

mswertfager
05-19-2010, 04:00 AM
No problem on supplying the script..I'll tighten a few things up and post it tonight or tomorrow. Its not pretty but it is already working. I might add some UI...and logging features.

I am rendering using the Maya Software Renderer....yup..people still use that. ;) I am working on a 15 min short and MR would just require tooo much. Maybe the next personal project.

Any luck on the caching?

-M

jaygarrison3d
05-19-2010, 04:11 AM
Oh no shame in Maya Software. I still use it for certain things.

Unfortunately the set i'm using has a lot of blocking geometry so that I can cleanly composite it. Some of it has to be smoothed at Render time to be clean.

But other than the hair it's pretty light.

I have not yet tried caching after reading that it didn't help you. I've got about 30 over a 360 frame animation. Really hoping to avoid that. But it's on the list.

I've mainly been trying a few things in the render settings. Like limiting the RAM, switching Mental Rays translation to "hair shader" instead of "primitive". Yeah, that started causing crashes immediately.

As an experiment I did render a wig moving left to right with a few spot lights. There was almost ZERO delay between frames.

So i'm going to monkey with a few more settings, remove some lights, and if that doesn't work i'll try the data cache.

mswertfager
05-20-2010, 05:11 PM
Duncan (chief scientist and creator of pfx at Autodesk) found a workaround...basically set the hairSystem's dynamics start frame to the exact frame you will be starting your renderings on. For instance, if the command line renderer is to start on frame 50, then set the hairSystem dynamics start frame value to match.

more information about the work around can be found at http://area.autodesk.com/forum/autodesk-maya/lighting---rendering/eliminate-hair-run-up-on-batch-render/

-M

P.S. Ill still post the In Maya Rendering tool...I have just a few tweaks left.

P.S.S. For quickly setting the dynamics start frame on all your hair system, here are a couple of scripts (the 1st is in a cut an paste...and the second is for those who want to make a procedure/command to set the start frame.

/////////////////////////////////////////////////////////////////////////////////////
//As a non-procedure MEL script to simply cut and paste into your script editor
// Update the 1st variable $setStartFrameTo to the frame value you want to hairSystems to be updated to

int $setStartFrameTo = 1000;
string $attributeSet;
$hairSystemNames = `ls -exactType hairSystem`;

for ($hairSystemSpecific in $hairSystemNames)
{
print ("\n"+$hairSystemSpecific+" set to +$setStartFrameTo)
$attributeSet = $hairSystemSpecific+".startFrame";
setAttr $attributeSet $setStartFrameTo;
}

////////////////////////////////////////////////////////////////////////
//Procedure based MEL script so you can use this as a command
//run this procedure...execute by typing setHairStartFrame (insert number)
//EXAMPLE setHairStartFrame (50)

global proc setHairStartFrame (int $setStartFrameTo)
{
string $attributeSet;
$hairSystemNames = `ls -exactType hairSystem`;

for ($hairSystemSpecific in $hairSystemNames)
{
print ("\n"+$hairSystemSpecific+" set to +$setStartFrameTo)
$attributeSet = $hairSystemSpecific+".startFrame";
setAttr $attributeSet $setStartFrameTo;
}
}

jaygarrison3d
05-22-2010, 02:12 AM
Cool! :bowdown:

I'll give it a shot. Do I have to do anything special to the script? I have about 30 freaking hair systems in my scene. Will this script apply it to all of them individually or does it apply it globally?

Thanks for finding that.

I did just have a little luck with mine. I had the hair just parented to the heads. But the heads were all driven by a parent constraint. Once I parented the wigs to the actual moving geometry the renders seemed to become more stable. Render times seemed to go down too, sometimes around 4 minutes some times as high as 20. :shrug:

If this script does the trick my render times may significantly drop. I doubt I get to it tonight, let me know if it works for you.

mswertfager
05-22-2010, 04:50 AM
No need to change the script it should select each hair system in your scene and update them individually. I have around 20 with all my chars in the shot.

After implementing the work around I have been getting 0 runup versus 8 hours for one shot. (lol). It was just in time, as I finished scripting the in application Rendering tool. After I finish this walk cycle Ill post it on my website and on deviant. It works well for how I do my rendering. Ill give you a shout. when it is up.This way if the work arounds don't fix all your probs this may help.

FYI: the issue presents itself across a lot of dynamics and some do not have a work around (e.g. 2d fluid systems with texture animation only still get a runup). I have a feeling I will still be calling on the render script tool.

-M

jaygarrison3d
05-24-2010, 04:40 AM
I ran the script and got this error.

// Error: print ("\n"+$hairSystemSpecific+" set to +$setStartFrameTo) //
// Error: Unterminated string. //

In full disclosure, MEL is not my thing. I know just enough to get me in trouble. I copy and pasted that into the MEL command line. I'm probably missing something obvious :-P

arkangel-fx
05-24-2010, 06:06 AM
I ran the script and got this error.

// Error: print ("\n"+$hairSystemSpecific+" set to +$setStartFrameTo) //
// Error: Unterminated string. //

In full disclosure, MEL is not my thing. I know just enough to get me in trouble. I copy and pasted that into the MEL command line. I'm probably missing something obvious :-P

If you look carefully... that line of code has an error, a typo:
" set to

should be:

" set to "

GL!

Cristian
PS: Here is the clean script:

int $setStartFrameTo = 1000;
string $attributeSet;
$hairSystemNames = `ls -exactType hairSystem`;

for ($hairSystemSpecific in $hairSystemNames)
{
print ("\n"+$hairSystemSpecific+" set to "+$setStartFrameTo)
$attributeSet = $hairSystemSpecific+".startFrame";
setAttr $attributeSet $setStartFrameTo;
}

////////////////////////////////////////////////////////////////////////
//Procedure based MEL script so you can use this as a command
//run this procedure...execute by typing setHairStartFrame (insert number)
//EXAMPLE setHairStartFrame (50)

global proc setHairStartFrame (int $setStartFrameTo)
{
string $attributeSet;
$hairSystemNames = `ls -exactType hairSystem`;

for ($hairSystemSpecific in $hairSystemNames)
{
print ("\n"+$hairSystemSpecific+" set to "+$setStartFrameTo)
$attributeSet = $hairSystemSpecific+".startFrame";
setAttr $attributeSet $setStartFrameTo;
}
}

jaygarrison3d
05-24-2010, 04:40 PM
LOL

It's always something. I don't pretend to be able to write any of that from scratch, but usually I can spot a typo, an extra space, or something. I never would have caught that.

I'll try it in a few hours. Thanks!

jaygarrison3d
06-02-2010, 02:46 AM
Just got back to revisiting this project.

Still no joy on the script. I just get this...

// Error: $attributeSet = $hairSystemSpecific+".startFrame"; //
// Error: Syntax error //

I should probably no better. Mel is kind of over my head. Thanks for all the help anyway.

arkangel-fx
06-02-2010, 02:59 AM
that line of code is ok, are you sure the error isn't coming from a previous line of the script?

PS: I've been having some fun with hairs and i worked out a script to get hairSystem seed variants with cache, which then get combined into 1 scene and rendered with batch render. I didnt have any trouble with runups. Have you tried with 3delight o renderman?

mswertfager
06-02-2010, 04:28 AM
Hi macmayaguy,

I apologize for not posting this sooner. The script I created "YoRender" has a full GUI. You can download it from my blog ( http://thetell-taleheart.com/blog/ ). It also contains step by step instructions within the GUI to try and make the process easier for those who are not MEL savvy.

Hope it works for ya. It was created and tested on XP. Hopefully it will work fine on Mac. If not give me a shout.

-Michael

CGTalk Moderation
06-02-2010, 04:28 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.