Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_view3d/view3d_select.c
| Show First 20 Lines • Show All 2,313 Lines • ▼ Show 20 Lines | if (hits > 0) { | ||||
| /* we make the armature selected: | /* we make the armature selected: | ||||
| * not-selected active object in posemode won't work well for tools */ | * not-selected active object in posemode won't work well for tools */ | ||||
| ED_object_base_select(basact, BA_SELECT); | ED_object_base_select(basact, BA_SELECT); | ||||
| retval = true; | retval = true; | ||||
| WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, basact->object); | WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, basact->object); | ||||
| WM_event_add_notifier(C, NC_OBJECT | ND_BONE_ACTIVE, basact->object); | WM_event_add_notifier(C, NC_OBJECT | ND_BONE_ACTIVE, basact->object); | ||||
| /* since I am not sure how costly ID_RECALC_BASE_FLAGS (ends up doing OperationCode::VIEW_LAYER_EVAL) | |||||
| * really is, this is the most isolated place for the particular report T66668*/ | |||||
| DEG_id_tag_update(&scene->id, ID_RECALC_BASE_FLAGS); | |||||
| /* in weightpaint, we use selected bone to select vertexgroup, | /* in weightpaint, we use selected bone to select vertexgroup, | ||||
| * so no switch to new active object */ | * so no switch to new active object */ | ||||
| if (oldbasact && (oldbasact->object->mode & OB_MODE_WEIGHT_PAINT)) { | if (oldbasact && (oldbasact->object->mode & OB_MODE_WEIGHT_PAINT)) { | ||||
| /* prevent activating */ | /* prevent activating */ | ||||
| basact = NULL; | basact = NULL; | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 88 Lines • ▼ Show 20 Lines | else if (BASE_SELECTABLE(v3d, basact)) { | ||||
| ED_gpencil_toggle_brush_cursor(C, true, NULL); | ED_gpencil_toggle_brush_cursor(C, true, NULL); | ||||
| } | } | ||||
| else { | else { | ||||
| /* TODO: maybe is better use restore */ | /* TODO: maybe is better use restore */ | ||||
| ED_gpencil_toggle_brush_cursor(C, false, NULL); | ED_gpencil_toggle_brush_cursor(C, false, NULL); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* this would be more general */ | |||||
| /*DEG_id_tag_update(&scene->id, ID_RECALC_BASE_FLAGS);*/ | |||||
| DEG_id_tag_update(&scene->id, ID_RECALC_SELECT); | DEG_id_tag_update(&scene->id, ID_RECALC_SELECT); | ||||
| WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene); | WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene); | ||||
| } | } | ||||
| return retval; | return retval; | ||||
| } | } | ||||
| /* mouse selection in weight paint */ | /* mouse selection in weight paint */ | ||||
| ▲ Show 20 Lines • Show All 149 Lines • ▼ Show 20 Lines | if (!retval && deselect_all) { | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* Pass-through allows tweaks | /* Pass-through allows tweaks | ||||
| * FINISHED to signal one operator worked | * FINISHED to signal one operator worked | ||||
| * */ | * */ | ||||
| if (retval) { | if (retval) { | ||||
| /* this would be even more general */ | |||||
| /*DEG_id_tag_update(&scene->id, ID_RECALC_BASE_FLAGS);*/ | |||||
| WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene); | WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene); | ||||
| return OPERATOR_PASS_THROUGH | OPERATOR_FINISHED; | return OPERATOR_PASS_THROUGH | OPERATOR_FINISHED; | ||||
| } | } | ||||
| else { | else { | ||||
| return OPERATOR_PASS_THROUGH; /* nothing selected, just passthrough */ | return OPERATOR_PASS_THROUGH; /* nothing selected, just passthrough */ | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 1,635 Lines • Show Last 20 Lines | |||||