diff options
author | Germano <germano.costa@ig.com.br> | 2018-02-16 07:01:09 +0300 |
---|---|---|
committer | Germano <germano.costa@ig.com.br> | 2018-02-16 07:01:09 +0300 |
commit | fa0e89b9e857b8696dbecdfe82aa7adea6d5a947 (patch) | |
tree | d59ec8f951602c84816d5b27cd04a81dd6273b1e /source | |
parent | 3ba6ff675012db236f18393dc4a3ac185aa93d47 (diff) |
Metalball drawing: rename mball helpers to handles
and also rename some related functions
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/BKE_mball.h | 6 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/mball.c | 6 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_common.c | 10 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_common.h | 2 | ||||
-rw-r--r-- | source/blender/draw/modes/edit_metaball_mode.c | 12 | ||||
-rw-r--r-- | source/blender/draw/modes/object_mode.c | 14 | ||||
-rw-r--r-- | source/blender/gpu/CMakeLists.txt | 2 | ||||
-rw-r--r-- | source/blender/gpu/GPU_shader.h | 2 | ||||
-rw-r--r-- | source/blender/gpu/intern/gpu_shader.c | 4 | ||||
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_instance_mball_handles_vert.glsl (renamed from source/blender/gpu/shaders/gpu_shader_instance_mball_helpers_vert.glsl) | 0 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_meta_types.h | 2 |
11 files changed, 30 insertions, 30 deletions
diff --git a/source/blender/blenkernel/BKE_mball.h b/source/blender/blenkernel/BKE_mball.h index 9db277f95fb..d4776d890d2 100644 --- a/source/blender/blenkernel/BKE_mball.h +++ b/source/blender/blenkernel/BKE_mball.h @@ -77,9 +77,9 @@ void BKE_mball_eval_geometry(const struct EvaluationContext *eval_ctx, struct MetaBall *mball); /* Draw Cache */ -void BKE_mball_element_calc_display_m3x4(float r_scale_xform[3][4], - const float obmat[4][4], - const float local_pos[3]); +void BKE_mball_element_calc_scale_xform(float r_scale_xform[3][4], + const float obmat[4][4], + const float local_pos[3]); enum { BKE_MBALL_BATCH_DIRTY_ALL = 0, diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c index 5a0ac86823f..cc801b2d8c3 100644 --- a/source/blender/blenkernel/intern/mball.c +++ b/source/blender/blenkernel/intern/mball.c @@ -549,9 +549,9 @@ void BKE_mball_eval_geometry(const struct EvaluationContext *UNUSED(eval_ctx), /* Draw Engine */ /* use for draw-manager only. */ -void BKE_mball_element_calc_display_m3x4(float r_scale_xform[3][4], - const float obmat[4][4], - const float local_pos[3]) +void BKE_mball_element_calc_scale_xform(float r_scale_xform[3][4], + const float obmat[4][4], + const float local_pos[3]) { float world_pos[3], scamat[3][3]; mul_v3_m4v3(world_pos, obmat, local_pos); diff --git a/source/blender/draw/intern/draw_common.c b/source/blender/draw/intern/draw_common.c index 0bf7c24193c..62166092638 100644 --- a/source/blender/draw/intern/draw_common.c +++ b/source/blender/draw/intern/draw_common.c @@ -168,7 +168,7 @@ static struct { struct Gwn_VertFormat *instance_spot; struct Gwn_VertFormat *instance_bone_envelope_wire; struct Gwn_VertFormat *instance_bone_envelope_solid; - struct Gwn_VertFormat *instance_mball_helpers; + struct Gwn_VertFormat *instance_mball_handles; } g_formats = {NULL}; void DRW_globals_free(void) @@ -421,17 +421,17 @@ DRWShadingGroup *shgroup_instance_bone_envelope_solid(DRWPass *pass, struct Gwn_ return grp; } -DRWShadingGroup *shgroup_instance_mball_helpers(DRWPass *pass, struct Gwn_Batch *geom) +DRWShadingGroup *shgroup_instance_mball_handles(DRWPass *pass, struct Gwn_Batch *geom) { - GPUShader *sh = GPU_shader_get_builtin_shader(GPU_SHADER_3D_INSTANCE_MBALL_HELPERS); + GPUShader *sh = GPU_shader_get_builtin_shader(GPU_SHADER_3D_INSTANCE_MBALL_HANDLES); - DRW_shgroup_instance_format(g_formats.instance_mball_helpers, { + DRW_shgroup_instance_format(g_formats.instance_mball_handles, { {"ScaleTranslationMatrix" , DRW_ATTRIB_FLOAT, 16}, {"radius" , DRW_ATTRIB_FLOAT, 1}, {"color" , DRW_ATTRIB_FLOAT, 3} }); - DRWShadingGroup *grp = DRW_shgroup_instance_create(sh, pass, geom, g_formats.instance_mball_helpers); + DRWShadingGroup *grp = DRW_shgroup_instance_create(sh, pass, geom, g_formats.instance_mball_handles); DRW_shgroup_uniform_vec3(grp, "screen_vecs[0]", DRW_viewport_screenvecs_get(), 2); return grp; diff --git a/source/blender/draw/intern/draw_common.h b/source/blender/draw/intern/draw_common.h index 68ab7e055f5..ec646693207 100644 --- a/source/blender/draw/intern/draw_common.h +++ b/source/blender/draw/intern/draw_common.h @@ -119,7 +119,7 @@ struct DRWShadingGroup *shgroup_distance_lines_instance(struct DRWPass *pass, st struct DRWShadingGroup *shgroup_spot_instance(struct DRWPass *pass, struct Gwn_Batch *geom); struct DRWShadingGroup *shgroup_instance_bone_envelope_wire(struct DRWPass *pass, struct Gwn_Batch *geom); struct DRWShadingGroup *shgroup_instance_bone_envelope_solid(struct DRWPass *pass, struct Gwn_Batch *geom); -struct DRWShadingGroup *shgroup_instance_mball_helpers(struct DRWPass *pass, struct Gwn_Batch *geom); +struct DRWShadingGroup *shgroup_instance_mball_handles(struct DRWPass *pass, struct Gwn_Batch *geom); int DRW_object_wire_theme_get( struct Object *ob, struct ViewLayer *view_layer, float **r_color); diff --git a/source/blender/draw/modes/edit_metaball_mode.c b/source/blender/draw/modes/edit_metaball_mode.c index b759dce5931..bcabeef5bc3 100644 --- a/source/blender/draw/modes/edit_metaball_mode.c +++ b/source/blender/draw/modes/edit_metaball_mode.c @@ -119,11 +119,11 @@ static void EDIT_METABALL_cache_init(void *vedata) psl->pass = DRW_pass_create("My Pass", state); /* Create a shadingGroup using a function in draw_common.c or custom one */ - stl->g_data->group = shgroup_instance_mball_helpers(psl->pass, DRW_cache_screenspace_circle_get()); + stl->g_data->group = shgroup_instance_mball_handles(psl->pass, DRW_cache_screenspace_circle_get()); } } -static void EDIT_METABALL_cache_populate_radius_visualization( +static void EDIT_METABALL_cache_populate_radius( DRWShadingGroup *group, MetaElem *ml, const float scale_xform[3][4], const float *radius, const int selection_id) { @@ -142,7 +142,7 @@ static void EDIT_METABALL_cache_populate_radius_visualization( DRW_shgroup_call_dynamic_add(group, scale_xform, radius, color); } -static void EDIT_METABALL_cache_populate_stiffness_visualization( +static void EDIT_METABALL_cache_populate_stiffness( DRWShadingGroup *group, MetaElem *ml, const float scale_xform[3][4], const float *radius, const int selection_id) { @@ -179,13 +179,13 @@ static void EDIT_METABALL_cache_populate(void *vedata, Object *ob) int selection_id = 0; for (MetaElem *ml = mb->editelems->first; ml != NULL; ml = ml->next) { - BKE_mball_element_calc_display_m3x4(ml->draw_scale_xform, ob->obmat, &ml->x); + BKE_mball_element_calc_scale_xform(ml->draw_scale_xform, ob->obmat, &ml->x); ml->draw_stiffness_radius = ml->rad * atanf(ml->s) / (float)M_PI_2; - EDIT_METABALL_cache_populate_radius_visualization( + EDIT_METABALL_cache_populate_radius( group, ml, ml->draw_scale_xform, &ml->rad, is_select ? ++selection_id : -1); - EDIT_METABALL_cache_populate_stiffness_visualization( + EDIT_METABALL_cache_populate_stiffness( group, ml, ml->draw_scale_xform, &ml->draw_stiffness_radius, is_select ? ++selection_id : -1); } } diff --git a/source/blender/draw/modes/object_mode.c b/source/blender/draw/modes/object_mode.c index ec43316240e..4a7a5d25b11 100644 --- a/source/blender/draw/modes/object_mode.c +++ b/source/blender/draw/modes/object_mode.c @@ -156,7 +156,7 @@ typedef struct OBJECT_PrivateData { DRWShadingGroup *probe_grid; /* MetaBalls */ - DRWShadingGroup *mball_circle; + DRWShadingGroup *mball_handle; /* Lamps */ DRWShadingGroup *lamp_center; @@ -980,10 +980,10 @@ static void OBJECT_cache_init(void *vedata) } { - /* Metaballs Helpers */ + /* Metaballs Handles */ struct Gwn_Batch *geom; geom = DRW_cache_screenspace_circle_get(); - stl->g_data->mball_circle = shgroup_instance_mball_helpers(psl->non_meshes, geom); + stl->g_data->mball_handle = shgroup_instance_mball_handles(psl->non_meshes, geom); } { @@ -1115,7 +1115,7 @@ static void OBJECT_cache_init(void *vedata) } } -static void DRW_shgroup_mball_helpers(OBJECT_StorageList *stl, Object *ob, ViewLayer *view_layer) +static void DRW_shgroup_mball_handles(OBJECT_StorageList *stl, Object *ob, ViewLayer *view_layer) { MetaBall *mb = ob->data; @@ -1124,8 +1124,8 @@ static void DRW_shgroup_mball_helpers(OBJECT_StorageList *stl, Object *ob, ViewL for (MetaElem *ml = mb->elems.first; ml != NULL; ml = ml->next) { /* draw radius */ - BKE_mball_element_calc_display_m3x4(ml->draw_scale_xform, ob->obmat, &ml->x); - DRW_shgroup_call_dynamic_add(stl->g_data->mball_circle, ml->draw_scale_xform, &ml->rad, color); + BKE_mball_element_calc_scale_xform(ml->draw_scale_xform, ob->obmat, &ml->x); + DRW_shgroup_call_dynamic_add(stl->g_data->mball_handle, ml->draw_scale_xform, &ml->rad, color); } } @@ -1884,7 +1884,7 @@ static void OBJECT_cache_populate(void *vedata, Object *ob) case OB_MBALL: { if (ob != draw_ctx->object_edit) { - DRW_shgroup_mball_helpers(stl, ob, view_layer); + DRW_shgroup_mball_handles(stl, ob, view_layer); } break; } diff --git a/source/blender/gpu/CMakeLists.txt b/source/blender/gpu/CMakeLists.txt index 9524c71be8e..189ca8e6a33 100644 --- a/source/blender/gpu/CMakeLists.txt +++ b/source/blender/gpu/CMakeLists.txt @@ -174,7 +174,7 @@ data_to_c_simple(shaders/gpu_shader_instance_edges_variying_color_geom.glsl SRC) data_to_c_simple(shaders/gpu_shader_instance_edges_variying_color_vert.glsl SRC) data_to_c_simple(shaders/gpu_shader_instance_bone_envelope_solid_vert.glsl SRC) data_to_c_simple(shaders/gpu_shader_instance_bone_envelope_wire_vert.glsl SRC) -data_to_c_simple(shaders/gpu_shader_instance_mball_helpers_vert.glsl SRC) +data_to_c_simple(shaders/gpu_shader_instance_mball_handles_vert.glsl SRC) data_to_c_simple(shaders/gpu_shader_3D_groundline_geom.glsl SRC) data_to_c_simple(shaders/gpu_shader_3D_groundpoint_vert.glsl SRC) diff --git a/source/blender/gpu/GPU_shader.h b/source/blender/gpu/GPU_shader.h index d25ccbc6c40..ca6e8343401 100644 --- a/source/blender/gpu/GPU_shader.h +++ b/source/blender/gpu/GPU_shader.h @@ -174,7 +174,7 @@ typedef enum GPUBuiltinShader { GPU_SHADER_3D_INSTANCE_BONE_ENVELOPE_SOLID, GPU_SHADER_3D_INSTANCE_BONE_ENVELOPE_WIRE, - GPU_SHADER_3D_INSTANCE_MBALL_HELPERS, + GPU_SHADER_3D_INSTANCE_MBALL_HANDLES, GPU_NUM_BUILTIN_SHADERS /* (not an actual shader) */ } GPUBuiltinShader; diff --git a/source/blender/gpu/intern/gpu_shader.c b/source/blender/gpu/intern/gpu_shader.c index f2dbf587abe..c25d03dff2f 100644 --- a/source/blender/gpu/intern/gpu_shader.c +++ b/source/blender/gpu/intern/gpu_shader.c @@ -98,7 +98,7 @@ extern char datatoc_gpu_shader_instance_edges_variying_color_geom_glsl[]; extern char datatoc_gpu_shader_instance_edges_variying_color_vert_glsl[]; extern char datatoc_gpu_shader_instance_bone_envelope_solid_vert_glsl[]; extern char datatoc_gpu_shader_instance_bone_envelope_wire_vert_glsl[]; -extern char datatoc_gpu_shader_instance_mball_helpers_vert_glsl[]; +extern char datatoc_gpu_shader_instance_mball_handles_vert_glsl[]; extern char datatoc_gpu_shader_3D_groundpoint_vert_glsl[]; extern char datatoc_gpu_shader_3D_groundline_geom_glsl[]; @@ -823,7 +823,7 @@ GPUShader *GPU_shader_get_builtin_shader(GPUBuiltinShader shader) [GPU_SHADER_3D_INSTANCE_BONE_ENVELOPE_WIRE] = { datatoc_gpu_shader_instance_bone_envelope_wire_vert_glsl, datatoc_gpu_shader_flat_color_frag_glsl }, - [GPU_SHADER_3D_INSTANCE_MBALL_HELPERS] = { datatoc_gpu_shader_instance_mball_helpers_vert_glsl, + [GPU_SHADER_3D_INSTANCE_MBALL_HANDLES] = { datatoc_gpu_shader_instance_mball_handles_vert_glsl, datatoc_gpu_shader_flat_color_frag_glsl }, }; diff --git a/source/blender/gpu/shaders/gpu_shader_instance_mball_helpers_vert.glsl b/source/blender/gpu/shaders/gpu_shader_instance_mball_handles_vert.glsl index 819199c26c7..819199c26c7 100644 --- a/source/blender/gpu/shaders/gpu_shader_instance_mball_helpers_vert.glsl +++ b/source/blender/gpu/shaders/gpu_shader_instance_mball_handles_vert.glsl diff --git a/source/blender/makesdna/DNA_meta_types.h b/source/blender/makesdna/DNA_meta_types.h index f9ba45efef8..d1f001fccc4 100644 --- a/source/blender/makesdna/DNA_meta_types.h +++ b/source/blender/makesdna/DNA_meta_types.h @@ -62,7 +62,7 @@ typedef struct MetaElem { /* Draw_Data: stores pointers used for shader attributes */ float draw_scale_xform[3][4]; /* Matrix of Scale and Translation */ - float draw_stiffness_radius; /* stiffness circle radius (only in edit mode) */ + float draw_stiffness_radius; /* radius of the stiffness circle (only in edit mode) */ float pad; } MetaElem; |