Batch render doesn't render scripted animation

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Display Modes
  07 July 2013
Batch render doesn't render scripted animation


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.


Last edited by GoodAsNew : 07 July 2013 at 11:56 AM. Reason: some nonsense sentence..
  07 July 2013
Why not just bake the animation before rendering?

  07 July 2013
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
  07 July 2013
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.

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>>;


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.
  07 July 2013
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.
  07 July 2013
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
  07 July 2013
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.
  07 July 2013
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

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
Society of Digital Artists

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

All times are GMT. The time now is 04:34 AM.

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