Fix #93501 disable 3dcursor in sculpt mode #115749
|
@ -6874,6 +6874,15 @@ class VIEW3D_PT_overlay_guides(Panel):
|
|||
bl_parent_id = "VIEW3D_PT_overlay"
|
||||
bl_label = "Guides"
|
||||
|
||||
@staticmethod
|
||||
def _cursor_is_active(context):
|
||||
mode = context.mode
|
||||
if "PAINT" in mode:
|
||||
return False
|
||||
elif mode == "SCULPT":
|
||||
return context.active_annotation_layer is not None
|
||||
return True
|
||||
|
||||
def draw(self, context):
|
||||
layout = self.layout
|
||||
|
||||
|
@ -6926,7 +6935,10 @@ class VIEW3D_PT_overlay_guides(Panel):
|
|||
sub.prop(overlay, "show_stats", text="Statistics")
|
||||
|
||||
sub = split.column()
|
||||
sub.prop(overlay, "show_cursor", text="3D Cursor")
|
||||
subrow = sub.row()
|
||||
subrow.prop(overlay, "show_cursor", text="3D Cursor")
|
||||
subrow.active = VIEW3D_PT_overlay_guides._cursor_is_active(context)
|
||||
|
||||
sub.prop(overlay, "show_annotation", text="Annotations")
|
||||
|
||||
if shading.type == 'MATERIAL':
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
#include "DNA_userdef_types.h"
|
||||
#include "DNA_view3d_types.h"
|
||||
|
||||
#include "ED_gpencil_legacy.hh"
|
||||
#include "ED_screen.hh"
|
||||
#include "ED_util.hh"
|
||||
#include "ED_view3d.hh"
|
||||
|
@ -66,8 +67,15 @@ static bool is_cursor_visible(const DRWContextState *draw_ctx, Scene *scene, Vie
|
|||
|
||||
/* don't draw cursor in paint modes, but with a few exceptions */
|
||||
if ((draw_ctx->object_mode & (OB_MODE_ALL_PAINT | OB_MODE_SCULPT_CURVES)) != 0) {
|
||||
/* exception: object is in sculpt mode and there is some annotation */
|
||||
if ((draw_ctx->object_mode & OB_MODE_SCULPT) != 0) {
|
||||
const bGPdata *gpd = ED_annotation_data_get_active(draw_ctx->evil_C);
|
||||
if (gpd) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
/* exception: object is in weight paint and has deforming armature in pose mode */
|
||||
if (draw_ctx->object_mode & OB_MODE_WEIGHT_PAINT) {
|
||||
else if (draw_ctx->object_mode & OB_MODE_WEIGHT_PAINT) {
|
||||
if (BKE_object_pose_armature_get(draw_ctx->obact) != nullptr) {
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue