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 <campbell@blender.org>2022-02-04 03:05:31 +0300
committerCampbell Barton <campbell@blender.org>2022-02-04 03:08:34 +0300
commitef2685afea74135531661a5ea993cb38aeb2b261 (patch)
treea95393ea6f62a9495c057eca6fb8787b750397f8 /source/blender/editors/include/ED_transverts.h
parenta0c1306e8c7673f365e1907cacff86f788e08cef (diff)
Fix assertion snapping to selected in mesh edit-mode
ED_transverts_create_from_obedit expected an evaluated object. Add flag to request TX_VERT_USE_MAPLOC to be set, which avoids having to calculate this data when it's not used as well as the requirement that the input object be evaluated from the depsgraph.
Diffstat (limited to 'source/blender/editors/include/ED_transverts.h')
-rw-r--r--source/blender/editors/include/ED_transverts.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/source/blender/editors/include/ED_transverts.h b/source/blender/editors/include/ED_transverts.h
index cbcf28d53d5..dbf156d480f 100644
--- a/source/blender/editors/include/ED_transverts.h
+++ b/source/blender/editors/include/ED_transverts.h
@@ -28,6 +28,7 @@ extern "C" {
#endif
struct Object;
+struct bContext;
typedef struct TransVert {
float *loc;
@@ -42,10 +43,14 @@ typedef struct TransVertStore {
int mode;
} TransVertStore;
-void ED_transverts_create_from_obedit(TransVertStore *tvs, struct Object *obedit, int mode);
+/**
+ * \param obedit: When `mode` has the #TM_CALC_MAPLOC flag set, `obedit` must be evaluated,
+ * to access evaluated vertices.
+ */
+void ED_transverts_create_from_obedit(TransVertStore *tvs, const struct Object *obedit, int mode);
void ED_transverts_update_obedit(TransVertStore *tvs, struct Object *obedit);
void ED_transverts_free(TransVertStore *tvs);
-bool ED_transverts_check_obedit(Object *obedit);
+bool ED_transverts_check_obedit(const struct Object *obedit);
bool ED_transverts_poll(struct bContext *C);
/* currently only used for bmesh index values */
@@ -66,12 +71,16 @@ enum {
TM_SKIP_HANDLES = (1 << 1),
/** fill in normals when available */
TM_CALC_NORMALS = (1 << 2),
+ /** Calculates #TransVert.maploc where possible. */
+ TM_CALC_MAPLOC = (1 << 2),
};
enum {
/* SELECT == (1 << 0) */
+ /** Calculated when #TM_CALC_MAPLOC is set. */
TX_VERT_USE_MAPLOC = (1 << 1),
- TX_VERT_USE_NORMAL = (1 << 2), /* avoid nonzero check */
+ /** Calculated when #TM_CALC_NORMALS is set, avoid nonzero check. */
+ TX_VERT_USE_NORMAL = (1 << 2),
};
#ifdef __cplusplus