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:
authorAntonio Vazquez <blendergit@gmail.com>2020-02-05 13:23:58 +0300
committerAntonio Vazquez <blendergit@gmail.com>2020-02-05 17:56:50 +0300
commit1bc2a98a9d609e54c928672f148edfba9d5f8c5a (patch)
tree0884042019d5c886348e643d30744b4bdcf5a60f /source/blender/draw
parent06c560864607562acdc1e61b13369f24b22c102c (diff)
T73589: Code Quality: Renaming on BKE_material.h
Old Name New Name ========= ========= init_def_material BKE_materials_init BKE_material_gpencil_default_free BKE_materials_exit test_object_materials BKE_object_materials_test test_all_objects_materials BKE_objects_materials_test_all give_matarar BKE_object_material_array give_totcolp BKE_object_material_num give_current_material_p BKE_object_material_get_p give_current_material BKE_object_material_get assign_material BKE_object_material_assign assign_matarar BKE_object_material_array_assign give_matarar_id BKE_id_material_array give_totcolp_id BKE_id_material_num assign_material_id BKE_id_material_assign clear_matcopybuf BKE_material_copybuf_clear free_matcopybuf BKE_material_copybuf_free copy_matcopybuf BKE_material_copybuf_copy paste_matcopybuf BKE_material_copybuf_paste BKE_material_init_gpencil_settings BKE_gpencil_material_attr_init BKE_material_add_gpencil BKE_gpencil_material_add BKE_material_gpencil_get BKE_gpencil_material BKE_material_gpencil_default_get BKE_gpencil_material_default BKE_material_gpencil_settings_get BKE_gpencil_material_settings
Diffstat (limited to 'source/blender/draw')
-rw-r--r--source/blender/draw/engines/eevee/eevee_materials.c2
-rw-r--r--source/blender/draw/engines/eevee/eevee_volumes.c2
-rw-r--r--source/blender/draw/engines/gpencil/gpencil_draw_utils.c14
-rw-r--r--source/blender/draw/engines/gpencil/gpencil_engine.c2
-rw-r--r--source/blender/draw/engines/overlay/overlay_extra.c2
-rw-r--r--source/blender/draw/engines/overlay/overlay_particle.c2
-rw-r--r--source/blender/draw/engines/workbench/workbench_deferred.c4
-rw-r--r--source/blender/draw/engines/workbench/workbench_forward.c4
-rw-r--r--source/blender/draw/engines/workbench/workbench_materials.c2
9 files changed, 17 insertions, 17 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_materials.c b/source/blender/draw/engines/eevee/eevee_materials.c
index 2e0afc5d8d7..6da7621c6c7 100644
--- a/source/blender/draw/engines/eevee/eevee_materials.c
+++ b/source/blender/draw/engines/eevee/eevee_materials.c
@@ -1433,7 +1433,7 @@ static void material_transparent(Material *ma,
/* Return correct material or &defmaterial if slot is empty. */
BLI_INLINE Material *eevee_object_material_get(Object *ob, int slot)
{
- Material *ma = give_current_material(ob, slot + 1);
+ Material *ma = BKE_object_material_get(ob, slot + 1);
if (ma == NULL) {
ma = &defmaterial;
}
diff --git a/source/blender/draw/engines/eevee/eevee_volumes.c b/source/blender/draw/engines/eevee/eevee_volumes.c
index 423cc64da36..7026894076a 100644
--- a/source/blender/draw/engines/eevee/eevee_volumes.c
+++ b/source/blender/draw/engines/eevee/eevee_volumes.c
@@ -395,7 +395,7 @@ void EEVEE_volumes_cache_object_add(EEVEE_ViewLayerData *sldata,
float *texcoloc = NULL;
float *texcosize = NULL;
struct ModifierData *md = NULL;
- Material *ma = give_current_material(ob, 1);
+ Material *ma = BKE_object_material_get(ob, 1);
if (ma == NULL) {
return;
diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
index 2c6b1315ad4..f270fde0533 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
@@ -905,7 +905,7 @@ static void gpencil_add_fill_vertexdata(GpencilBatchCache *cache,
const bool onion,
const bool custonion)
{
- MaterialGPencilStyle *gp_style = BKE_material_gpencil_settings_get(ob, gps->mat_nr + 1);
+ MaterialGPencilStyle *gp_style = BKE_gpencil_material_settings(ob, gps->mat_nr + 1);
if (gps->totpoints >= 3) {
float tfill[4];
/* set color using material, tint color and opacity */
@@ -962,7 +962,7 @@ static void gpencil_add_stroke_vertexdata(GpencilBatchCache *cache,
float tcolor[4];
float ink[4];
short sthickness;
- MaterialGPencilStyle *gp_style = BKE_material_gpencil_settings_get(ob, gps->mat_nr + 1);
+ MaterialGPencilStyle *gp_style = BKE_gpencil_material_settings(ob, gps->mat_nr + 1);
const int alignment_mode = (gp_style) ? gp_style->alignment_mode : GP_STYLE_FOLLOW_PATH;
/* set color using base color, tint color and opacity */
@@ -1052,7 +1052,7 @@ static void gpencil_add_editpoints_vertexdata(GpencilBatchCache *cache,
(GP_SCULPT_MASK_SELECTMODE_POINT |
GP_SCULPT_MASK_SELECTMODE_SEGMENT)));
- MaterialGPencilStyle *gp_style = BKE_material_gpencil_settings_get(ob, gps->mat_nr + 1);
+ MaterialGPencilStyle *gp_style = BKE_gpencil_material_settings(ob, gps->mat_nr + 1);
/* alpha factor for edit points/line to make them more subtle */
float edit_alpha = v3d->vertex_opacity;
@@ -1166,7 +1166,7 @@ static void gpencil_draw_strokes(GpencilBatchCache *cache,
}
for (gps = gpf->strokes.first; gps; gps = gps->next) {
- MaterialGPencilStyle *gp_style = BKE_material_gpencil_settings_get(ob, gps->mat_nr + 1);
+ MaterialGPencilStyle *gp_style = BKE_gpencil_material_settings(ob, gps->mat_nr + 1);
/* check if stroke can be drawn */
if (gpencil_can_draw_stroke(gp_style, gps, false, is_mat_preview) == false) {
@@ -1281,7 +1281,7 @@ static void gpencil_draw_onion_strokes(GpencilBatchCache *cache,
ED_gpencil_parent_location(depsgraph, ob, gpd, gpl, gpf->runtime.parent_obmat);
for (bGPDstroke *gps = gpf->strokes.first; gps; gps = gps->next) {
- MaterialGPencilStyle *gp_style = BKE_material_gpencil_settings_get(ob, gps->mat_nr + 1);
+ MaterialGPencilStyle *gp_style = BKE_gpencil_material_settings(ob, gps->mat_nr + 1);
if (gp_style == NULL) {
continue;
}
@@ -1489,7 +1489,7 @@ void gpencil_populate_buffer_strokes(GPENCIL_e_data *e_data,
}
/* this is not common, but avoid any special situations when brush could be without material */
if (gp_style == NULL) {
- gp_style = BKE_material_gpencil_settings_get(ob, ob->actcol);
+ gp_style = BKE_gpencil_material_settings(ob, ob->actcol);
}
static float unit_mat[4][4] = {
@@ -1713,7 +1713,7 @@ static void gpencil_shgroups_create(GPENCIL_e_data *e_data,
bGPDframe *gpf = elm->gpf;
bGPDstroke *gps = elm->gps;
- MaterialGPencilStyle *gp_style = BKE_material_gpencil_settings_get(ob, gps->mat_nr + 1);
+ MaterialGPencilStyle *gp_style = BKE_gpencil_material_settings(ob, gps->mat_nr + 1);
/* if the user switch used material from data to object,
* the material could not be available */
if (gp_style == NULL) {
diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c
index f4baf2c7837..86183ef0ffb 100644
--- a/source/blender/draw/engines/gpencil/gpencil_engine.c
+++ b/source/blender/draw/engines/gpencil/gpencil_engine.c
@@ -368,7 +368,7 @@ void GPENCIL_cache_init(void *vedata)
}
/* this is not common, but avoid any special situations when brush could be without material */
if (gp_style == NULL) {
- gp_style = BKE_material_gpencil_settings_get(obact, obact->actcol);
+ gp_style = BKE_gpencil_material_settings(obact, obact->actcol);
}
}
diff --git a/source/blender/draw/engines/overlay/overlay_extra.c b/source/blender/draw/engines/overlay/overlay_extra.c
index fc52efb0174..688ecaf3946 100644
--- a/source/blender/draw/engines/overlay/overlay_extra.c
+++ b/source/blender/draw/engines/overlay/overlay_extra.c
@@ -1358,7 +1358,7 @@ static void OVERLAY_gpencil_color_names(Object *ob)
continue;
}
for (bGPDstroke *gps = gpf->strokes.first; gps; gps = gps->next) {
- Material *ma = give_current_material(ob, gps->mat_nr + 1);
+ Material *ma = BKE_object_material_get(ob, gps->mat_nr + 1);
if (ma == NULL) {
continue;
}
diff --git a/source/blender/draw/engines/overlay/overlay_particle.c b/source/blender/draw/engines/overlay/overlay_particle.c
index 3540de35e46..dc98c1b55c1 100644
--- a/source/blender/draw/engines/overlay/overlay_particle.c
+++ b/source/blender/draw/engines/overlay/overlay_particle.c
@@ -186,7 +186,7 @@ void OVERLAY_particle_cache_populate(OVERLAY_Data *vedata, Object *ob)
/* TODO(fclem) Here would be a good place for preemptive culling. */
/* fclem: Is color even usefull in our modern context? */
- Material *ma = give_current_material(ob, part->omat);
+ Material *ma = BKE_object_material_get(ob, part->omat);
float color[4] = {0.6f, 0.6f, 0.6f, part->draw_size};
if (ma != NULL) {
copy_v3_v3(color, &ma->r);
diff --git a/source/blender/draw/engines/workbench/workbench_deferred.c b/source/blender/draw/engines/workbench/workbench_deferred.c
index 26402e66318..3a62e150a9f 100644
--- a/source/blender/draw/engines/workbench/workbench_deferred.c
+++ b/source/blender/draw/engines/workbench/workbench_deferred.c
@@ -1119,7 +1119,7 @@ void workbench_deferred_solid_cache_populate(WORKBENCH_Data *vedata, Object *ob)
struct DRWShadingGroup **shgrps = BLI_array_alloca(shgrps, materials_len);
for (int i = 0; i < materials_len; i++) {
- struct Material *mat = give_current_material(ob, i + 1);
+ struct Material *mat = BKE_object_material_get(ob, i + 1);
if (mat != NULL && mat->a < 1.0f) {
material = workbench_forward_get_or_create_material_data(
vedata, ob, mat, NULL, NULL, V3D_SHADING_MATERIAL_COLOR, 0);
@@ -1141,7 +1141,7 @@ void workbench_deferred_solid_cache_populate(WORKBENCH_Data *vedata, Object *ob)
geoms = DRW_cache_object_surface_material_get(ob, gpumat_array, materials_len);
for (int i = 0; i < materials_len; i++) {
if (geoms != NULL && geoms[i] != NULL) {
- Material *mat = give_current_material(ob, i + 1);
+ Material *mat = BKE_object_material_get(ob, i + 1);
if (mat != NULL && mat->a < 1.0f) {
material = workbench_forward_get_or_create_material_data(
vedata, ob, mat, NULL, NULL, V3D_SHADING_MATERIAL_COLOR, 0);
diff --git a/source/blender/draw/engines/workbench/workbench_forward.c b/source/blender/draw/engines/workbench/workbench_forward.c
index 97bea58f31b..fcdf24d2d2f 100644
--- a/source/blender/draw/engines/workbench/workbench_forward.c
+++ b/source/blender/draw/engines/workbench/workbench_forward.c
@@ -741,7 +741,7 @@ void workbench_forward_cache_populate(WORKBENCH_Data *vedata, Object *ob)
struct DRWShadingGroup **shgrps = BLI_array_alloca(shgrps, materials_len);
for (int i = 0; i < materials_len; i++) {
- struct Material *mat = give_current_material(ob, i + 1);
+ struct Material *mat = BKE_object_material_get(ob, i + 1);
material = workbench_forward_get_or_create_material_data(
vedata, ob, mat, NULL, NULL, V3D_SHADING_MATERIAL_COLOR, 0);
shgrps[i] = material->shgrp;
@@ -764,7 +764,7 @@ void workbench_forward_cache_populate(WORKBENCH_Data *vedata, Object *ob)
continue;
}
- Material *mat = give_current_material(ob, i + 1);
+ Material *mat = BKE_object_material_get(ob, i + 1);
material = workbench_forward_get_or_create_material_data(
vedata, ob, mat, NULL, NULL, V3D_SHADING_MATERIAL_COLOR, 0);
/* TODO(fclem) make this call optional */
diff --git a/source/blender/draw/engines/workbench/workbench_materials.c b/source/blender/draw/engines/workbench/workbench_materials.c
index fc054b11d55..7adc74aab2d 100644
--- a/source/blender/draw/engines/workbench/workbench_materials.c
+++ b/source/blender/draw/engines/workbench/workbench_materials.c
@@ -334,7 +334,7 @@ void workbench_material_get_image_and_mat(
Object *ob, int mat_nr, Image **r_image, ImageUser **r_iuser, int *r_interp, Material **r_mat)
{
bNode *node;
- *r_mat = give_current_material(ob, mat_nr);
+ *r_mat = BKE_object_material_get(ob, mat_nr);
ED_object_get_active_image(ob, mat_nr, r_image, r_iuser, &node, NULL);
if (node && *r_image) {
switch (node->type) {