Problems emitting cubes

Discussion about scripting with Python
aractus
Posts: 2
Joined: Wed Jan 11, 2012 12:55 pm

Problems emitting cubes

Postby aractus » Fri Jan 20, 2012 9:37 pm

Hey guys i was trying to generate some cubes from the colliding points between 2 objects, but i have a few problems:

- sometimes i press "Simulate" and the timeline don't move (and it don't goes yellow)
- the cubes appear at (0,0,0) instead of the colliding vector. And when i press "Reset", the Cubes appear in the right colliding points.
- Even if there're Cubes, when i press "play", the rest of the scene moves correctly but the cubes are frozen.

hope someone can help me. Tx


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

Problems emitting cubes

Postby Otuama » Sat Jan 21, 2012 11:54 pm

Sometimes difficult to determine the problem without seeing the script.

-Sean
iCreate Ltd
'Strength does not come from physical capacity. It comes from an indomitable will.' - Gandhi
'What Does Success Look Like?' - iCreate Ltd

User avatar
bolek
Posts: 121
Joined: Thu Nov 27, 2008 10:24 am
Contact:

Problems emitting cubes

Postby bolek » Sun Jan 22, 2012 12:27 am

Hi Aractus.

Maybe this one will help a bit
http://www.realflowforum.com/view_topic.php?id=8609

It looks like RF doesn't really care about objects created during simulation.

Take care
____________________________________________
http://vimeo.com/bolekcg
http://bolekcg.blogspot.com/

aractus
Posts: 2
Joined: Wed Jan 11, 2012 12:55 pm

Problems emitting cubes

Postby aractus » Mon Jan 23, 2012 2:39 pm

otuama wrote: Sometimes difficult to determine the problem without seeing the script.

-Sean

You are right! I forgot to show the script lines



def onSimulationStep():
import random
obj1 = scene.getObject("Sphere01")
obj2 = scene.getObject("Plane01")
pointList = obj1.getCollisionPoints(obj2)
emitter = scene.getEmitter("Circle01")
for point in pointList:
solido = scene.addCube()
solido.setParameter("Scale", Vector.new(0.5, 0.5, 0.5))
solido.setParameter("Dynamics", "Active rigid body")
solido.setParameter("Position", point)
solido.freezeTransformations
scene.message(str(point))
scene.message(str(solido.position))




Return to “Python-Scripting”

Who is online

Users browsing this forum: No registered users and 2 guests