Merge branch 'blender-v4.5-release'
This commit is contained in:
@@ -145,6 +145,8 @@ static void WIDGETGROUP_camera_refresh(const bContext *C, wmGizmoGroup *gzgroup)
|
||||
|
||||
PointerRNA camera_ptr = RNA_pointer_create_discrete(&ca->id, &RNA_Camera, ca);
|
||||
|
||||
const bool is_modal = WM_gizmo_group_is_modal(gzgroup);
|
||||
|
||||
negate_v3_v3(dir, ob->object_to_world().ptr()[2]);
|
||||
|
||||
if ((ca->flag & CAM_SHOWLIMITS) && (v3d->gizmo_show_camera & V3D_GIZMO_SHOW_CAMERA_DOF_DIST)) {
|
||||
@@ -215,8 +217,11 @@ static void WIDGETGROUP_camera_refresh(const bContext *C, wmGizmoGroup *gzgroup)
|
||||
WM_gizmo_set_matrix_offset_location(widget, offset);
|
||||
}
|
||||
|
||||
/* define & update properties */
|
||||
{
|
||||
/* Define & update properties.
|
||||
*
|
||||
* Check modal to prevent feedback loop for orthographic cameras,
|
||||
* where the range is based on the scale, see: #141667. */
|
||||
if (!is_modal) {
|
||||
const char *propname = is_ortho ? "ortho_scale" : "lens";
|
||||
PropertyRNA *prop = RNA_struct_find_property(&camera_ptr, propname);
|
||||
const wmGizmoPropertyType *gz_prop_type = WM_gizmotype_target_property_find(widget->type,
|
||||
|
||||
@@ -1923,15 +1923,11 @@ static void gizmogroup_refresh_from_matrix(wmGizmoGroup *gzgroup,
|
||||
|
||||
static void WIDGETGROUP_gizmo_refresh(const bContext *C, wmGizmoGroup *gzgroup)
|
||||
{
|
||||
ARegion *region = CTX_wm_region(C);
|
||||
|
||||
{
|
||||
wmGizmo *gz = WM_gizmomap_get_modal(region->runtime->gizmo_map);
|
||||
if (gz && gz->parent_gzgroup == gzgroup) {
|
||||
return;
|
||||
}
|
||||
if (WM_gizmo_group_is_modal(gzgroup)) {
|
||||
return;
|
||||
}
|
||||
|
||||
ARegion *region = CTX_wm_region(C);
|
||||
GizmoGroup *ggd = static_cast<GizmoGroup *>(gzgroup->customdata);
|
||||
Scene *scene = CTX_data_scene(C);
|
||||
ScrArea *area = CTX_wm_area(C);
|
||||
@@ -1995,13 +1991,7 @@ static void WIDGETGROUP_gizmo_draw_prepare(const bContext *C, wmGizmoGroup *gzgr
|
||||
float idot[3];
|
||||
|
||||
/* Re-calculate hidden unless modal. */
|
||||
bool is_modal = false;
|
||||
{
|
||||
wmGizmo *gz = WM_gizmomap_get_modal(region->runtime->gizmo_map);
|
||||
if (gz && gz->parent_gzgroup == gzgroup) {
|
||||
is_modal = true;
|
||||
}
|
||||
}
|
||||
const bool is_modal = WM_gizmo_group_is_modal(gzgroup);
|
||||
|
||||
/* When looking through a selected camera, the gizmo can be at the
|
||||
* exact same position as the view, skip so we don't break selection. */
|
||||
|
||||
@@ -461,6 +461,8 @@ void WM_gizmo_group_type_reinit(Main *bmain, blender::StringRef idname);
|
||||
|
||||
/* Utilities. */
|
||||
|
||||
bool WM_gizmo_group_is_modal(const wmGizmoGroup *gzgroup);
|
||||
|
||||
bool WM_gizmo_context_check_drawstep(const bContext *C, eWM_GizmoFlagMapDrawStep step);
|
||||
|
||||
void WM_gizmo_group_remove_by_tool(bContext *C,
|
||||
|
||||
@@ -714,6 +714,15 @@ void WM_gizmo_properties_free(PointerRNA *ptr)
|
||||
/** \name General Utilities
|
||||
* \{ */
|
||||
|
||||
bool WM_gizmo_group_is_modal(const wmGizmoGroup *gzgroup)
|
||||
{
|
||||
wmGizmo *gz = WM_gizmomap_get_modal(gzgroup->parent_gzmap);
|
||||
if (gz && gz->parent_gzgroup == gzgroup) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool WM_gizmo_context_check_drawstep(const bContext *C, eWM_GizmoFlagMapDrawStep step)
|
||||
{
|
||||
switch (step) {
|
||||
|
||||
Reference in New Issue
Block a user