Filling script not working

Discussions about the use of Realflow
Andrew88
Posts: 10
Joined: Thu Jul 11, 2013 9:56 am

Filling script not working

Postby Andrew88 » Sat May 03, 2014 5:03 pm

Hi there, in the last few months i have been trying to get this script working for me. what it does is that it turns the fill emitter on and off and export the bin file at each frame. it will preserve the particle volume.
today i finally got all the errors away and the syntax is ok :)

but for some reason the script only exports the current frame and not the whole sequence.
i hope someone here has some scripting skills.
the script:
----------------------------------------------
emit = scene.get_PB_Emitter("Fill_Object01")
minF = scene.getMinFrame()
maxF = scene.getMaxFrames()
for i in range( minF, maxF + 1):
emit.setParameter("Fill Volume", False)
emit.setParameter("Fill Volume", True)
emit.export()
scene.setCurrentFrame(i)
-------------------------------------
And by the way, the script comes from a tutorial from LuisM
thanks :)


User avatar
Otuama
Posts: 1155
Joined: Fri Apr 02, 2010 12:56 am
Location: Swansea
Contact:

Re: Filling script not working

Postby Otuama » Sat May 03, 2014 9:03 pm

Seems to be working ok for me..

Did you intent it correctly?

Code: Select all

emit = scene.get_PB_Emitter("Fill_Object01")
minF = scene.getMinFrame()
maxF = scene.getMaxFrames()
for i in range( minF, maxF + 1):
   emit.setParameter("Fill Volume", False)
   emit.setParameter("Fill Volume", True)
   emit.export()
   scene.setCurrentFrame(i)
iCreate Ltd
'Strength does not come from physical capacity. It comes from an indomitable will.' - Gandhi
'What Does Success Look Like?' - iCreate Ltd

Andrew88
Posts: 10
Joined: Thu Jul 11, 2013 9:56 am

Re: Filling script not working

Postby Andrew88 » Sat May 03, 2014 10:56 pm

Hi again :)

I just copied your script to realflow and now the script works, thanks :)
apparently the scene.setCurrentFrame(i) was not declared as an commando or whatever it is called.
also it seems like the emit. commandos had to be placed in specific places. i have no idea what syntax rules applies to realflow scripting.

sorry if i seem like a complete noob but in all my years as a freelancer 3d artist i have never really touched any sort of scripting or programming.

but thanks man for helping me out :)

User avatar
Otuama
Posts: 1155
Joined: Fri Apr 02, 2010 12:56 am
Location: Swansea
Contact:

Re: Filling script not working

Postby Otuama » Sun May 04, 2014 12:33 am

No probs. Glad it works.

For future reference, indentations are very important in Python.
iCreate Ltd
'Strength does not come from physical capacity. It comes from an indomitable will.' - Gandhi
'What Does Success Look Like?' - iCreate Ltd


Return to “Realflow”

Who is online

Users browsing this forum: No registered users and 4 guests