WIP: uv-simple-select #1

Closed
Chris Blackbourn wants to merge 182 commits from uv-simple-select into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
12 changed files with 74 additions and 66 deletions
Showing only changes of commit e3b9903252 - Show all commits

View File

@ -899,8 +899,8 @@ int RenderScheduler::get_num_samples_during_navigation(int resolution_divider) c
/* Schedule samples equal to the resolution divider up to a maximum of 4. /* Schedule samples equal to the resolution divider up to a maximum of 4.
* The idea is to have enough information on the screen by increasing the sample count as the * The idea is to have enough information on the screen by increasing the sample count as the
* resolution is decreased. */ * resolution is decreased. */
/* NOTE: Changeing this formula will change the formula in /* NOTE: Changing this formula will change the formula in
* "RenderScheduler::calculate_resolution_divider_for_time()"*/ * `RenderScheduler::calculate_resolution_divider_for_time()`. */
return min(max(1, resolution_divider / pixel_size_), 4); return min(max(1, resolution_divider / pixel_size_), 4);
} }
@ -1177,18 +1177,18 @@ int RenderScheduler::calculate_resolution_divider_for_time(double desired_time,
{ {
const double ratio_between_times = actual_time / desired_time; const double ratio_between_times = actual_time / desired_time;
/* We can pass "ratio_between_times" to "get_num_samples_during_navigation()" to get our /* We can pass `ratio_between_times` to `get_num_samples_during_navigation()` to get our
* navigation samples because the equation for calculating the resolution divider is as follows: * navigation samples because the equation for calculating the resolution divider is as follows:
* "actual_time / desired_time = sqr(resolution_divider) / sample_count". * `actual_time / desired_time = sqr(resolution_divider) / sample_count`.
* While "resolution_divider" is less than or equal to 4, "resolution_divider = sample_count" * While `resolution_divider` is less than or equal to 4, `resolution_divider = sample_count`
* (This relationship is determined in "get_num_samples_during_navigation()"). With some * (This relationship is determined in `get_num_samples_during_navigation()`). With some
* substitution we end up with "actual_time / desired_time = resolution_divider" while the * substitution we end up with `actual_time / desired_time = resolution_divider` while the
* resolution divider is less than or equal to 4. Once the resolution divider increases above 4, * resolution divider is less than or equal to 4. Once the resolution divider increases above 4,
* the relationsip of "actual_time / desired_time = resolution_divider" is no longer true, * the relationship of `actual_time / desired_time = resolution_divider` is no longer true,
* however the sample count retrieved from "get_num_samples_during_navigation()" is still * however the sample count retrieved from `get_num_samples_during_navigation()` is still
* accurate if we continue using this assumption. It should be noted that the interaction between * accurate if we continue using this assumption. It should be noted that the interaction between
* pixel_size, sample count, and resolution divider are automatically accounted for and that's * `pixel_size`, sample count, and resolution divider are automatically accounted for and that's
* why pixel_size isn't included in any of the equations. */ * why `pixel_size` isn't included in any of the equations. */
const int navigation_samples = get_num_samples_during_navigation( const int navigation_samples = get_num_samples_during_navigation(
ceil_to_int(ratio_between_times)); ceil_to_int(ratio_between_times));

View File

@ -1704,7 +1704,7 @@ static void rigidbody_update_sim_ob(Depsgraph *depsgraph, Object *ob, RigidBodyO
} }
} }
/* Make transformed objects temporarily kinmatic /* Make transformed objects temporarily kinematic
* so that they can be moved by the user during simulation. */ * so that they can be moved by the user during simulation. */
if (is_selected && (G.moving & G_TRANSFORM_OBJ)) { if (is_selected && (G.moving & G_TRANSFORM_OBJ)) {
RB_body_set_kinematic_state(rbo->shared->physics_object, true); RB_body_set_kinematic_state(rbo->shared->physics_object, true);

View File

@ -1166,7 +1166,7 @@ void BM_mesh_bm_to_me(Main *bmain, BMesh *bm, Mesh *me, const struct BMeshToMesh
&bm->ldata, CD_PROP_BOOL, BKE_uv_map_pin_name_get(layer_name, sub_layer_name)); &bm->ldata, CD_PROP_BOOL, BKE_uv_map_pin_name_get(layer_name, sub_layer_name));
/* If ever the uv map associated bool layers become optional in BMesh as well (like in Mesh) /* If ever the uv map associated bool layers become optional in BMesh as well (like in Mesh)
* this assert needs to be removed. For now it is a bug if they doin't exist. */ * this assert needs to be removed. For now it is a bug if they don't exist. */
BLI_assert(vertsel_layer_index >= 0 && edgesel_layer_index >= 0 && pin_layer_index >= 0); BLI_assert(vertsel_layer_index >= 0 && edgesel_layer_index >= 0 && pin_layer_index >= 0);
int vertsel_offset = vertsel_layer_index >= 0 ? bm->ldata.layers[vertsel_layer_index].offset : int vertsel_offset = vertsel_layer_index >= 0 ? bm->ldata.layers[vertsel_layer_index].offset :

View File

@ -1197,8 +1197,8 @@ static void bmw_FaceLoopWalker_begin(BMWalker *walker, void *data)
{ {
BMwFaceLoopWalker *lwalk, owalk, *owalk_pt; BMwFaceLoopWalker *lwalk, owalk, *owalk_pt;
BMEdge *e = data; BMEdge *e = data;
/* BMesh *bm = walker->bm; */ /* UNUSED */ // BMesh *bm = walker->bm; /* UNUSED */
/* int fcount = BM_edge_face_count(e); */ /* UNUSED */ // int fcount = BM_edge_face_count(e); /* UNUSED */
if (!bmw_FaceLoopWalker_edge_begins_loop(walker, e)) { if (!bmw_FaceLoopWalker_edge_begins_loop(walker, e)) {
return; return;

View File

@ -1183,7 +1183,7 @@ void bmo_inset_region_exec(BMesh *bm, BMOperator *op)
f = BM_face_create_verts(bm, varr, j, es->l->f, BM_CREATE_NOP, true); f = BM_face_create_verts(bm, varr, j, es->l->f, BM_CREATE_NOP, true);
BMO_face_flag_enable(bm, f, ELE_NEW); BMO_face_flag_enable(bm, f, ELE_NEW);
/* Copy for loop data, otherwise UVs and vcols are no good. /* Copy for loop data, otherwise UVs and vertex-colors are no good.
* tiny speedup here we could be more clever and copy from known adjacent data * tiny speedup here we could be more clever and copy from known adjacent data
* also - we could attempt to interpolate the loop data, * also - we could attempt to interpolate the loop data,
* this would be much slower but more useful too. */ * this would be much slower but more useful too. */

View File

@ -401,9 +401,9 @@ static void add_verts_to_dgroups(ReportList *reports,
vertsfilled = 1; vertsfilled = 1;
} }
else if (BKE_modifiers_findby_type(ob, eModifierType_Subsurf)) { else if (BKE_modifiers_findby_type(ob, eModifierType_Subsurf)) {
/* is subsurf on? Lets use the verts on the limit surface then. /* Is subdivision-surface on? Lets use the verts on the limit surface then.
* = same amount of vertices as mesh, but vertices moved to the * = same amount of vertices as mesh, but vertices moved to the
* subsurfed position, like for 'optimal'. */ * subdivision-surfaced position, like for 'optimal'. */
subsurf_calculate_limit_positions(mesh, verts); subsurf_calculate_limit_positions(mesh, verts);
vertsfilled = 1; vertsfilled = 1;
} }

View File

@ -528,7 +528,7 @@ static short annotation_stroke_addpoint(tGPsdata *p,
/* store settings */ /* store settings */
copy_v2_v2(pt->m_xy, mval); copy_v2_v2(pt->m_xy, mval);
/* #44932 - Pressure vals are unreliable, so ignore for now */ /* Pressure values are unreliable, so ignore for now, see #44932. */
pt->pressure = 1.0f; pt->pressure = 1.0f;
pt->strength = 1.0f; pt->strength = 1.0f;
pt->time = (float)(curtime - p->inittime); pt->time = (float)(curtime - p->inittime);
@ -544,7 +544,7 @@ static short annotation_stroke_addpoint(tGPsdata *p,
/* store settings */ /* store settings */
copy_v2_v2(pt->m_xy, mval); copy_v2_v2(pt->m_xy, mval);
/* #44932 - Pressure vals are unreliable, so ignore for now */ /* Pressure values are unreliable, so ignore for now, see #44932. */
pt->pressure = 1.0f; pt->pressure = 1.0f;
pt->strength = 1.0f; pt->strength = 1.0f;
pt->time = (float)(curtime - p->inittime); pt->time = (float)(curtime - p->inittime);
@ -620,7 +620,7 @@ static short annotation_stroke_addpoint(tGPsdata *p,
/* store settings */ /* store settings */
copy_v2_v2(pt->m_xy, mval); copy_v2_v2(pt->m_xy, mval);
/* #44932 - Pressure vals are unreliable, so ignore for now */ /* Pressure values are unreliable, so ignore for now, see #44932. */
pt->pressure = 1.0f; pt->pressure = 1.0f;
pt->strength = 1.0f; pt->strength = 1.0f;
pt->time = (float)(curtime - p->inittime); pt->time = (float)(curtime - p->inittime);

View File

@ -764,7 +764,7 @@ static short gpencil_stroke_addpoint(tGPsdata *p,
/* store settings */ /* store settings */
copy_v2_v2(pt->m_xy, mval); copy_v2_v2(pt->m_xy, mval);
/* #44932 - Pressure vals are unreliable, so ignore for now */ /* Pressure values are unreliable, so ignore for now, see #44932. */
pt->pressure = 1.0f; pt->pressure = 1.0f;
pt->strength = 1.0f; pt->strength = 1.0f;
pt->time = (float)(curtime - p->inittime); pt->time = (float)(curtime - p->inittime);
@ -780,7 +780,7 @@ static short gpencil_stroke_addpoint(tGPsdata *p,
/* store settings */ /* store settings */
copy_v2_v2(pt->m_xy, mval); copy_v2_v2(pt->m_xy, mval);
/* #44932 - Pressure vals are unreliable, so ignore for now */ /* Pressure values are unreliable, so ignore for now, see #44932. */
pt->pressure = 1.0f; pt->pressure = 1.0f;
pt->strength = 1.0f; pt->strength = 1.0f;
pt->time = (float)(curtime - p->inittime); pt->time = (float)(curtime - p->inittime);
@ -3685,7 +3685,7 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event)
} }
/* We don't pass on key events, GP is used with key-modifiers - /* We don't pass on key events, GP is used with key-modifiers -
* prevents Dkey to insert drivers. */ * prevents D-key to insert drivers. */
if (ISKEYBOARD(event->type)) { if (ISKEYBOARD(event->type)) {
if (ELEM(event->type, EVT_LEFTARROWKEY, EVT_DOWNARROWKEY, EVT_RIGHTARROWKEY, EVT_UPARROWKEY)) { if (ELEM(event->type, EVT_LEFTARROWKEY, EVT_DOWNARROWKEY, EVT_RIGHTARROWKEY, EVT_UPARROWKEY)) {
/* allow some keys: /* allow some keys:

View File

@ -50,83 +50,84 @@
#define MARK_BOUNDARY 1 #define MARK_BOUNDARY 1
typedef struct UvAdjacencyElement { typedef struct UvAdjacencyElement {
/* pointer to original uvelement */ /** pointer to original UV-element. */
UvElement *element; UvElement *element;
/* uv pointer for convenience. Caution, this points to the original UVs! */ /** UV pointer for convenience. Caution, this points to the original UVs! */
float *uv; float *uv;
/* Are we on locked in place? */ /** Are we on locked in place? */
bool is_locked; bool is_locked;
/* Are we on the boundary? */ /** Are we on the boundary? */
bool is_boundary; bool is_boundary;
} UvAdjacencyElement; } UvAdjacencyElement;
typedef struct UvEdge { typedef struct UvEdge {
uint uv1; uint uv1;
uint uv2; uint uv2;
/* Are we in the interior? */ /** Are we in the interior? */
bool is_interior; bool is_interior;
} UvEdge; } UvEdge;
typedef struct UVInitialStrokeElement { typedef struct UVInitialStrokeElement {
/* index to unique uv */ /** index to unique UV. */
int uv; int uv;
/* strength of brush on initial position */ /** Strength of brush on initial position. */
float strength; float strength;
/* initial uv position */ /** initial UV position. */
float initial_uv[2]; float initial_uv[2];
} UVInitialStrokeElement; } UVInitialStrokeElement;
typedef struct UVInitialStroke { typedef struct UVInitialStroke {
/* Initial Selection,for grab brushes for instance */ /** Initial Selection,for grab brushes for instance. */
UVInitialStrokeElement *initialSelection; UVInitialStrokeElement *initialSelection;
/* Total initially selected UVs. */ /** Total initially selected UVs. */
int totalInitialSelected; int totalInitialSelected;
/* initial mouse coordinates */ /** Initial mouse coordinates. */
float init_coord[2]; float init_coord[2];
} UVInitialStroke; } UVInitialStroke;
/* custom data for uv smoothing brush */ /** Custom data for UV smoothing brush. */
typedef struct UvSculptData { typedef struct UvSculptData {
/* Contains the first of each set of coincident UVs. /**
* These will be used to perform smoothing on and propagate the changes * Contains the first of each set of coincident UVs.
* to their coincident UVs */ * These will be used to perform smoothing on and propagate the changes to their coincident UVs.
*/
UvAdjacencyElement *uv; UvAdjacencyElement *uv;
/* Total number of unique UVs. */ /** Total number of unique UVs. */
int totalUniqueUvs; int totalUniqueUvs;
/* Edges used for adjacency info, used with laplacian smoothing */ /** Edges used for adjacency info, used with laplacian smoothing */
UvEdge *uvedges; UvEdge *uvedges;
/* Total number of #UvEdge. */ /** Total number of #UvEdge. */
int totalUvEdges; int totalUvEdges;
/* data for initial stroke, used by tools like grab */ /** data for initial stroke, used by tools like grab */
UVInitialStroke *initial_stroke; UVInitialStroke *initial_stroke;
/* timer to be used for airbrush-type brush */ /** Timer to be used for airbrush-type brush. */
wmTimer *timer; wmTimer *timer;
/* to determine quickly adjacent UVs */ /** To determine quickly adjacent UVs. */
UvElementMap *elementMap; UvElementMap *elementMap;
/* uvsmooth Paint for fast reference */ /** UV-smooth Paint for fast reference. */
Paint *uvsculpt; Paint *uvsculpt;
/* tool to use. duplicating here to change if modifier keys are pressed */ /** Tool to use. duplicating here to change if modifier keys are pressed. */
char tool; char tool;
/* store invert flag here */ /** Store invert flag here. */
char invert; char invert;
/* Is constrain to image bounds active? */ /** Is constrain to image bounds active? */
bool constrain_to_bounds; bool constrain_to_bounds;
/* Base for constrain_to_bounds. */ /** Base for constrain_to_bounds. */
float uv_base_offset[2]; float uv_base_offset[2];
} UvSculptData; } UvSculptData;

View File

@ -249,8 +249,10 @@ typedef enum {
} GPUUniformBuiltin; } GPUUniformBuiltin;
#define GPU_NUM_UNIFORMS (GPU_UNIFORM_SRGB_TRANSFORM + 1) #define GPU_NUM_UNIFORMS (GPU_UNIFORM_SRGB_TRANSFORM + 1)
/** TODO: To be moved as private API. Not really used outside of gpu_matrix.cc and doesn't really /**
* offer a noticeable perf boost. */ * TODO: To be moved as private API. Not really used outside of gpu_matrix.cc and doesn't really
* offer a noticeable performance boost.
*/
int GPU_shader_get_builtin_uniform(GPUShader *shader, int builtin); int GPU_shader_get_builtin_uniform(GPUShader *shader, int builtin);
/** DEPRECATED: Use hardcoded buffer location instead. */ /** DEPRECATED: Use hardcoded buffer location instead. */

View File

@ -18,17 +18,17 @@ namespace blender::gpu {
/** /**
* `VK_ALLOCATION_CALLBACKS` initializes allocation callbacks for host allocations. * `VK_ALLOCATION_CALLBACKS` initializes allocation callbacks for host allocations.
* The macro creates a local static variable with the name `vk_allocation_callbacks` * The macro creates a local static variable with the name `vk_allocation_callbacks`
* that can be passed to vulkan API functions that expect * that can be passed to VULKAN API functions that expect
* `const VkAllocationCallbacks *pAllocator`. * `const VkAllocationCallbacks *pAllocator`.
* *
* When Blender is compiled with `WITH_VULKAN_GUARDEDALLOC` this will use * When Blender is compiled with `WITH_VULKAN_GUARDEDALLOC` this will use
* `MEM_guardedalloc` for host allocations that the driver does on behalf * `MEM_guardedalloc` for host allocations that the driver does on behalf
* of blender. More internal allocations are still being allocated via the * of blender. More internal allocations are still being allocated via the
* implemention inside the vulkan device driver. * implementation inside the VULKAN device driver.
* *
* When `WITH_VULKAN_GUARDEDALLOC=Off` the memory allocation implemented * When `WITH_VULKAN_GUARDEDALLOC=Off` the memory allocation implemented
* in the vulkan device driver is used for both internal and application * in the vulkan device driver is used for both internal and application
* focussed memory operations. * focused memory operations.
*/ */
#ifdef WITH_VULKAN_GUARDEDALLOC #ifdef WITH_VULKAN_GUARDEDALLOC

View File

@ -95,7 +95,8 @@ enum {
/** /**
* The space is not a regular one opened through the editor menu (for example) but spawned by an * The space is not a regular one opened through the editor menu (for example) but spawned by an
* operator to fulfill some task and then disappear again. * operator to fulfill some task and then disappear again.
* Can typically be cancelled using Escape, but that is handled on the editor level. */ * Can typically be canceled using Escape, but that is handled on the editor level.
*/
SPACE_FLAG_TYPE_TEMPORARY = (1 << 0), SPACE_FLAG_TYPE_TEMPORARY = (1 << 0),
/** /**
* Used to mark a space as active but "overlapped" by temporary full-screen spaces. Without this * Used to mark a space as active but "overlapped" by temporary full-screen spaces. Without this
@ -605,10 +606,13 @@ typedef struct SequencerTimelineOverlay {
typedef enum eSpaceSeq_SequencerTimelineOverlay_Flag { typedef enum eSpaceSeq_SequencerTimelineOverlay_Flag {
SEQ_TIMELINE_SHOW_STRIP_OFFSETS = (1 << 1), SEQ_TIMELINE_SHOW_STRIP_OFFSETS = (1 << 1),
SEQ_TIMELINE_SHOW_THUMBNAILS = (1 << 2), SEQ_TIMELINE_SHOW_THUMBNAILS = (1 << 2),
SEQ_TIMELINE_SHOW_STRIP_COLOR_TAG = (1 << 3), /* use Sequence->color_tag */ /** Use #Sequence::color_tag */
SEQ_TIMELINE_SHOW_STRIP_COLOR_TAG = (1 << 3),
SEQ_TIMELINE_SHOW_FCURVES = (1 << 5), SEQ_TIMELINE_SHOW_FCURVES = (1 << 5),
SEQ_TIMELINE_ALL_WAVEFORMS = (1 << 7), /* draw all waveforms */ /** Draw all wave-forms. */
SEQ_TIMELINE_NO_WAVEFORMS = (1 << 8), /* draw no waveforms */ SEQ_TIMELINE_ALL_WAVEFORMS = (1 << 7),
/** Draw no wave-forms. */
SEQ_TIMELINE_NO_WAVEFORMS = (1 << 8),
SEQ_TIMELINE_SHOW_STRIP_NAME = (1 << 14), SEQ_TIMELINE_SHOW_STRIP_NAME = (1 << 14),
SEQ_TIMELINE_SHOW_STRIP_SOURCE = (1 << 15), SEQ_TIMELINE_SHOW_STRIP_SOURCE = (1 << 15),
SEQ_TIMELINE_SHOW_STRIP_DURATION = (1 << 16), SEQ_TIMELINE_SHOW_STRIP_DURATION = (1 << 16),
@ -978,7 +982,7 @@ enum eFileDetails {
FILE_DETAILS_DATETIME = (1 << 1), FILE_DETAILS_DATETIME = (1 << 1),
}; };
/* these values need to be hardcoded in structs, dna does not recognize defines */ /* These values need to be hard-coded in structs, DNA does not recognize defines. */
/* also defined in BKE */ /* also defined in BKE */
#define FILE_MAXDIR 768 #define FILE_MAXDIR 768
#define FILE_MAXFILE 256 #define FILE_MAXFILE 256
@ -1210,7 +1214,7 @@ typedef struct SpaceImage {
struct Image *image; struct Image *image;
struct ImageUser iuser; struct ImageUser iuser;
/** Histogram waveform and vectorscope. */ /** Histogram waveform and vector-scope. */
struct Scopes scopes; struct Scopes scopes;
/** Sample line histogram. */ /** Sample line histogram. */
struct Histogram sample_line_hist; struct Histogram sample_line_hist;
@ -1589,12 +1593,12 @@ typedef struct SpaceNode {
/* tree type for the current node tree */ /* tree type for the current node tree */
char tree_idname[64]; char tree_idname[64];
/** Treetype: as same nodetree->type. */ /** Same as #bNodeTree::type (deprecated). */
int treetype DNA_DEPRECATED; int treetype DNA_DEPRECATED;
/** Texfrom object, world or brush. */ /** Texture-from object, world or brush (#eSpaceNode_TexFrom). */
short texfrom; short texfrom;
/** Shader from object or world. */ /** Shader from object or world (#eSpaceNode_ShaderFrom). */
short shaderfrom; short shaderfrom;
/** Grease-pencil data. */ /** Grease-pencil data. */
@ -1658,7 +1662,7 @@ typedef struct ConsoleLine {
/* Keep these 3 vars so as to share free, realloc functions. */ /* Keep these 3 vars so as to share free, realloc functions. */
/** Allocated length. */ /** Allocated length. */
int len_alloc; int len_alloc;
/** Real len - strlen(). */ /** Real length: `strlen()`. */
int len; int len;
char *line; char *line;
@ -1671,7 +1675,8 @@ typedef struct ConsoleLine {
typedef enum eConsoleLine_Type { typedef enum eConsoleLine_Type {
CONSOLE_LINE_OUTPUT = 0, CONSOLE_LINE_OUTPUT = 0,
CONSOLE_LINE_INPUT = 1, CONSOLE_LINE_INPUT = 1,
CONSOLE_LINE_INFO = 2, /* autocomp feedback */ /** Auto-completion feedback. */
CONSOLE_LINE_INFO = 2,
CONSOLE_LINE_ERROR = 3, CONSOLE_LINE_ERROR = 3,
} eConsoleLine_Type; } eConsoleLine_Type;