fix for missing typecheck on hook-assign operator.
authorCampbell Barton <ideasman42@gmail.com>
Wed, 13 Feb 2013 15:03:36 +0000 (15:03 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 13 Feb 2013 15:03:36 +0000 (15:03 +0000)
fix for POSELIB_OT_pose_rename getting an enum as an int.

source/blender/editors/armature/poselib.c
source/blender/editors/object/object_hook.c

index b2c1b7fdcd0a26db2342f5dedf5284b321c0258f..48c0a4a38c39c2bf54b3b7de946511d170c67db3 100644 (file)
@@ -663,7 +663,7 @@ static int poselib_rename_exec(bContext *C, wmOperator *op)
        }
        
        /* get index (and pointer) of pose to remove */
-       marker = BLI_findlink(&act->markers, RNA_int_get(op->ptr, "pose"));
+       marker = BLI_findlink(&act->markers, RNA_enum_get(op->ptr, "pose"));
        if (marker == NULL) {
                BKE_report(op->reports, RPT_ERROR, "Invalid index for pose");
                return OPERATOR_CANCELLED;
index caeff1e82a7e608129610eb9b638a630d2c87561..7060c69cb9e09213c0d60a3593927026559563b0 100644 (file)
@@ -798,7 +798,7 @@ static int object_hook_assign_exec(bContext *C, wmOperator *op)
                ob = CTX_data_edit_object(C);
                hmd = (HookModifierData *)BLI_findlink(&ob->modifiers, num);
        }
-       if (!ob || !hmd) {
+       if (!ob || !hmd || (hmd->modifier.type != eModifierType_Hook)) {
                BKE_report(op->reports, RPT_ERROR, "Could not find hook modifier");
                return OPERATOR_CANCELLED;
        }