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:
authorJoseph Eagar <joeedh@gmail.com>2021-04-12 03:58:51 +0300
committerJoseph Eagar <joeedh@gmail.com>2021-04-12 03:59:16 +0300
commit64337d087de74ec5ddaa06ac9852817bec1fa297 (patch)
tree9da94fae7ef87fbbce87c1058bb9687cf4120c83 /source/blender/draw/engines/overlay
parente1fae3cbee3c6c0e09812e5227c8f872650e57bf (diff)
parentd3cb1d845b347524bcadff2f5e481b7aec95f3af (diff)
* Merge branch 'master' into temp_bmesh_multires
* Implemented DynTopo option to dissolve 3 and 4-valence vertices. * Fixed bug in dyntopo collapse customdata snapping.
Diffstat (limited to 'source/blender/draw/engines/overlay')
-rw-r--r--source/blender/draw/engines/overlay/overlay_extra.c7
-rw-r--r--source/blender/draw/engines/overlay/overlay_wireframe.c30
2 files changed, 20 insertions, 17 deletions
diff --git a/source/blender/draw/engines/overlay/overlay_extra.c b/source/blender/draw/engines/overlay/overlay_extra.c
index 00429a19cf4..2e1c0165513 100644
--- a/source/blender/draw/engines/overlay/overlay_extra.c
+++ b/source/blender/draw/engines/overlay/overlay_extra.c
@@ -542,16 +542,15 @@ static void OVERLAY_forcefield(OVERLAY_ExtraCallBuffers *cb, Object *ob, ViewLay
DRW_buffer_add_entry(cb->field_vortex, color, &instdata);
break;
case PFIELD_GUIDE:
- if (cu && (cu->flag & CU_PATH) && ob->runtime.curve_cache->path &&
- ob->runtime.curve_cache->path->data) {
+ if (cu && (cu->flag & CU_PATH) && ob->runtime.curve_cache->anim_path_accum_length) {
instdata.size_x = instdata.size_y = instdata.size_z = pd->f_strength;
float pos[4], tmp[3];
- where_on_path(ob, 0.0f, pos, tmp, NULL, NULL, NULL);
+ BKE_where_on_path(ob, 0.0f, pos, tmp, NULL, NULL, NULL);
copy_v3_v3(instdata.pos, ob->obmat[3]);
translate_m4(instdata.mat, pos[0], pos[1], pos[2]);
DRW_buffer_add_entry(cb->field_curve, color, &instdata);
- where_on_path(ob, 1.0f, pos, tmp, NULL, NULL, NULL);
+ BKE_where_on_path(ob, 1.0f, pos, tmp, NULL, NULL, NULL);
copy_v3_v3(instdata.pos, ob->obmat[3]);
translate_m4(instdata.mat, pos[0], pos[1], pos[2]);
DRW_buffer_add_entry(cb->field_sphere_limit, color, &instdata);
diff --git a/source/blender/draw/engines/overlay/overlay_wireframe.c b/source/blender/draw/engines/overlay/overlay_wireframe.c
index 7ba5fb3a426..b8a61ecc403 100644
--- a/source/blender/draw/engines/overlay/overlay_wireframe.c
+++ b/source/blender/draw/engines/overlay/overlay_wireframe.c
@@ -177,8 +177,23 @@ void OVERLAY_wireframe_cache_populate(OVERLAY_Data *vedata,
const bool all_wires = (ob->dtx & OB_DRAW_ALL_EDGES) != 0;
const bool is_xray = (ob->dtx & OB_DRAW_IN_FRONT) != 0;
const bool is_mesh = ob->type == OB_MESH;
- const bool is_mesh_verts_only = is_mesh && (((Mesh *)ob->data)->totedge == 0 &&
- ((Mesh *)ob->data)->totvert > 0);
+ const bool is_edit_mode = DRW_object_is_in_edit_mode(ob);
+ bool has_edit_mesh_cage = false;
+ bool is_mesh_verts_only = false;
+ if (is_mesh) {
+ /* TODO: Should be its own function. */
+ Mesh *me = ob->data;
+ if (is_edit_mode) {
+ BLI_assert(me->edit_mesh);
+ BMEditMesh *embm = me->edit_mesh;
+ has_edit_mesh_cage = embm->mesh_eval_cage && (embm->mesh_eval_cage != embm->mesh_eval_final);
+ if (embm->mesh_eval_final) {
+ me = embm->mesh_eval_final;
+ }
+ }
+ is_mesh_verts_only = me->totedge == 0 && me->totvert > 0;
+ }
+
const bool use_wire = !is_mesh_verts_only && ((pd->overlay.flag & V3D_OVERLAY_WIREFRAMES) ||
(ob->dtx & OB_DRAWWIRE) || (ob->dt == OB_WIRE));
@@ -261,17 +276,6 @@ void OVERLAY_wireframe_cache_populate(OVERLAY_Data *vedata,
}
}
- const bool is_edit_mode = DRW_object_is_in_edit_mode(ob);
- bool has_edit_mesh_cage = false;
- if (is_mesh && is_edit_mode) {
- /* TODO: Should be its own function. */
- Mesh *me = (Mesh *)ob->data;
- BMEditMesh *embm = me->edit_mesh;
- if (embm) {
- has_edit_mesh_cage = embm->mesh_eval_cage && (embm->mesh_eval_cage != embm->mesh_eval_final);
- }
- }
-
/* Don't do that in edit Mesh mode, unless there is a modifier preview. */
if (use_wire && (!is_mesh || (!is_edit_mode || has_edit_mesh_cage))) {
const bool is_sculpt_mode = ((ob->mode & OB_MODE_SCULPT) != 0) && (ob->sculpt != NULL);