DY_emitter vs standard emiter

Discussion about scripting with Python
korky
Posts: 2
Joined: Mon Oct 17, 2016 11:44 pm

DY_emitter vs standard emiter

Postby korky » Tue Oct 18, 2016 12:07 am

Sorry, i'm noobie

Just second day of learning scripting in Python RF.
I want to create something like k Volume Daemon, but i want it only in one direction and i don't want it with sharp boarder.
I want particles to remove randomly in time.
So i have wrote this:

Code: Select all

import random

def onSimulationFrame():

   emiter = scene.get_DY_Emitter("DY_Emitter01")
   czasteczka = emiter.getFirstParticle()
   while (czasteczka):
      
      pozycja   = czasteczka.getPosition()
      position_x = pozycja.getX()
      los = random.uniform (0, 10)

      if ((position_x > 1) and (los < 1)):
         emiter.removeParticle(czasteczka.id)

      czasteczka = czasteczka.getNextParticle()

      


When i use standard particles, everything runs ok, but when i use DY_Emitter i got an error with "getFirstParticle()"
What's the problem ? Does DY_Emitter have particles ID ?

And the second problem... To write this little script i needed to explore allot of forums sites to find and understand the commands that i need.
It would be alot easier, if there would be just compedium of all commands with nice search engine.
Cant find anything by this help on site :http://support.nextlimit.com/display/rf2015docs/RealFlow+2015+Documentation
I was trying to use program help- Help/Realflow help... i'm find commands by index search, but when i'm try to read obuut it i got only blank page with "Loading..." . Why my help is not loading ?


User avatar
ChristianZ
Posts: 3253
Joined: Sat Sep 09, 2006 11:37 am
Location: CH

Re: DY_emitter vs standard emiter

Postby ChristianZ » Wed Oct 19, 2016 11:01 am

Hi

sorry, I am not familiar with scripting, nevertheless.... Try to get the help function working in your installation of RF2015, it is a good resource. Maybe you have to use the "reload" command (right-mouseclick) if it does not appear.
RF10 standard, System specs: OSX 10.11, MacPro 4.1 2xXeon, GTX980Ti, 64 GB RAM

korky
Posts: 2
Joined: Mon Oct 17, 2016 11:44 pm

Re: DY_emitter vs standard emiter

Postby korky » Wed Oct 19, 2016 1:23 pm

Thank you ChristianZ.
Reload helped work for me, now i see the content ... which i allready know, cause i allready have read help files in installation directory. Unfortunately it doesn't contain information about how to exacly use command + some excample would be nice.
Mayby there is not much about DY solver, cause it's new...

Thanks for reply anyway. I you're the most helpfull person here :)

Evan.Qiu
Posts: 24
Joined: Wed Oct 26, 2016 2:09 pm

Re: DY_emitter vs standard emiter

Postby Evan.Qiu » Tue Jan 10, 2017 1:25 am

I'm also a beginner of learning RF scripts, I've met same problem when I use 'getFirstParticle()' for Dyverso, it seems the command 'getFirstParticle()' is only for standard particles,


Return to “Python-Scripting”

Who is online

Users browsing this forum: No registered users and 2 guests