From 6d070e47c1862b76a0e0b56ee697c8828a15b866 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 13 Mar 2013 15:27:54 +0000 Subject: [PATCH] Fix [#34621] I18n Switch Issue When Gimbal and Rotation Manipulator On. Real issue was that transform manipulators' code was calling TRANSFORM_OT_trackball with data (PointerRNA) from VIEW3D_OT_manipulator. That op has constraints props, while trackball has not. This created some kind of "ghost" properties, that showed up in redo panel. Why this only segfaults in BLF_pgettext in 32bit builds remains a deep mystery (currently dusting out my 32 vbox to try to understand it...). BLF_pgettext is supposed to be pretty secure. :/ --- .../blender/editors/transform/transform_manipulator.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index 968e1ec94d0..bea1f9da057 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -1861,8 +1861,15 @@ int BIF_do_manipulator(bContext *C, const struct wmEvent *event, wmOperator *op) //wm_operator_invoke(C, WM_operatortype_find("TRANSFORM_OT_resize", 0), event, op->ptr, NULL, FALSE); } else if (drawflags == MAN_ROT_T) { /* trackball need special case, init is different */ - WM_operator_name_call(C, "TRANSFORM_OT_trackball", WM_OP_INVOKE_DEFAULT, op->ptr); - //wm_operator_invoke(C, WM_operatortype_find("TRANSFORM_OT_trackball", 0), event, op->ptr, NULL, FALSE); + /* Do not pass op->ptr!!! trackball has no "constraint" properties! + * See [#34621], it's a miracle it did not cause more problems!!! */ + /* However, we need to copy the "release_confirm" property... */ + PointerRNA props_ptr; + WM_operator_properties_create(&props_ptr, "TRANSFORM_OT_trackball"); + RNA_boolean_set(&props_ptr, "release_confirm", RNA_boolean_get(op->ptr, "release_confirm")); + + WM_operator_name_call(C, "TRANSFORM_OT_trackball", WM_OP_INVOKE_DEFAULT, &props_ptr); + //wm_operator_invoke(C, WM_operatortype_find("TRANSFORM_OT_trackball", 0), event, NULL, NULL, FALSE); } else if (drawflags & MAN_ROT_C) { switch (drawflags) {