CGTalk > Software > Autodesk Maya
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 07-15-2013, 11:52 AM   #1
GoodAsNew
Veteran
portfolio
Harri Aaltonen
Espoo, Finland
 
Join Date: Aug 2009
Posts: 66
Batch render doesn't render scripted animation

Hi,

I'm trying to animate via script. I made a test procedure that moves a sphere around depending on the currentTime, then i made an expression that runs the procedure.

This works fine while i scrub the timeline but when i try to batch render it renders the frames like nothing is happening.

So, what i'm missing here?

Here's the test procedure:

global proc float sphereAnim()
{
float $time=`currentTime -q`;
return sin(($time/24)*3.141593);
}

Then i made a expression like this:

pSphere1.translateX = sphereAnim();


What i'm working on is a primitive crowd simulation script that randomizes instance sequences in a particle instancer.

I try to avoid very long expressions because the script is automating the expression creation aswell. It would get slightly messy if i had hundreds of lines as a string.

The randomizer works fine except for this batch render issue.

First i thought the currentTime is causing the issue but i had a procedure that aims the particles at a target locator which doesn't use currentTime at all. It didn't render either.

Thanks

Last edited by GoodAsNew : 07-15-2013 at 11:56 AM. Reason: some nonsense sentence..
 
Old 07-15-2013, 08:23 PM   #2
Horganovski
Freelance Animator/Rigger
 
Horganovski's Avatar
portfolio
Brian Horgan
Graphite9
Dublin, Ireland
 
Join Date: Apr 2007
Posts: 4,879
Why not just bake the animation before rendering?

Cheers,
Brian
 
Old 07-15-2013, 11:29 PM   #3
gmask
Obfuscator
 
gmask's Avatar
gmask
Power Sitting
Topanga, USA
 
Join Date: Oct 2002
Posts: 6,937
I'm not sure if this is a problem but since you are using an expression then you could use frame instead `currentTime -q`
__________________
blah blah blah
 
Old 07-16-2013, 12:33 PM   #4
GoodAsNew
Veteran
portfolio
Harri Aaltonen
Espoo, Finland
 
Join Date: Aug 2009
Posts: 66
I'm not sure how to bake animation from an particle instancer. The animation frames are already baked into separate meshes so that i can play them as a sequence from a particle instancer.

currentTime returns the current frame. I haven't found any other command for this.

Tho i'm pretty sure it's not causing the issue because the aim proc didn't work either which doesn't use currentTime.

This just rotates the particles in Y axis.

Code:
global proc vector pRotPP(vector $ppPos, string $tgNam) { string $tgPosXNam = $tgNam+".translateX" ; string $tgPosZNam = $tgNam+".translateZ" ; float $tgPosX = `getAttr $tgPosXNam`; float $tgPosZ = `getAttr $tgPosZNam`; float $ptRotY = rad_to_deg(atan2($ppPos.x-$tgPosX,$ppPos.z-$tgPosZ)); return <<0,$ptRotY,0>>; }


Expression.

Code:
nParticleShape1.rotationPP = pRotPP(nParticleShape1.position, "aimtg_1");


Maybe the problem is that the procedures aren't automatically loaded when the scene is opened. When the batch renderer makes the backup of the scene it can't find the procedures.

So maybe I need to make the scene load the procedures at startup?

I'll try to figure how to do that. Hope it works.

Thanks for input.
 
Old 07-16-2013, 01:45 PM   #5
GoodAsNew
Veteran
portfolio
Harri Aaltonen
Espoo, Finland
 
Join Date: Aug 2009
Posts: 66
I copy pasted the procedures at the end of the scene file. Now they load at startup and i don't need to execute them everytime i open the scene, but the batch renderer still doesn't understand the procedures.
 
Old 07-16-2013, 10:29 PM   #6
gmask
Obfuscator
 
gmask's Avatar
gmask
Power Sitting
Topanga, USA
 
Join Date: Oct 2002
Posts: 6,937
Quote:
Originally Posted by GoodAsNew
I copy pasted the procedures at the end of the scene file. Now they load at startup and i don't need to execute them everytime i open the scene, but the batch renderer still doesn't understand the procedures.


put the procedures in the expression.. it's not ideal but it should work.. otherwise create a scriptNode that sources them when the file is loaded for rendering
__________________
blah blah blah
 
Old 07-17-2013, 10:27 AM   #7
GoodAsNew
Veteran
portfolio
Harri Aaltonen
Espoo, Finland
 
Join Date: Aug 2009
Posts: 66
I tried the script node. Seems like a handy tool. Tho It didn't solve the batch render problem. I tried with different settings like time changed and software frame render(that probably works only with software renderer?). I also tried just adding the procedures to the scene configuration(internal). The time changed mode seems to work in the viewport pretty well.

After failing with that scriptNode i made an expression out of the procedures and the batch rendering worked. I'll probably do it this way then.

I'll look into it next week.

Thanks for all the help.
 
Old 07-17-2013, 10:27 AM   #8
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,480
Thread automatically closed

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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 05:09 AM.


Powered by vBulletin
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.