Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_view3d/view3d_draw.c
| Context not available. | |||||
| #include "DNA_lamp_types.h" | #include "DNA_lamp_types.h" | ||||
| #include "DNA_scene_types.h" | #include "DNA_scene_types.h" | ||||
| #include "DNA_world_types.h" | #include "DNA_world_types.h" | ||||
| #include "DNA_brush_types.h" | |||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| Context not available. | |||||
| } | } | ||||
| static bool is_cursor_visible(Scene *scene) | |||||
| { | |||||
| const Object *ob = OBACT; | |||||
| const Paint *p = BKE_paint_get_active(scene); | |||||
campbellbarton: Could be called only when you know the objects in paint mode. | |||||
| /* *** cases which need cursor drawing *** */ | |||||
| if (ob) { | |||||
| /* case not in a paint mode */ | |||||
| if ((ob->mode & OB_MODE_ALL_PAINT) == 0) { | |||||
| return true; | |||||
| } | |||||
| /* case active object in weight paint and selected object is bone in pose mode */ | |||||
| if (ob->mode & OB_MODE_WEIGHT_PAINT) { | |||||
| Base *base = FIRSTBASE; | |||||
| while (base) { | |||||
| const Object *obsel = base->object; | |||||
| if ((obsel->flag & SELECT) && | |||||
| (obsel != ob) && | |||||
| (obsel->type == OB_ARMATURE)) | |||||
| { | |||||
| return true; | |||||
| } | |||||
| base = base->next; | |||||
campbellbartonUnsubmitted Not Done Inline ActionsThis should be a direct check. searching over all objects is overkill (If we _had_ to do this, then I'd rather just not have the functionality). But theres no need for it Instead check (BKE_object_pose_armature_get(ob) != NULL) campbellbarton: This should be a direct check. searching over all objects is overkill //(If we _had_ to do this… | |||||
| } | |||||
| } | |||||
| } | |||||
| /* case clone brush and use_clone_layer disabled */ | |||||
| if (p &&p->brush->imagepaint_tool == PAINT_TOOL_CLONE) { | |||||
psy-fiUnsubmitted Not Done Inline ActionsYou must check the active paint mode as well, not only the tool. Probably should only be checked if there is an active object. psy-fi: You must check the active paint mode as well, not only the tool. Probably should only be… | |||||
| if ((scene->toolsettings->imapaint.flag & IMAGEPAINT_PROJECT_LAYER_CLONE) == 0) { | |||||
| return true; | |||||
| } | |||||
| } | |||||
| /* *** other cases: don't draw cursor! *** */ | |||||
psy-fiUnsubmitted Not Done Inline ActionsNope, we should draw by default. psy-fi: Nope, we should draw by default. | |||||
| return false; | |||||
| } | |||||
| static void view3d_main_area_draw_info(const bContext *C, Scene *scene, | static void view3d_main_area_draw_info(const bContext *C, Scene *scene, | ||||
| ARegion *ar, View3D *v3d, | ARegion *ar, View3D *v3d, | ||||
| const char *grid_unit, bool render_border) | const char *grid_unit, bool render_border) | ||||
| Context not available. | |||||
| if ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) { | if ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) { | ||||
| Object *ob; | Object *ob; | ||||
| drawcursor(scene, ar, v3d); | /* 3d cursor */ | ||||
| if (is_cursor_visible(scene)) { | |||||
| drawcursor(scene, ar, v3d); | |||||
| } | |||||
| if (U.uiflag & USER_SHOW_ROTVIEWICON) | if (U.uiflag & USER_SHOW_ROTVIEWICON) | ||||
| draw_view_axis(rv3d, &rect); | draw_view_axis(rv3d, &rect); | ||||
| Context not available. | |||||
Could be called only when you know the objects in paint mode.