• You are not logged in. | Login

Post a reply

#1    March 9, 2010 5:15 pm

bluehonda
Member
Ranks
Registered: September 11, 2006
Posts: 32
Reputation :   

Can anyone help me with this script for RF?

Im trying to make batch script in RealFlow. I created a sphere in RF. Then I would want to use this batch script.

emitter = scene.addEmitter("Fill Object")
emitter.setName("Filler Emitter")
emitter.setParameter("Type", "Dumb")
emitter.setParameter("Object", "Sphere01")
emitter.setParameter("Fill Volume", "Yes") -> It wont set the Fill Volume parameter to Yes.

The last line is wrong. I would like to control the Fill Object emitter's - Fill Volume Parameter. But it won't setParameter to Yes. So that when i run the script it would automatically fill the sphere.

I'm just new to python. My knowledge in this is 0.00001. So pls bear with what i know so far. Im trying to learn python.

Hope someone can help here.

Thanks

Last edited by bluehonda (March 9, 2010 5:17 pm)


 

 

#2    March 9, 2010 7:35 pm

shaun_michael
Moderator
Moderator
United Kingdom
Gender:
Registered: September 10, 2006
Posts: 4778
Reputation :   95 

Re: Can anyone help me with this script for RF?

Assuming you already have an object in your scene called Sphere01:-

emitter.setParameter("Fill Volume", True)

Shaun


 

 

#3    March 10, 2010 3:22 am

bluehonda
Member
Ranks
Registered: September 11, 2006
Posts: 32
Reputation :   

Re: Can anyone help me with this script for RF?

Ah! yes. you are right shaun. I've been trying to do - emitter.setParameter("Fill Volume", "True"). And it wouldn't work.  So I didnt need the quotations.

Next I want to do is, (If its possible) is to fill volume on the object emitter on every frame.  and then export that into bin files.  Not fill volume then simulate. But fill volume on frame 1, then save that as a bin. then unfill. then go to frame 2, then fill volume again. then save out bin. so on and so forth. Still dont know how it will happen. But it should be possible. 

Thanks Shaun. Good day to you.


 

 

#4    March 10, 2010 10:01 am

Anaxarchos
Member
Ranks
Germany
Gender:
From: Cologne
Registered: March 19, 2008
Posts: 447
Reputation :   

Re: Can anyone help me with this script for RF?

If you just want to fill a volume over and over again in only one frame, you don't need any more bin files than your frame 1, just duplicate it or increment the frame count using Python's string operations (or a renaming tool).


 

 

#5    March 10, 2010 11:01 am

bluehonda
Member
Ranks
Registered: September 11, 2006
Posts: 32
Reputation :   

Re: Can anyone help me with this script for RF?

Im actually starting this script so i can use it for something else than a sphere, later on. like a character with animation. So i can fill it everyframe. and later on use a bin loader to import all partcile bins and have  particles animating like the character.

thanks for the inputs.


 

 

#6    March 10, 2010 6:41 pm

lukeiamyourfather
Moderator
Moderator
United States
Gender:
From: Texas
Registered: October 15, 2007
Posts: 2555
Reputation :   44 
Visit website

Re: Can anyone help me with this script for RF?

bluehonda wrote:

Im actually starting this script so i can use it for something else than a sphere, later on. like a character with animation. So i can fill it everyframe. and later on use a bin loader to import all partcile bins and have  particles animating like the character.

thanks for the inputs.

Turn the fill parameter on and off for each frame and it should refill anew. Cheers!


 

 

#7    March 11, 2010 3:40 pm

bluehonda
Member
Ranks
Registered: September 11, 2006
Posts: 32
Reputation :   

Re: Can anyone help me with this script for RF?

yes, luke. that is how i do it. its the manual way. but imagine filling a character, in which you need a high resolution. and you have 300 frames of animation.


 

 

#8    March 11, 2010 6:53 pm

lukeiamyourfather
Moderator
Moderator
United States
Gender:
From: Texas
Registered: October 15, 2007
Posts: 2555
Reputation :   44 
Visit website

Re: Can anyone help me with this script for RF?

bluehonda wrote:

yes, luke. that is how i do it. its the manual way. but imagine filling a character, in which you need a high resolution. and you have 300 frames of animation.

Use an event script, push F11 to get the dialog. During the simulation the script will run and do its thing. Cheers!


 

 

#9    March 11, 2010 7:10 pm

lukeiamyourfather
Moderator
Moderator
United States
Gender:
From: Texas
Registered: October 15, 2007
Posts: 2555
Reputation :   44 
Visit website

Re: Can anyone help me with this script for RF?

lukeiamyourfather wrote:

bluehonda wrote:

yes, luke. that is how i do it. its the manual way. but imagine filling a character, in which you need a high resolution. and you have 300 frames of animation.

Use an event script, push F11 to get the dialog. During the simulation the script will run and do its thing. Cheers!

Or since its just filled particles on each frame a batch script would work better. Wasn't thinking through it all. Something like this should work, but I don't have RealFlow in front of me to test it.

emitter = scene.getEmitter("FillObject01")
for frame in range (0,240):
    scene.setCurrentFrame(frame)
    emitter.setParameter("Fill object", False)
    emitter.setParameter("Fill object", True)
    emitter.export()

 

 

#10    March 13, 2010 9:42 am

bluehonda
Member
Ranks
Registered: September 11, 2006
Posts: 32
Reputation :   

Re: Can anyone help me with this script for RF?

lukeiamyourfather - O you! Python Scripter you! This worked! Thankyou thankyou.

emitter = scene.getEmitter("Fill_Object01")
for frame in range (0,20): 
    scene.setCurrentFrame(frame)
    emitter.setParameter("Fill Volume", False)
    emitter.setParameter("Fill Volume", True)
    emitter.export()

 

 

#11    March 13, 2010 10:12 am

lukeiamyourfather
Moderator
Moderator
United States
Gender:
From: Texas
Registered: October 15, 2007
Posts: 2555
Reputation :   44 
Visit website

Re: Can anyone help me with this script for RF?

bluehonda wrote:

lukeiamyourfather - O you! Python Scripter you! This worked! Thankyou thankyou.

emitter = scene.getEmitter("Fill_Object01")
for frame in range (0,20): 
    scene.setCurrentFrame(frame)
    emitter.setParameter("Fill Volume", False)
    emitter.setParameter("Fill Volume", True)
    emitter.export()

Python is awesome, and I'm glad RealFlow uses it. If you want to learn how to script in RealFlow start with the free user guide in the docs folder of the RealFlow install. There's a very generous section on scripting by Mark from Fusion CIS. Also see the scripting reference in the help to get an overview of the commands. Cheers!


 

 

#12    March 13, 2010 4:48 pm

shaun_michael
Moderator
Moderator
United Kingdom
Gender:
Registered: September 10, 2006
Posts: 4778
Reputation :   95 

Re: Can anyone help me with this script for RF?

O you! Python Scripter you!

lol, yeah, what he said!

smiley-ph34r


 

 

#13    May 27, 2010 9:30 pm

bitSeq
Member
Ranks
United Kingdom
Gender:
From: +447845129516
Registered: July 10, 2008
Posts: 331
Reputation :   

Re: Can anyone help me with this script for RF?

I am having trouble running this script

emitter = scene.getEmitter("Fill_Object01")
for frame in range (0,20):
    scene.setCurrentFrame(frame)
    emitter.setParameter("Fill Volume", False)
    emitter.setParameter("Fill Volume", True)
    emitter.export()

I keep getting a syntax error on the highlighted line?

Running this at "onSimulationFrame"

Sorry I don't have any scripting knowledge... yet


*** OK OK! Its the damn spacing! ***

Last edited by bitSeq (May 27, 2010 9:47 pm)


 

 

#14    May 27, 2010 9:56 pm

shaun_michael
Moderator
Moderator
United Kingdom
Gender:
Registered: September 10, 2006
Posts: 4778
Reputation :   95 

Re: Can anyone help me with this script for RF?

Works as a batch script, without altering the spacing from copying/pasting from above post.  And yes, when you copy/paste from here be extra vigilant that tabbing is correct.

Sorry I couldn't get back to you earlier smiley-smile

Shaun

Last edited by shaun_michael (May 27, 2010 10:09 pm)


 

 
  • Actions
  • Rules
  • Top