diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-05-09 15:59:29 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-05-09 16:00:29 +0300 |
commit | 6f891e2b87fa44714ce66c7aff1b402603f48ff9 (patch) | |
tree | 9d038678a4e60fad9b766ed4120f7e3cad6ec0cd /source/blender/draw/modes/particle_mode.c | |
parent | 5cea8bf4355dbe9d0ad5170d123b15e9babfa51a (diff) |
Draw manager: Implement point selection modes for particle edit mode
Diffstat (limited to 'source/blender/draw/modes/particle_mode.c')
-rw-r--r-- | source/blender/draw/modes/particle_mode.c | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/source/blender/draw/modes/particle_mode.c b/source/blender/draw/modes/particle_mode.c index 52d72da0151..91d00589449 100644 --- a/source/blender/draw/modes/particle_mode.c +++ b/source/blender/draw/modes/particle_mode.c @@ -85,7 +85,8 @@ static struct { typedef struct PARTICLE_PrivateData { DRWShadingGroup *strands_group; - DRWShadingGroup *points_group; + DRWShadingGroup *inner_points_group; + DRWShadingGroup *tip_points_group; } PARTICLE_PrivateData; /* Transient data */ /* *********** FUNCTIONS *********** */ @@ -125,25 +126,35 @@ static void particle_cache_init(void *vedata) stl->g_data->strands_group = DRW_shgroup_create( e_data.strands_shader, psl->psys_edit_pass); - stl->g_data->points_group = DRW_shgroup_create( + stl->g_data->inner_points_group = DRW_shgroup_create( + e_data.points_shader, psl->psys_edit_pass); + stl->g_data->tip_points_group = DRW_shgroup_create( e_data.points_shader, psl->psys_edit_pass); static float size = 5.0f; - DRW_shgroup_uniform_float(stl->g_data->points_group, "size", &size, 1); static float outline_width = 1.0f; - DRW_shgroup_uniform_float(stl->g_data->points_group, "outlineWidth", &outline_width, 1); + DRW_shgroup_uniform_float(stl->g_data->inner_points_group, "size", &size, 1); + DRW_shgroup_uniform_float(stl->g_data->inner_points_group, "outlineWidth", &outline_width, 1); + DRW_shgroup_uniform_float(stl->g_data->tip_points_group, "size", &size, 1); + DRW_shgroup_uniform_float(stl->g_data->tip_points_group, "outlineWidth", &outline_width, 1); } static void particle_edit_cache_populate(void *vedata, PTCacheEdit *edit) { PARTICLE_StorageList *stl = ((PARTICLE_Data *)vedata)->stl; + const DRWContextState *draw_ctx = DRW_context_state_get(); + ParticleEditSettings *pset= PE_settings(draw_ctx->scene); { struct Gwn_Batch *strands = DRW_cache_particles_get_edit_strands(edit); DRW_shgroup_call_add(stl->g_data->strands_group, strands, NULL); } - { - struct Gwn_Batch *points = DRW_cache_particles_get_edit_points(edit); - DRW_shgroup_call_add(stl->g_data->points_group, points, NULL); + if (pset->selectmode == SCE_SELECT_POINT) { + struct Gwn_Batch *points = DRW_cache_particles_get_edit_inner_points(edit); + DRW_shgroup_call_add(stl->g_data->inner_points_group, points, NULL); + } + if (ELEM(pset->selectmode, SCE_SELECT_POINT, SCE_SELECT_END)) { + struct Gwn_Batch *points = DRW_cache_particles_get_edit_tip_points(edit); + DRW_shgroup_call_add(stl->g_data->tip_points_group, points, NULL); } } |