Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-04-18 05:40:45 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-04-18 05:40:45 +0400
commitd95e572227418c3119a7dc91a605dcc2c10c5237 (patch)
treee085247b27117bb6098a2cf24c04eb6a07dcd833
parent8b2a3c250a7faf59c7f8549960737ef40f4ff29c (diff)
fix [#26995] Crash on bpy.context.object.collision
use object.collision rather then object.modifiers[...].settings
-rw-r--r--source/blender/makesrna/intern/rna_object_force.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c
index 9aedcab1301..13fac68bf9f 100644
--- a/source/blender/makesrna/intern/rna_object_force.c
+++ b/source/blender/makesrna/intern/rna_object_force.c
@@ -322,10 +322,21 @@ static void rna_PointCache_frame_step_range(PointerRNA *ptr, int *min, int *max)
static char *rna_CollisionSettings_path(PointerRNA *ptr)
{
+ /* both methods work ok, but return the shorter path */
+#if 0
Object *ob= (Object*)ptr->id.data;
ModifierData *md = (ModifierData *)modifiers_findByType(ob, eModifierType_Collision);
-
- return BLI_sprintfN("modifiers[\"%s\"].settings", md->name);
+
+ if(md) {
+ return BLI_sprintfN("modifiers[\"%s\"].settings", md->name);
+ }
+ else {
+ return BLI_strdup("");
+ }
+#else
+ /* more reliable */
+ return BLI_strdup("collision");
+#endif
}
static int rna_SoftBodySettings_use_edges_get(PointerRNA *ptr)