diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/object/object_constraint.c | 16 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_armature.c | 14 |
2 files changed, 23 insertions, 7 deletions
diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index 344c2c13861..f695f112bc0 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -531,11 +531,20 @@ static bConstraint *edit_constraint_property_get(wmOperator *op, Object *ob, int bPoseChannel *pchan= get_active_posechannel(ob); if (pchan) list = &pchan->constraints; - else + else { + //if (G.f & G_DEBUG) + //printf("edit_constraint_property_get: No active bone for object '%s'\n", (ob)? ob->id.name+2 : "<None>"); return NULL; + } + } + else { + //if (G.f & G_DEBUG) + //printf("edit_constraint_property_get: defaulting to getting list in the standard way\n"); + list = get_active_constraints(ob); } con = constraints_findByName(list, constraint_name); + printf("constraint found = %p, %s\n", con, (con)?con->name:"<Not found>"); if (con && (type != 0) && (con->type != type)) con = NULL; @@ -645,8 +654,11 @@ static int childof_set_inverse_exec (bContext *C, wmOperator *op) bPoseChannel *pchan= NULL; /* despite 3 layers of checks, we may still not be able to find a constraint */ - if (data == NULL) + if (data == NULL) { + printf("DEBUG: Child-Of Set Inverse - object = '%s'\n", (ob)? ob->id.name+2 : "<None>"); + BKE_report(op->reports, RPT_ERROR, "Couldn't find constraint data for Child-Of Set Inverse"); return OPERATOR_CANCELLED; + } /* try to find a pose channel */ // TODO: get from context instead? diff --git a/source/blender/makesrna/intern/rna_armature.c b/source/blender/makesrna/intern/rna_armature.c index 61f6176fb25..3dc52a5c4e2 100644 --- a/source/blender/makesrna/intern/rna_armature.c +++ b/source/blender/makesrna/intern/rna_armature.c @@ -66,12 +66,16 @@ static void rna_Armature_act_bone_set(PointerRNA *ptr, PointerRNA value) } else { if(value.id.data != arm) { - /* raise an error! */ - } - else { - arm->act_bone= value.data; - arm->act_bone->flag |= BONE_SELECTED; + Object *ob = (Object *)value.id.data; + + if(GS(ob->id.name)!=ID_OB || (ob->data != arm)) { + printf("ERROR: armature set active bone - new active doesn't come from this armature\n"); + return; + } } + + arm->act_bone= value.data; + arm->act_bone->flag |= BONE_SELECTED; } } |