Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2021-09-30 10:32:45 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-09-30 10:32:45 +0300
commitfdcae48663e87ebc2ed0a97916dcdecb3bd03e61 (patch)
treec49eb93dd56bd31b738f68b6648cd582f78146b9 /source/blender/editors/include/ED_uvedit.h
parent2c2516bfc92ba8fa0850ca6b6151dbc058b2cbce (diff)
Cleanup: isolate UDIM parameters into a struct
Passing multiple UDIM arguments into the packing function is awkward especially since the caller may not be using UDIM. Use an argument to store UDIM packing parameters which can be NULL, which operates without any UDIM support. Add a function that extracts these parameters out of the image space allowing for multiple functions to take UDIM parameters in the future.
Diffstat (limited to 'source/blender/editors/include/ED_uvedit.h')
-rw-r--r--source/blender/editors/include/ED_uvedit.h20
1 files changed, 16 insertions, 4 deletions
diff --git a/source/blender/editors/include/ED_uvedit.h b/source/blender/editors/include/ED_uvedit.h
index 516239a7176..f3aba12a924 100644
--- a/source/blender/editors/include/ED_uvedit.h
+++ b/source/blender/editors/include/ED_uvedit.h
@@ -237,6 +237,18 @@ void ED_image_draw_cursor(struct ARegion *region, const float cursor[2]);
void ED_uvedit_buttons_register(struct ARegionType *art);
/* uvedit_islands.c */
+
+struct UVMapUDIM_Params {
+ const struct Image *image;
+ /** Copied from #SpaceImage.tile_grid_shape */
+ int grid_shape[2];
+ bool use_target_udim;
+ int target_udim;
+};
+bool ED_uvedit_udim_params_from_image_space(const struct SpaceImage *sima,
+ bool use_active,
+ struct UVMapUDIM_Params *udim_params);
+
struct UVPackIsland_Params {
uint rotate : 1;
/** -1 not to align to axis, otherwise 0,1 for X,Y. */
@@ -247,13 +259,13 @@ struct UVPackIsland_Params {
uint correct_aspect : 1;
};
-bool uv_coords_isect_udim(const struct Image *image, const int udim_grid[2], float coords[2]);
+bool uv_coords_isect_udim(const struct Image *image,
+ const int udim_grid[2],
+ const float coords[2]);
void ED_uvedit_pack_islands_multi(const struct Scene *scene,
- const struct SpaceImage *sima,
Object **objects,
const uint objects_len,
- const bool use_target_udim,
- int target_udim,
+ const struct UVMapUDIM_Params *udim_params,
const struct UVPackIsland_Params *params);
#ifdef __cplusplus