Commit: 26f603624209a0d18985c13729d55bc09c662a00 Author: Antonio Vazquez Date: Fri May 11 16:49:53 2018 +0200 Branches: greasepencil-object https://developer.blender.org/rB26f603624209a0d18985c13729d55bc09c662a00
Rename struct GpencilColorData to MaterialGPencilStyle =================================================================== M source/blender/blenkernel/BKE_material.h M source/blender/blenkernel/intern/material.c M source/blender/blenloader/intern/readfile.c M source/blender/blenloader/intern/versioning_280.c M source/blender/blenloader/intern/writefile.c M source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c M source/blender/draw/engines/gpencil/gpencil_engine.c M source/blender/draw/engines/gpencil/gpencil_engine.h M source/blender/draw/engines/gpencil/gpencil_geom.c M source/blender/editors/gpencil/drawgpencil.c M source/blender/editors/gpencil/gpencil_colorpick.c M source/blender/editors/gpencil/gpencil_data.c M source/blender/editors/gpencil/gpencil_edit.c M source/blender/editors/gpencil/gpencil_fill.c M source/blender/editors/gpencil/gpencil_paint.c M source/blender/editors/gpencil/gpencil_utils.c M source/blender/makesdna/DNA_material_types.h M source/blender/makesrna/intern/rna_material.c M source/blender/modifiers/intern/MOD_gpencil_util.c M source/blender/modifiers/intern/MOD_gpencilcolor.c M source/blender/modifiers/intern/MOD_gpencilopacity.c M source/blender/modifiers/intern/MOD_gpenciltint.c =================================================================== diff --git a/source/blender/blenkernel/BKE_material.h b/source/blender/blenkernel/BKE_material.h index 7158428d647..c938d5eeb53 100644 --- a/source/blender/blenkernel/BKE_material.h +++ b/source/blender/blenkernel/BKE_material.h @@ -89,7 +89,7 @@ short BKE_object_material_slot_find_index(struct Object *ob, struct Material *ma bool BKE_object_material_slot_add(struct Object *ob); bool BKE_object_material_slot_remove(struct Object *ob); -struct GpencilColorData *BKE_material_gpencil_settings_get(struct Object *ob, short act); +struct MaterialGPencilStyle *BKE_material_gpencil_settings_get(struct Object *ob, short act); void BKE_texpaint_slot_refresh_cache(struct Scene *scene, struct Material *ma); void BKE_texpaint_slots_refresh_object(struct Scene *scene, struct Object *ob); diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index 90e6842dbc7..22ebd4a0ffc 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -114,9 +114,9 @@ void BKE_material_free(Material *ma) void BKE_material_init_gpencil_settings(Material *ma) { if ((ma) && (ma->gp_style == NULL)) { - ma->gp_style = MEM_callocN(sizeof(GpencilColorData), "Grease Pencil Material Settings"); + ma->gp_style = MEM_callocN(sizeof(MaterialGPencilStyle), "Grease Pencil Material Settings"); - GpencilColorData *gp_style = ma->gp_style; + MaterialGPencilStyle *gp_style = ma->gp_style; /* set basic settings */ gp_style->rgb[3] = 1.0f; gp_style->g_boxsize = 0.1f; @@ -538,7 +538,7 @@ Material *give_current_material(Object *ob, short act) return ma; } -GpencilColorData *BKE_material_gpencil_settings_get(Object *ob, short act) +MaterialGPencilStyle *BKE_material_gpencil_settings_get(Object *ob, short act) { Material *ma = give_current_material(ob, act); if (ma != NULL) { diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 34700fa3321..4860e172e42 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -4120,7 +4120,7 @@ static void lib_link_material(FileData *fd, Main *main) /* relink grease pencil settings */ if (ma->gp_style != NULL) { - GpencilColorData *gp_style = ma->gp_style; + MaterialGPencilStyle *gp_style = ma->gp_style; if (gp_style->sima != NULL) { gp_style->sima = newlibadr_us(fd, ma->id.lib, gp_style->sima); } diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index 20c11e0630a..86c8069f772 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -720,7 +720,7 @@ void do_versions_after_linking_280(Main *main) assign_material(ob, ma, ob->totcol, BKE_MAT_ASSIGN_EXISTING); /* copy color settings */ - GpencilColorData *gp_style = ma->gp_style; + MaterialGPencilStyle *gp_style = ma->gp_style; copy_v4_v4(gp_style->rgb, palcolor->color); copy_v4_v4(gp_style->fill, palcolor->fill); gp_style->flag = palcolor->flag; diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 00d9429c9bb..8c3797ebb5d 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -2324,7 +2324,7 @@ static void write_material(WriteData *wd, Material *ma) /* grease pencil settings */ if (ma->gp_style) { - writestruct(wd, DATA, GpencilColorData, 1, ma->gp_style); + writestruct(wd, DATA, MaterialGPencilStyle, 1, ma->gp_style); } } } diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c index b00ea755f84..95c136fcd2f 100644 --- a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c +++ b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c @@ -56,7 +56,7 @@ /* create shading group for filling */ static DRWShadingGroup *DRW_gpencil_shgroup_fill_create(GPENCIL_e_data *e_data, GPENCIL_Data *vedata, DRWPass *pass, - GPUShader *shader, bGPdata *gpd, GpencilColorData *gp_style, int id) + GPUShader *shader, bGPdata *gpd, MaterialGPencilStyle *gp_style, int id) { GPENCIL_StorageList *stl = ((GPENCIL_Data *)vedata)->stl; @@ -124,7 +124,7 @@ static DRWShadingGroup *DRW_gpencil_shgroup_fill_create(GPENCIL_e_data *e_data, /* create shading group for strokes */ DRWShadingGroup *DRW_gpencil_shgroup_stroke_create(GPENCIL_e_data *e_data, GPENCIL_Data *vedata, DRWPass *pass, GPUShader *shader, Object *ob, - bGPdata *gpd, GpencilColorData *gp_style, int id, bool onion) + bGPdata *gpd, MaterialGPencilStyle *gp_style, int id, bool onion) { GPENCIL_StorageList *stl = ((GPENCIL_Data *)vedata)->stl; const float *viewport_size = DRW_viewport_size_get(); @@ -219,7 +219,7 @@ DRWShadingGroup *DRW_gpencil_shgroup_stroke_create(GPENCIL_e_data *e_data, GPENC /* create shading group for volumetrics */ static DRWShadingGroup *DRW_gpencil_shgroup_point_create(GPENCIL_e_data *e_data, GPENCIL_Data *vedata, DRWPass *pass, GPUShader *shader, Object *ob, - bGPdata *gpd, GpencilColorData *gp_style, int id, bool onion) + bGPdata *gpd, MaterialGPencilStyle *gp_style, int id, bool onion) { GPENCIL_StorageList *stl = ((GPENCIL_Data *)vedata)->stl; const float *viewport_size = DRW_viewport_size_get(); @@ -317,7 +317,7 @@ static void gpencil_add_fill_shgroup(GpencilBatchCache *cache, DRWShadingGroup * Object *ob, bGPDlayer *gpl, bGPDframe *gpf, bGPDstroke *gps, const float tintcolor[4], const bool onion, const bool custonion) { - GpencilColorData *gp_style = BKE_material_gpencil_settings_get(ob, gps->mat_nr + 1); + MaterialGPencilStyle *gp_style = BKE_material_gpencil_settings_get(ob, gps->mat_nr + 1); if (gps->totpoints >= 3) { float tfill[4]; /* set color using material, tint color and opacity */ @@ -354,7 +354,7 @@ static void gpencil_add_stroke_shgroup(GpencilBatchCache *cache, DRWShadingGroup float tcolor[4]; float ink[4]; short sthickness; - GpencilColorData *gp_style = BKE_material_gpencil_settings_get(ob, gps->mat_nr + 1); + MaterialGPencilStyle *gp_style = BKE_material_gpencil_settings_get(ob, gps->mat_nr + 1); /* set color using base color, tint color and opacity */ if (!onion) { @@ -398,7 +398,7 @@ static void gpencil_add_editpoints_shgroup( GPENCIL_StorageList *stl, GpencilBatchCache *cache,ToolSettings *ts, Object *ob, bGPdata *gpd, bGPDlayer *gpl, bGPDframe *gpf, bGPDstroke *gps) { - GpencilColorData *gp_style = BKE_material_gpencil_settings_get(ob, gps->mat_nr + 1); + MaterialGPencilStyle *gp_style = BKE_material_gpencil_settings_get(ob, gps->mat_nr + 1); if (GPENCIL_ANY_EDIT_MODE(gpd)) { const DRWContextState *draw_ctx = DRW_context_state_get(); @@ -450,7 +450,7 @@ static void gpencil_draw_onion_strokes(GpencilBatchCache *cache, GPENCIL_e_data for (bGPDstroke *gps = gpf->strokes.first; gps; gps = gps->next) { - GpencilColorData *gp_style = BKE_material_gpencil_settings_get(ob, gps->mat_nr + 1); + MaterialGPencilStyle *gp_style = BKE_material_gpencil_settings_get(ob, gps->mat_nr + 1); copy_v4_v4(gps->tmp_rgb, gp_style->rgb); copy_v4_v4(gps->tmp_fill, gp_style->fill); @@ -524,7 +524,7 @@ static void gpencil_draw_strokes(GpencilBatchCache *cache, GPENCIL_e_data *e_dat } for (gps = derived_gpf->strokes.first; gps; gps = gps->next) { - GpencilColorData *gp_style = BKE_material_gpencil_settings_get(ob, gps->mat_nr + 1); + MaterialGPencilStyle *gp_style = BKE_material_gpencil_settings_get(ob, gps->mat_nr + 1); /* check if stroke can be drawn */ if (gpencil_can_draw_stroke(gp_style, gps, false) == false) { @@ -630,7 +630,7 @@ void DRW_gpencil_populate_buffer_strokes(GPENCIL_e_data *e_data, void *vedata, T GPENCIL_StorageList *stl = ((GPENCIL_Data *)vedata)->stl; Brush *brush = BKE_brush_getactive_gpencil(ts); bGPdata *gpd = ob->data; - GpencilColorData *gp_style = NULL; + MaterialGPencilStyle *gp_style = NULL; float obscale = (ob->size[0] + ob->size[1] + ob->size[2]) / 3.0f; diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c index 78257003e12..27d265e9481 100644 --- a/source/blender/draw/engines/gpencil/gpencil_engine.c +++ b/source/blender/draw/engines/gpencil/gpencil_engine.c @@ -229,7 +229,7 @@ static void GPENCIL_cache_init(void *vedata) /* Special handling for when active object is GP object (e.g. for draw mode) */ Object *obact = draw_ctx->obact; bGPdata *obact_gpd = NULL; - GpencilColorData *gp_style = NULL; + MaterialGPencilStyle *gp_style = NULL; if (obact && (obact->type == OB_GPENCIL) && (obact->data)) { obact_gpd = (bGPdata *)obact->data; diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.h b/source/blender/draw/engines/gpencil/gpencil_engine.h index a89fa271d3e..42ffe5e816d 100644 --- a/source/blender/draw/engines/gpencil/gpencil_engine.h +++ b/source/blender/draw/engines/gpencil/gpencil_engine.h @@ -33,7 +33,7 @@ struct bGPDstroke; struct ModifierData; struct GPENCIL_StorageList; struct Object; -struct GpencilColorData; +struct MaterialGPencilStyle; /* TODO: these could be system parameter in userprefs screen */ #define GPENCIL_MAX_GP_OBJ 256 @@ -235,7 +235,7 @@ typedef struct GpencilBatchCache { } GpencilBatchCache; struct DRWShadingGroup *DRW_gpencil_shgroup_stroke_create(struct GPENCIL_e_data *e_data, struct GPENCIL_Data *vedata, struct DRWPass *pass, struct GPUShader *shader, struct Object *ob, - struct bGPdata *gpd, struct GpencilColorData *gp_style, int id, bool onion); + struct bGPdata *gpd, struct MaterialGPencilStyle *gp_style, int id, bool onion); /* general drawing functions */ void DRW_gpencil_populate_datablock(struct GPENCIL_e_data *e_data, void *vedata, struct Scene *scene, struct Object *ob, struct ToolSettings *ts, struct bGPdata *gpd); void DRW_gpencil_populate_buffer_strokes(struct GPENCIL_e_data *e_data, void *vedata, struct ToolSetting @@ Diff output truncated at 10240 characters. @@ _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org https://lists.blender.org/mailman/listinfo/bf-blender-cvs