independent realflow forum

It is currently Fri Apr 18, 2014 8:44 pm

All times are UTC




Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: Tue Nov 13, 2012 6:51 pm 
Offline

Joined: Thu Sep 27, 2012 12:55 pm
Posts: 28
Hello!

I am currently working on a scene, where I would like to separate the particles, which is collide with an object, and I would like to ask your help. I have a Square emitter, and a Container and an object which is moving.
When the Square emitter particle collide with the object, transfer it to the Container emitter. If there is some filter daemon option or other possible solution without python it would also be great.
I attach my basics of the code:

Code:
obj1 = scene.getObject("obj1")
emitter = scene.getEmitter("Square01")
container_emitter = scene.getEmitter("Container01")

particle = emitter.getFirstParticle()
while (particle):
 
??
  particle = particle.getNextParticle()


I don't know which code will do this for me in the loop. I checked the scripting reference, but I can't find anything good in PB Emitter page.

Thank you, and have a great day!


Top
 Profile  
 
PostPosted: Tue Nov 13, 2012 10:28 pm 
Offline
User avatar

Joined: Fri Apr 02, 2010 12:56 am
Posts: 1151
Location: Swansea
You can do it either way. The filter daemon would be faster in most cases.

I think the filter daemon settings should be something like:

Source Emitters: Square
Target Emitters: Container
Condition: On particle collision

--------

If this doesn't work for you I'll complete your script.

_________________
Otuama - Vimeo
'Strength does not come from physical capacity. It comes from an indomitable will.' - Gandhi
'Realism is in the eye of the beholder' - Me ;)


Top
 Profile  
 
PostPosted: Wed Nov 14, 2012 1:49 am 
Offline

Joined: Thu Sep 27, 2012 12:55 pm
Posts: 28
I tried it, but I had problems. The whole project is going on inside a cube. Therefore, the particles will collide with the inside parts of the cube. I tried to make exemtions with many filter daemon to this way:

1. Filter - On particle collision from the Square to the Container
2. Filter - If the particle get lower/greater than a specified X/Y/Z value, than send back from Container to the Square. /this xyz values are close to the inside borders of the cube/

All the emitters have the same parameters in everything, but when I did it this way, the particles will explode in some areas even high substep values. Can I use some options in the filter daemon, to consider just the wanted obejct in collision detection?


Top
 Profile  
 
PostPosted: Wed Nov 14, 2012 12:17 pm 
Offline
User avatar

Joined: Thu Nov 27, 2008 10:24 am
Posts: 121
Hi bmecohen .

Should be helpful:
- viewtopic.php?f=39&t=8887
- viewtopic.php?f=39&t=8784
- viewtopic.php?f=39&t=7942
- viewtopic.php?f=39&t=6580

Best!

_________________
____________________________________________
http://vimeo.com/bolekcg
http://bolekcg.blogspot.com/


Top
 Profile  
 
PostPosted: Wed Nov 14, 2012 3:15 pm 
Offline

Joined: Thu Sep 27, 2012 12:55 pm
Posts: 28
thanks bolek. I watched all of the sources you gave.
I would like to use filter daemon, because of the simulation speed. I attached a sample file, when I get the problem. I use two filters. First one is particle collide, and the other one is a posY filter, to send back the particles which is collide with the floor. As you can see, the particles until colliding to the sphere is good, but after that some particles will explode. Do you know why?

I would like to do it with filters, instead of the slow python version, but if I don't have a chance to do it this way, I will get a deeper look at the scripted version.


Attachments:
File comment: test scene
test.rar [41.75 KiB]
Downloaded 57 times
Top
 Profile  
 
PostPosted: Thu Nov 15, 2012 12:30 pm 
Offline

Joined: Fri Jan 28, 2011 2:23 pm
Posts: 88
or maybe check this one: viewtopic.php?f=34&t=8288
It's an really easy script and it's based on an example script from the manual.
It is example 3 in the pb_particle scripting reference.

_________________
http://www.christophpantel.com


Top
 Profile  
 
PostPosted: Fri Nov 16, 2012 8:13 am 
Offline

Joined: Thu Sep 27, 2012 12:55 pm
Posts: 28
thanks chrispan! I have done it that way, and it worked! It is a little bit slower but much easier method. I think the filter daemon is a really awesome feature, but it would be better, if the colliding objects could be selected.


Top
 Profile  
 
PostPosted: Fri Nov 16, 2012 10:59 am 
Offline

Joined: Fri Jan 28, 2011 2:23 pm
Posts: 88
cool. yeah I thought the same about the filter. maybe some changes in RF 2013

_________________
http://www.christophpantel.com


Top
 Profile  
 
PostPosted: Fri Nov 16, 2012 3:37 pm 
Offline

Joined: Tue Jan 13, 2009 8:09 am
Posts: 287
Hi

Quote:
cool. yeah I thought the same about the filter. maybe some changes in RF 2013


This is also why I added that feature in the IoKillObject plugin. In the current verison one object can be selected and particles can either be killed or transferred, but you can instead apply multiple plugins to the same emitter.

The next version however will support multiple objects and also other emitters.

-Cheers Ole

_________________
Ole Lemming
RealFlow plugin developer
IoSim, Creative Thinking Lab
www.iosim.dk


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group