Commit: f6a814554a94bf0f0904a0e9b67e4fcc4d403c6b
Author: Julian Eisel
Date:   Thu Sep 29 00:55:35 2016 +0200
Branches: temp_manipulators_core
https://developer.blender.org/rBf6a814554a94bf0f0904a0e9b67e4fcc4d403c6b

Fix some errors in last commit

===================================================================

M       source/blender/windowmanager/intern/wm_event_system.c
M       source/blender/windowmanager/manipulators/intern/wm_manipulatormap.c

===================================================================

diff --git a/source/blender/windowmanager/intern/wm_event_system.c 
b/source/blender/windowmanager/intern/wm_event_system.c
index 03a18fa..d9f387c 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -2114,10 +2114,12 @@ static int wm_handlers_do_intern(bContext *C, wmEvent 
*event, ListBase *handlers
                                /* handle manipulator highlighting */
                                if (event->type == MOUSEMOVE && 
!wm_manipulatormap_get_active_manipulator(mmap)) {
                                        /* TODO should check for both, 2D and 
3D manipulators and choose the one closest to cursor */
-                                       manipulator = 
wm_manipulatormap_find_highlighted_3D(mmap, C, event, &part);
-                                       
wm_manipulatormap_set_highlighted_manipulator(mmap, C, manipulator, part);
-                                       manipulator = 
wm_manipulatormap_find_highlighted_manipulator(mmap, C, event, &part);
-                                       
wm_manipulatormap_set_highlighted_manipulator(mmap, C, manipulator, part);
+                                       if ((manipulator = 
wm_manipulatormap_find_highlighted_3D(mmap, C, event, &part))) {
+                                               
wm_manipulatormap_set_highlighted_manipulator(mmap, C, manipulator, part);
+                                       }
+                                       else if ((manipulator = 
wm_manipulatormap_find_highlighted_manipulator(mmap, C, event, &part))) {
+                                               
wm_manipulatormap_set_highlighted_manipulator(mmap, C, manipulator, part);
+                                       }
                                }
                                /* handle user configurable manipulator-map 
keymap */
                                else if (manipulator) {
diff --git 
a/source/blender/windowmanager/manipulators/intern/wm_manipulatormap.c 
b/source/blender/windowmanager/manipulators/intern/wm_manipulatormap.c
index f5baebc..d79de5c 100644
--- a/source/blender/windowmanager/manipulators/intern/wm_manipulatormap.c
+++ b/source/blender/windowmanager/manipulators/intern/wm_manipulatormap.c
@@ -390,7 +390,7 @@ static void 
manipulators_prepare_visible_3D(wmManipulatorMap *mmap, ListBase *vi
        wmManipulator *manipulator;
 
        for (wmManipulatorGroup *mgroup = mmap->manipulator_groups.first; 
mgroup; mgroup = mgroup->next) {
-               if (mgroup->flag & WM_MANIPULATORGROUPTYPE_3D) {
+               if (mgroup->type->flag & WM_MANIPULATORGROUPTYPE_3D) {
                        if (!mgroup->type->poll || mgroup->type->poll(C, 
mgroup->type)) {
                                for (manipulator = mgroup->manipulators.first; 
manipulator; manipulator = manipulator->next) {
                                        if (manipulator->render_3d_intersection 
&& (manipulator->flag & WM_MANIPULATOR_HIDDEN) == 0) {
@@ -441,7 +441,7 @@ void WM_manipulatormaps_add_handlers(ARegion *ar, 
wmManipulatorMap *mmap)
 {
        wmEventHandler *handler = MEM_callocN(sizeof(wmEventHandler), 
"manipulator handler");
 
-       BLI_assert(handler->manipulator_map == ar->manipulator_map);
+       BLI_assert(mmap == ar->manipulator_map);
        handler->manipulator_map = mmap;
        BLI_addtail(&ar->handlers, handler);
 }
@@ -453,7 +453,7 @@ void wm_manipulatormaps_handled_modal_update(
        const bool modal_running = (handler->op != NULL);
 
        /* happens on render */
-       if (!handler->op_region)
+       if (!handler->op_region || !handler->op_region->manipulator_map)
                return;
 
        /* hide operator manipulators */

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to