diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-04-18 05:45:28 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-04-18 05:45:28 +0400 |
commit | 66bf6487dfc624c1423053cd570bbe720ae20cf2 (patch) | |
tree | b6b01f361dcf8d7d0a6b337414698235f25ea991 | |
parent | d95e572227418c3119a7dc91a605dcc2c10c5237 (diff) |
object.collision was allocating on access for all object types - camera could get collision data for eg.
now check for mesh types only.
any other type will return None.
-rw-r--r-- | source/blender/makesrna/intern/rna_object.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index babc413e274..a30b5d4eb05 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -1059,6 +1059,9 @@ static PointerRNA rna_Object_collision_get(PointerRNA *ptr) { Object *ob= (Object*)ptr->id.data; + if(ob->type != OB_MESH) + return PointerRNA_NULL; + /* weak */ if(!ob->pd) ob->pd= object_add_collision_fields(0); |