Fix T43776: Rigging : Clear User transform is not working when mesh is in weight paint mode.

Use same trick as for regular 'clear transform' operators to get a valid armature
in weight paint mode (where active object is weight-painted one).
This commit is contained in:
Bastien Montagne 2015-02-23 12:23:13 +01:00
parent 8ee2b01b04
commit ec36e3ae80
Notes: blender-bot 2023-02-14 09:27:19 +01:00
Referenced by issue #43776, Rigging : Clear User transform is not working when mesh is in weight paint mode
2 changed files with 2 additions and 2 deletions

View File

@ -811,7 +811,7 @@ void POSE_OT_transforms_clear(wmOperatorType *ot)
static int pose_clear_user_transforms_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
Object *ob = CTX_data_active_object(C);
Object *ob = BKE_object_pose_armature_get(CTX_data_active_object(C));
float cframe = (float)CFRA;
const bool only_select = RNA_boolean_get(op->ptr, "only_selected");

View File

@ -391,7 +391,7 @@ int ED_operator_editarmature(bContext *C)
* \brief check for pose mode (no mixed modes)
*
* We want to enable most pose operations in weight paint mode,
* when it comes to transforming bones, but managing bomes layers/groups
* when it comes to transforming bones, but managing bones layers/groups
* can be left for pose mode only. (not weight paint mode)
*/
int ED_operator_posemode_exclusive(bContext *C)