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:
authorClément Foucault <foucault.clem@gmail.com>2018-09-26 17:40:09 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-09-26 17:42:57 +0300
commitf7a81abe190a3ed546831577a077507758200777 (patch)
tree41973f3e02b784a36a9ad64728475fdafcd3fea2 /source/blender/draw/modes/edit_curve_mode.c
parent1407a111381463cd05ca92a661403d9f114dc95a (diff)
Edit Surface: Use edit curve engine to display edit surface
It's so similar in practice that we don't need a separate engine for edit surface overlays.
Diffstat (limited to 'source/blender/draw/modes/edit_curve_mode.c')
-rw-r--r--source/blender/draw/modes/edit_curve_mode.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/source/blender/draw/modes/edit_curve_mode.c b/source/blender/draw/modes/edit_curve_mode.c
index 9dc61619503..8f61c8db965 100644
--- a/source/blender/draw/modes/edit_curve_mode.c
+++ b/source/blender/draw/modes/edit_curve_mode.c
@@ -241,12 +241,7 @@ static void EDIT_CURVE_cache_populate(void *vedata, Object *ob)
UNUSED_VARS(psl, stl);
if (ob->type == OB_CURVE) {
-#if 0
- if (ob == draw_ctx->object_edit)
-#else
- if ((ob == draw_ctx->object_edit) || BKE_object_is_in_editmode(ob))
-#endif
- {
+ if (BKE_object_is_in_editmode(ob)) {
Curve *cu = ob->data;
/* Get geometry cache */
struct GPUBatch *geom;
@@ -268,16 +263,16 @@ static void EDIT_CURVE_cache_populate(void *vedata, Object *ob)
DRW_shgroup_call_add(stl->g_data->overlay_vert_shgrp, geom, ob->obmat);
}
}
-}
-/* Optional: Post-cache_populate callback */
-static void EDIT_CURVE_cache_finish(void *vedata)
-{
- EDIT_CURVE_PassList *psl = ((EDIT_CURVE_Data *)vedata)->psl;
- EDIT_CURVE_StorageList *stl = ((EDIT_CURVE_Data *)vedata)->stl;
+ if (ob->type == OB_SURF) {
+ if (BKE_object_is_in_editmode(ob)) {
+ struct GPUBatch *geom = DRW_cache_curve_edge_overlay_get(ob);
+ DRW_shgroup_call_add(stl->g_data->overlay_edge_shgrp, geom, ob->obmat);
- /* Do something here! dependent on the objects gathered */
- UNUSED_VARS(psl, stl);
+ geom = DRW_cache_curve_vert_overlay_get(ob, false);
+ DRW_shgroup_call_add(stl->g_data->overlay_vert_shgrp, geom, ob->obmat);
+ }
+ }
}
/* Draw time ! Control rendering pipeline from here */
@@ -325,7 +320,7 @@ DrawEngineType draw_engine_edit_curve_type = {
&EDIT_CURVE_engine_free,
&EDIT_CURVE_cache_init,
&EDIT_CURVE_cache_populate,
- &EDIT_CURVE_cache_finish,
+ NULL,
NULL, /* draw_background but not needed by mode engines */
&EDIT_CURVE_draw_scene,
NULL,