Update for changes to Python API
authorCampbell Barton <ideasman42@gmail.com>
Mon, 11 Jan 2016 06:54:07 +0000 (17:54 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 11 Jan 2016 06:54:07 +0000 (17:54 +1100)
object_drop_to_ground.py

index fd1bb9fcd1204e8596496836f65382cf8b9b5557..e4bf607117fcda77dde5612875ae94f017010113 100644 (file)
@@ -104,9 +104,8 @@ def drop_objects(self, context):
         if not lowest_world_co:
             print(ob.type, 'is not supported. Failed to drop', ob.name)
             continue
-        hit_location, hit_normal, hit_index = tmp_ground.ray_cast(lowest_world_co,
-                                                                  lowest_world_co + down)
-        if hit_index == -1:
+        is_hit, hit_location, hit_normal, hit_index = tmp_ground.ray_cast(lowest_world_co, down)
+        if not is_hit:
             print(ob.name, 'didn\'t hit the ground')
             continue