syntax for passive object

Discussion about scripting with Python
mcermak
Posts: 30
Joined: Mon Oct 22, 2007 3:00 am
Contact:

syntax for passive object

Postby mcermak » Thu Apr 26, 2012 4:50 pm

Hey Guys

I am trying to call for all the passive rigid bodies that get collided on?
Is there a way to write that?
Thank you
M


User avatar
Calibrix
Posts: 122
Joined: Tue Mar 25, 2008 9:57 pm
Contact:

Re: syntax for passive object

Postby Calibrix » Fri Apr 27, 2012 6:00 pm

Making a list of your passive objects should be easy enough.

objects = scene.getObjects()
passiveList = objects
for obj in objects :
if obj.getParameter('Dynamics') != 'Passive rigid body' :
passiveList.remove(obj)

not sure how to grab only objects that have collisions. It looks like RF wants make a list of objects colliding with a checked object. You could possibly iterate though your list of passive objects and filter them based on the len(list). If they generate empty lists then they aren't colliding, this is assuming that no collision still generates a list.
www.cw-fx.com


Return to “Python-Scripting”

Who is online

Users browsing this forum: No registered users and 1 guest