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.
This commit is contained in:
Campbell Barton
2011-04-18 01:45:28 +00:00
parent d95e572227
commit 66bf6487df

View File

@@ -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);