object.collision was allocating on access for all object types - camera could get...
authorCampbell Barton <ideasman42@gmail.com>
Mon, 18 Apr 2011 01:45:28 +0000 (01:45 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 18 Apr 2011 01:45:28 +0000 (01:45 +0000)
now check for mesh types only.

any other type will return None.

source/blender/makesrna/intern/rna_object.c

index babc413e27408302172d8753d0ad4566ecd10e22..a30b5d4eb051eaf2ace0d71a07058be99747aa25 100644 (file)
@@ -1059,6 +1059,9 @@ static PointerRNA rna_Object_collision_get(PointerRNA *ptr)
 {
        Object *ob= (Object*)ptr->id.data;
 
 {
        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);
        /* weak */
        if(!ob->pd)
                ob->pd= object_add_collision_fields(0);