[Bf-blender-cvs] [29e496e768c] master: Cleanup: remove redundant cursor copy, print
Campbell Barton
noreply at git.blender.org
Fri Oct 8 04:17:07 CEST 2021
Commit: 29e496e768cd850f731521c9bb95e017e09885be
Author: Campbell Barton
Date: Fri Oct 8 11:57:42 2021 +1100
Branches: master
https://developer.blender.org/rB29e496e768cd850f731521c9bb95e017e09885be
Cleanup: remove redundant cursor copy, print
===================================================================
M release/scripts/startup/bl_ui/space_topbar.py
M source/blender/editors/uvedit/uvedit_unwrap_ops.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py
index 9d5e2a78631..518979a5ef3 100644
--- a/release/scripts/startup/bl_ui/space_topbar.py
+++ b/release/scripts/startup/bl_ui/space_topbar.py
@@ -662,7 +662,6 @@ class TOPBAR_MT_window(Menu):
# - From the top-bar, the text replaces the file-menu (not so bad but strange).
# - From menu-search it replaces the area that the user may want to screen-shot.
# Setting the context to screen causes the status to show in the global status-bar.
- print(layout.operator_context)
layout.operator_context = 'INVOKE_SCREEN'
layout.operator("screen.screenshot_area")
layout.operator_context = operator_context_default
diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c
index 38233b55d15..89490e59bd8 100644
--- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c
+++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c
@@ -171,7 +171,7 @@ bool ED_uvedit_udim_params_from_image_space(const SpaceImage *sima,
int active_udim = 1001;
/* NOTE: Presently, when UDIM grid and tiled image are present together, only active tile for
* the tiled image is considered. */
- Image *image = sima->image;
+ const Image *image = sima->image;
if (image && image->source == IMA_SRC_TILED) {
ImageTile *active_tile = BLI_findlink(&image->tiles, image->active_tile_index);
if (active_tile) {
@@ -181,11 +181,10 @@ bool ED_uvedit_udim_params_from_image_space(const SpaceImage *sima,
else {
/* TODO: Support storing an active UDIM when there are no tiles present.
* Until then, use 2D cursor to find the active tile index for the UDIM grid. */
- const float cursor_loc[2] = {sima->cursor[0], sima->cursor[1]};
- if (uv_coords_isect_udim(sima->image, sima->tile_grid_shape, cursor_loc)) {
+ if (uv_coords_isect_udim(sima->image, sima->tile_grid_shape, sima->cursor)) {
int tile_number = 1001;
- tile_number += floorf(cursor_loc[1]) * 10;
- tile_number += floorf(cursor_loc[0]);
+ tile_number += floorf(sima->cursor[1]) * 10;
+ tile_number += floorf(sima->cursor[0]);
active_udim = tile_number;
}
}
More information about the Bf-blender-cvs
mailing list