From f06884b18ab5b619975689a0670f8f0f14f9c318 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 31 Jul 2018 20:11:55 +1000 Subject: Cleanup: style, duplicate includes --- source/blender/blenkernel/BKE_gpencil_modifier.h | 2 +- source/blender/blenkernel/intern/gpencil.c | 6 +- .../blender/blenkernel/intern/gpencil_modifier.c | 6 +- source/blender/blenkernel/intern/object.c | 34 +++----- source/blender/blenkernel/intern/subdiv_mesh.c | 4 +- source/blender/blenloader/intern/versioning_280.c | 6 +- source/blender/depsgraph/DEG_depsgraph.h | 6 +- .../intern/builder/deg_builder_relations.cc | 18 ++-- .../draw/engines/gpencil/gpencil_cache_utils.c | 5 +- .../draw/engines/gpencil/gpencil_draw_cache_impl.c | 72 +++++++++------- .../draw/engines/gpencil/gpencil_draw_utils.c | 23 ++--- .../blender/draw/engines/gpencil/gpencil_engine.c | 98 ++++++++++++---------- .../blender/draw/engines/gpencil/gpencil_engine.h | 10 ++- .../blender/draw/engines/gpencil/gpencil_render.c | 19 +++-- .../draw/engines/gpencil/gpencil_shader_fx.c | 20 +++-- .../editors/animation/anim_channels_defines.c | 2 - source/blender/editors/animation/anim_filter.c | 2 +- source/blender/editors/gpencil/annotate_draw.c | 7 +- source/blender/editors/gpencil/drawgpencil.c | 2 +- source/blender/editors/gpencil/gpencil_brush.c | 9 +- source/blender/editors/gpencil/gpencil_data.c | 15 ++-- source/blender/editors/gpencil/gpencil_edit.c | 8 +- source/blender/editors/gpencil/gpencil_fill.c | 46 +++++----- source/blender/editors/gpencil/gpencil_intern.h | 14 ++-- source/blender/editors/gpencil/gpencil_ops.c | 12 +-- source/blender/editors/gpencil/gpencil_paint.c | 41 ++++----- source/blender/editors/gpencil/gpencil_primitive.c | 22 +++-- source/blender/editors/gpencil/gpencil_utils.c | 14 ++-- source/blender/editors/include/UI_interface.h | 2 +- .../editors/interface/interface_templates.c | 13 +-- source/blender/editors/object/object_add.c | 3 +- source/blender/editors/object/object_modes.c | 2 +- source/blender/editors/object/object_modifier.c | 19 +++-- .../blender/editors/space_buttons/space_buttons.c | 2 +- .../editors/space_view3d/view3d_gizmo_ruler.c | 1 - .../blender/editors/space_view3d/view3d_select.c | 17 ++-- source/blender/editors/transform/transform.c | 2 - .../editors/transform/transform_snap_object.c | 6 +- .../gpencil_modifiers/MOD_gpencil_modifiertypes.h | 10 +-- .../gpencil_modifiers/intern/MOD_gpencil_util.c | 2 +- .../gpencil_modifiers/intern/MOD_gpencil_util.h | 2 +- .../gpencil_modifiers/intern/MOD_gpencilbuild.c | 4 +- .../gpencil_modifiers/intern/MOD_gpencilcolor.c | 4 +- .../gpencil_modifiers/intern/MOD_gpencilhook.c | 4 +- .../gpencil_modifiers/intern/MOD_gpencilinstance.c | 4 +- .../gpencil_modifiers/intern/MOD_gpencillattice.c | 4 +- .../gpencil_modifiers/intern/MOD_gpencilmirror.c | 10 +-- .../gpencil_modifiers/intern/MOD_gpencilnoise.c | 2 +- .../gpencil_modifiers/intern/MOD_gpenciloffset.c | 4 +- .../gpencil_modifiers/intern/MOD_gpencilopacity.c | 6 +- .../gpencil_modifiers/intern/MOD_gpencilsimplify.c | 4 +- .../gpencil_modifiers/intern/MOD_gpencilsmooth.c | 4 +- .../gpencil_modifiers/intern/MOD_gpencilsubdiv.c | 4 +- .../gpencil_modifiers/intern/MOD_gpencilthick.c | 4 +- .../gpencil_modifiers/intern/MOD_gpenciltint.c | 4 +- .../blender/makesdna/DNA_gpencil_modifier_types.h | 8 +- source/blender/makesdna/DNA_shader_fx_types.h | 8 +- source/blender/makesrna/intern/rna_gpencil.c | 5 +- .../blender/makesrna/intern/rna_gpencil_modifier.c | 1 - source/blender/makesrna/intern/rna_shader_fx.c | 1 - 60 files changed, 354 insertions(+), 335 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_gpencil_modifier.h b/source/blender/blenkernel/BKE_gpencil_modifier.h index cd6b6540012..be27560bbf2 100644 --- a/source/blender/blenkernel/BKE_gpencil_modifier.h +++ b/source/blender/blenkernel/BKE_gpencil_modifier.h @@ -22,7 +22,7 @@ #ifndef __BKE_GPENCIL_MODIFIER_H__ #define __BKE_GPENCIL_MODIFIER_H__ -/** \file BKE_greasepencil_modifier.h +/** \file BKE_gpencil_modifier.h * \ingroup bke */ diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c index de3f891f9f9..c86f39f1d55 100644 --- a/source/blender/blenkernel/intern/gpencil.c +++ b/source/blender/blenkernel/intern/gpencil.c @@ -546,7 +546,7 @@ void BKE_gpencil_stroke_weights_duplicate(bGPDstroke *gps_src, bGPDstroke *gps_d } BLI_assert(gps_src->totpoints == gps_dst->totpoints); - if ((gps_src->dvert == NULL) || (gps_dst->dvert == NULL)){ + if ((gps_src->dvert == NULL) || (gps_dst->dvert == NULL)) { return; } @@ -1050,7 +1050,7 @@ Material *BKE_gpencil_get_material_from_brush(Brush *brush) Material *ma = NULL; if ((brush != NULL) && (brush->gpencil_settings != NULL) && - (brush->gpencil_settings->material != NULL)) + (brush->gpencil_settings->material != NULL)) { ma = brush->gpencil_settings->material; } @@ -1076,7 +1076,7 @@ Material *BKE_gpencil_material_ensure(Main *bmain, Object *ob) assign_material(bmain, ob, ma, ob->totcol, BKE_MAT_ASSIGN_EXISTING); } else if (ma->gp_style == NULL) { - BKE_material_init_gpencil_settings(ma); + BKE_material_init_gpencil_settings(ma); } return ma; diff --git a/source/blender/blenkernel/intern/gpencil_modifier.c b/source/blender/blenkernel/intern/gpencil_modifier.c index 2ba738902a0..3c2196afb18 100644 --- a/source/blender/blenkernel/intern/gpencil_modifier.c +++ b/source/blender/blenkernel/intern/gpencil_modifier.c @@ -384,8 +384,7 @@ void BKE_gpencil_stroke_modifiers(Depsgraph *depsgraph, Object *ob, bGPDlayer *g const bool is_edit = GPENCIL_ANY_EDIT_MODE(gpd); for (md = ob->greasepencil_modifiers.first; md; md = md->next) { - if (GPENCIL_MODIFIER_ACTIVE(md, is_render)) - { + if (GPENCIL_MODIFIER_ACTIVE(md, is_render)) { const GpencilModifierTypeInfo *mti = BKE_gpencil_modifierType_getInfo(md->type); if (GPENCIL_MODIFIER_EDIT(md, is_edit)) { @@ -407,8 +406,7 @@ void BKE_gpencil_geometry_modifiers(Depsgraph *depsgraph, Object *ob, bGPDlayer const bool is_edit = GPENCIL_ANY_EDIT_MODE(gpd); for (md = ob->greasepencil_modifiers.first; md; md = md->next) { - if (GPENCIL_MODIFIER_ACTIVE(md, is_render)) - { + if (GPENCIL_MODIFIER_ACTIVE(md, is_render)) { const GpencilModifierTypeInfo *mti = BKE_gpencil_modifierType_getInfo(md->type); if (GPENCIL_MODIFIER_EDIT(md, is_edit)) { diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 9c7ce7698f7..41c23c46c44 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -3821,24 +3821,18 @@ bool BKE_object_modifier_gpencil_use_time(Object *ob, GpencilModifierData *md) /* action - check for F-Curves with paths containing 'grease_pencil_modifiers[' */ if (adt->action) { - for (fcu = (FCurve *)adt->action->curves.first; - fcu != NULL; - fcu = (FCurve *)fcu->next) - { - if (fcu->rna_path && strstr(fcu->rna_path, pattern)) + for (fcu = adt->action->curves.first; fcu != NULL; fcu = fcu->next) { + if (fcu->rna_path && strstr(fcu->rna_path, pattern)) { return true; + } } } - /* This here allows modifier properties to get driven and still update properly - * - */ - for (fcu = (FCurve *)adt->drivers.first; - fcu != NULL; - fcu = (FCurve *)fcu->next) - { - if (fcu->rna_path && strstr(fcu->rna_path, pattern)) + /* This here allows modifier properties to get driven and still update properly */ + for (fcu = adt->drivers.first; fcu != NULL; fcu = fcu->next) { + if (fcu->rna_path && strstr(fcu->rna_path, pattern)) { return true; + } } } @@ -3862,22 +3856,14 @@ bool BKE_object_shaderfx_use_time(Object *ob, ShaderFxData *fx) /* action - check for F-Curves with paths containing string[' */ if (adt->action) { - for (fcu = (FCurve *)adt->action->curves.first; - fcu != NULL; - fcu = (FCurve *)fcu->next) - { + for (fcu = adt->action->curves.first; fcu != NULL; fcu = fcu->next) { if (fcu->rna_path && strstr(fcu->rna_path, pattern)) return true; } } - /* This here allows properties to get driven and still update properly - * - */ - for (fcu = (FCurve *)adt->drivers.first; - fcu != NULL; - fcu = (FCurve *)fcu->next) - { + /* This here allows properties to get driven and still update properly */ + for (fcu = adt->drivers.first; fcu != NULL; fcu = fcu->next) { if (fcu->rna_path && strstr(fcu->rna_path, pattern)) return true; } diff --git a/source/blender/blenkernel/intern/subdiv_mesh.c b/source/blender/blenkernel/intern/subdiv_mesh.c index 895d527ea5c..db7366a2414 100644 --- a/source/blender/blenkernel/intern/subdiv_mesh.c +++ b/source/blender/blenkernel/intern/subdiv_mesh.c @@ -277,7 +277,7 @@ static void subdiv_mesh_ctx_init_offsets(SubdivMeshContext *ctx) num_ptex_faces_per_poly * (num_inner_edges_per_ptex_face_get( no_quad_patch_resolution - 1) + - (no_quad_patch_resolution - 2) + + (no_quad_patch_resolution - 2) + num_subdiv_vertices_per_coarse_edge); if (no_quad_patch_resolution >= 3) { edge_offset += coarse_poly->totloop; @@ -2193,7 +2193,7 @@ static void subdiv_copy_poly_data(const SubdivMeshContext *ctx, static void subdiv_create_polys(SubdivMeshContext *ctx, int poly_index) { const int resolution = ctx->settings->resolution; - const int start_poly_index = ctx->subdiv_polygon_offset[poly_index]; + const int start_poly_index = ctx->subdiv_polygon_offset[poly_index]; /* Base/coarse mesh information. */ const Mesh *coarse_mesh = ctx->coarse_mesh; const MPoly *coarse_mpoly = coarse_mesh->mpoly; diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index 93577315b1c..d2a1cc1f4f1 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -846,7 +846,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) if (ntree->type == NTREE_SHADER) { for (bNode *node = ntree->nodes.first; node; node = node->next) { if (node->type == 194 /* SH_NODE_EEVEE_METALLIC */ && - STREQ(node->idname, "ShaderNodeOutputMetallic")) + STREQ(node->idname, "ShaderNodeOutputMetallic")) { BLI_strncpy(node->idname, "ShaderNodeEeveeMetallic", sizeof(node->idname)); error |= NTREE_DOVERSION_NEED_OUTPUT; @@ -858,14 +858,14 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } else if (node->type == 196 /* SH_NODE_OUTPUT_EEVEE_MATERIAL */ && - STREQ(node->idname, "ShaderNodeOutputEeveeMaterial")) + STREQ(node->idname, "ShaderNodeOutputEeveeMaterial")) { node->type = SH_NODE_OUTPUT_MATERIAL; BLI_strncpy(node->idname, "ShaderNodeOutputMaterial", sizeof(node->idname)); } else if (node->type == 194 /* SH_NODE_EEVEE_METALLIC */ && - STREQ(node->idname, "ShaderNodeEeveeMetallic")) + STREQ(node->idname, "ShaderNodeEeveeMetallic")) { node->type = SH_NODE_BSDF_PRINCIPLED; BLI_strncpy(node->idname, "ShaderNodeBsdfPrincipled", sizeof(node->idname)); diff --git a/source/blender/depsgraph/DEG_depsgraph.h b/source/blender/depsgraph/DEG_depsgraph.h index 2e566752a6f..7d827f48f9c 100644 --- a/source/blender/depsgraph/DEG_depsgraph.h +++ b/source/blender/depsgraph/DEG_depsgraph.h @@ -239,9 +239,9 @@ void DEG_make_inactive(struct Depsgraph *depsgraph); void DEG_debug_print_begin(struct Depsgraph *depsgraph); void DEG_debug_print_eval(struct Depsgraph *depsgraph, - const char* function_name, - const char* object_name, - const void* object_address); + const char *function_name, + const char *object_name, + const void *object_address); void DEG_debug_print_eval_subdata(struct Depsgraph *depsgraph, const char *function_name, diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index c9a00b0bf0f..1d01b3e987b 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -2005,22 +2005,22 @@ void DepsgraphRelationBuilder::build_object_data_geometry_datablock(ID *obdata) TimeSourceKey time_key; ComponentKey geometry_key(obdata, DEG_NODE_TYPE_GEOMETRY); add_relation(time_key, - geometry_key, - "GP Frame Change"); + geometry_key, + "GP Frame Change"); /* Geometry cache also needs to be recalculated when Material - * settings change (e.g. when fill.opacity changes on/off, - * we need to rebuild the bGPDstroke->triangles caches) - */ + * settings change (e.g. when fill.opacity changes on/off, + * we need to rebuild the bGPDstroke->triangles caches) + */ for (int i = 0; i < gpd->totcol; i++) { Material *ma = gpd->mat[i]; if ((ma != NULL) && (ma->gp_style != NULL)) { OperationKey material_key(&ma->id, - DEG_NODE_TYPE_SHADING, - DEG_OPCODE_MATERIAL_UPDATE); + DEG_NODE_TYPE_SHADING, + DEG_OPCODE_MATERIAL_UPDATE); add_relation(material_key, - geometry_key, - "Material -> GP Data"); + geometry_key, + "Material -> GP Data"); } } break; diff --git a/source/blender/draw/engines/gpencil/gpencil_cache_utils.c b/source/blender/draw/engines/gpencil/gpencil_cache_utils.c index 4e01c42d33d..e8bb27b2724 100644 --- a/source/blender/draw/engines/gpencil/gpencil_cache_utils.c +++ b/source/blender/draw/engines/gpencil/gpencil_cache_utils.c @@ -38,8 +38,9 @@ #include "draw_cache_impl.h" /* add a gpencil object to cache to defer drawing */ -tGPencilObjectCache *gpencil_object_cache_add(tGPencilObjectCache *cache_array, Object *ob, bool is_temp, - int *gp_cache_size, int *gp_cache_used) +tGPencilObjectCache *gpencil_object_cache_add( + tGPencilObjectCache *cache_array, Object *ob, bool is_temp, + int *gp_cache_size, int *gp_cache_used) { const DRWContextState *draw_ctx = DRW_context_state_get(); tGPencilObjectCache *cache_elem = NULL; 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 dd5db85f3f4..83a52e077ca 100644 --- a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c +++ b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c @@ -158,36 +158,42 @@ GPUBatch *DRW_gpencil_get_stroke_geom(bGPDframe *gpf, bGPDstroke *gps, short thi /* first point for adjacency (not drawn) */ if (i == 0) { if (gps->flag & GP_STROKE_CYCLIC && totpoints > 2) { - gpencil_set_stroke_point(vbo, gpf->runtime.viewmatrix, &points[totpoints - 1], idx, - pos_id, color_id, thickness_id, uvdata_id, thickness, ink); + gpencil_set_stroke_point( + vbo, gpf->runtime.viewmatrix, &points[totpoints - 1], idx, + pos_id, color_id, thickness_id, uvdata_id, thickness, ink); idx++; } else { - gpencil_set_stroke_point(vbo, gpf->runtime.viewmatrix, &points[1], idx, - pos_id, color_id, thickness_id, uvdata_id, thickness, ink); + gpencil_set_stroke_point( + vbo, gpf->runtime.viewmatrix, &points[1], idx, + pos_id, color_id, thickness_id, uvdata_id, thickness, ink); idx++; } } /* set point */ - gpencil_set_stroke_point(vbo, gpf->runtime.viewmatrix, pt, idx, - pos_id, color_id, thickness_id, uvdata_id, thickness, ink); + gpencil_set_stroke_point( + vbo, gpf->runtime.viewmatrix, pt, idx, + pos_id, color_id, thickness_id, uvdata_id, thickness, ink); idx++; } if (gps->flag & GP_STROKE_CYCLIC && totpoints > 2) { /* draw line to first point to complete the cycle */ - gpencil_set_stroke_point(vbo, gpf->runtime.viewmatrix, &points[0], idx, - pos_id, color_id, thickness_id, uvdata_id, thickness, ink); + gpencil_set_stroke_point( + vbo, gpf->runtime.viewmatrix, &points[0], idx, + pos_id, color_id, thickness_id, uvdata_id, thickness, ink); idx++; /* now add adjacency point (not drawn) */ - gpencil_set_stroke_point(vbo, gpf->runtime.viewmatrix, &points[1], idx, - pos_id, color_id, thickness_id, uvdata_id, thickness, ink); + gpencil_set_stroke_point( + vbo, gpf->runtime.viewmatrix, &points[1], idx, + pos_id, color_id, thickness_id, uvdata_id, thickness, ink); idx++; } /* last adjacency point (not drawn) */ else { - gpencil_set_stroke_point(vbo, gpf->runtime.viewmatrix, &points[totpoints - 2], idx, - pos_id, color_id, thickness_id, uvdata_id, thickness, ink); + gpencil_set_stroke_point( + vbo, gpf->runtime.viewmatrix, &points[totpoints - 2], idx, + pos_id, color_id, thickness_id, uvdata_id, thickness, ink); } return GPU_batch_create_ex(GPU_PRIM_LINE_STRIP_ADJ, vbo, NULL, GPU_BATCH_OWNS_VBO); @@ -237,30 +243,35 @@ GPUBatch *DRW_gpencil_get_buffer_stroke_geom(bGPdata *gpd, float matrix[4][4], s if (i == 0) { if (totpoints > 1) { ED_gpencil_tpoint_to_point(ar, origin, &points[1], &pt2); - gpencil_set_stroke_point(vbo, matrix, &pt2, idx, - pos_id, color_id, thickness_id, uvdata_id, thickness, gpd->runtime.scolor); + gpencil_set_stroke_point( + vbo, matrix, &pt2, idx, + pos_id, color_id, thickness_id, uvdata_id, thickness, gpd->runtime.scolor); } else { - gpencil_set_stroke_point(vbo, matrix, &pt, idx, - pos_id, color_id, thickness_id, uvdata_id, thickness, gpd->runtime.scolor); + gpencil_set_stroke_point( + vbo, matrix, &pt, idx, + pos_id, color_id, thickness_id, uvdata_id, thickness, gpd->runtime.scolor); } idx++; } /* set point */ - gpencil_set_stroke_point(vbo, matrix, &pt, idx, - pos_id, color_id, thickness_id, uvdata_id, thickness, gpd->runtime.scolor); + gpencil_set_stroke_point( + vbo, matrix, &pt, idx, + pos_id, color_id, thickness_id, uvdata_id, thickness, gpd->runtime.scolor); idx++; } /* last adjacency point (not drawn) */ if (totpoints > 2) { ED_gpencil_tpoint_to_point(ar, origin, &points[totpoints - 2], &pt2); - gpencil_set_stroke_point(vbo, matrix, &pt2, idx, - pos_id, color_id, thickness_id, uvdata_id, thickness, gpd->runtime.scolor); + gpencil_set_stroke_point( + vbo, matrix, &pt2, idx, + pos_id, color_id, thickness_id, uvdata_id, thickness, gpd->runtime.scolor); } else { - gpencil_set_stroke_point(vbo, matrix, &pt, idx, - pos_id, color_id, thickness_id, uvdata_id, thickness, gpd->runtime.scolor); + gpencil_set_stroke_point( + vbo, matrix, &pt, idx, + pos_id, color_id, thickness_id, uvdata_id, thickness, gpd->runtime.scolor); } return GPU_batch_create_ex(GPU_PRIM_LINE_STRIP_ADJ, vbo, NULL, GPU_BATCH_OWNS_VBO); @@ -307,9 +318,10 @@ GPUBatch *DRW_gpencil_get_buffer_point_geom(bGPdata *gpd, float matrix[4][4], sh ED_gp_project_point_to_plane(ob, rv3d, origin, ts->gp_sculpt.lock_axis - 1, &pt); /* set point */ - gpencil_set_stroke_point(vbo, matrix, &pt, idx, - pos_id, color_id, thickness_id, uvdata_id, - thickness, gpd->runtime.scolor); + gpencil_set_stroke_point( + vbo, matrix, &pt, idx, + pos_id, color_id, thickness_id, uvdata_id, + thickness, gpd->runtime.scolor); idx++; } @@ -600,9 +612,10 @@ GPUBatch *DRW_gpencil_get_edlin_geom(bGPDstroke *gps, float alpha, short UNUSED( return GPU_batch_create_ex(GPU_PRIM_LINE_STRIP, vbo, NULL, GPU_BATCH_OWNS_VBO); } -static void set_grid_point(GPUVertBuf *vbo, int idx, float col_grid[4], - uint pos_id, uint color_id, - float v1, float v2, int axis) +static void set_grid_point( + GPUVertBuf *vbo, int idx, float col_grid[4], + uint pos_id, uint color_id, + float v1, float v2, int axis) { GPU_vertbuf_attr_set(vbo, color_id, idx, col_grid); @@ -618,8 +631,7 @@ static void set_grid_point(GPUVertBuf *vbo, int idx, float col_grid[4], pos[1] = v2; pos[2] = 0.0f; } - else - { + else { pos[0] = v1; pos[1] = 0.0f; pos[2] = v2; diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c index 76cb1405a71..04399d1cad7 100644 --- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c +++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c @@ -63,8 +63,9 @@ #define PATTERN 5 /* Helper for doing all the checks on whether a stroke can be drawn */ -static bool gpencil_can_draw_stroke(struct MaterialGPencilStyle *gp_style, const bGPDstroke *gps, - const bool onion, const bool is_mat_preview) +static bool gpencil_can_draw_stroke( + struct MaterialGPencilStyle *gp_style, const bGPDstroke *gps, + const bool onion, const bool is_mat_preview) { /* skip stroke if it doesn't have any valid data */ if ((gps->points == NULL) || (gps->totpoints < 1) || (gp_style == NULL)) @@ -77,8 +78,8 @@ static bool gpencil_can_draw_stroke(struct MaterialGPencilStyle *gp_style, const /* check if the color is visible */ if ((gp_style == NULL) || - (gp_style->flag & GP_STYLE_COLOR_HIDE) || - (onion && (gp_style->flag & GP_STYLE_COLOR_ONIONSKIN))) + (gp_style->flag & GP_STYLE_COLOR_HIDE) || + (onion && (gp_style->flag & GP_STYLE_COLOR_ONIONSKIN))) { return false; } @@ -656,8 +657,8 @@ static void gpencil_add_editpoints_shgroup( } if (cache->batch_edlin[cache->cache_idx]) { if ((obact) && (obact == ob) && - ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) && - (v3d->flag3 & V3D_GP_SHOW_EDIT_LINES)) + ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) && + (v3d->flag3 & V3D_GP_SHOW_EDIT_LINES)) { DRW_shgroup_call_add( stl->g_data->shgrps_edit_line, @@ -947,7 +948,7 @@ void DRW_gpencil_populate_buffer_strokes(GPENCIL_e_data *e_data, void *vedata, T stl->storage->unit_matrix); if ((gpd->runtime.sbuffer_size >= 3) && (gpd->runtime.sfill[3] > GPENCIL_ALPHA_OPACITY_THRESH) && - ((gpd->runtime.sbuffer_sflag & GP_STROKE_NOFILL) == 0)) + ((gpd->runtime.sbuffer_sflag & GP_STROKE_NOFILL) == 0)) { /* if not solid, fill is simulated with solid color */ if (gpd->runtime.bfill_style > 0) { @@ -1229,12 +1230,12 @@ void DRW_gpencil_populate_datablock(GPENCIL_e_data *e_data, void *vedata, Scene /* draw onion skins */ if ((gpd->flag & GP_DATA_SHOW_ONIONSKINS) && - (!no_onion) && (overlay) && - (gpl->onion_flag & GP_LAYER_ONIONSKIN) && - ((!playing) || (gpd->onion_flag & GP_ONION_GHOST_ALWAYS))) + (!no_onion) && (overlay) && + (gpl->onion_flag & GP_LAYER_ONIONSKIN) && + ((!playing) || (gpd->onion_flag & GP_ONION_GHOST_ALWAYS))) { if ((!stl->storage->is_render) || - ((stl->storage->is_render) && (gpd->onion_flag & GP_ONION_GHOST_ALWAYS))) + ((stl->storage->is_render) && (gpd->onion_flag & GP_ONION_GHOST_ALWAYS))) { gpencil_draw_onionskins(cache, e_data, vedata, ob, gpd, gpl, gpf); } diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c index 71c99b2bcdf..d81cf8b7752 100644 --- a/source/blender/draw/engines/gpencil/gpencil_engine.c +++ b/source/blender/draw/engines/gpencil/gpencil_engine.c @@ -87,10 +87,11 @@ void DRW_gpencil_multisample_ensure(GPENCIL_Data *vedata, int rect_w, int rect_h txl->multisample_depth = GPU_texture_create_2D_multisample( rect_w, rect_h, GPU_DEPTH24_STENCIL8, NULL, samples, NULL); } - GPU_framebuffer_ensure_config(&fbl->multisample_fb, { - GPU_ATTACHMENT_TEXTURE(txl->multisample_depth), - GPU_ATTACHMENT_TEXTURE(txl->multisample_color) - }); + GPU_framebuffer_ensure_config( + &fbl->multisample_fb, { + GPU_ATTACHMENT_TEXTURE(txl->multisample_depth), + GPU_ATTACHMENT_TEXTURE(txl->multisample_color) + }); if (!GPU_framebuffer_check_valid(fbl->multisample_fb, NULL)) { GPU_framebuffer_free(fbl->multisample_fb); } @@ -121,39 +122,49 @@ static void GPENCIL_create_framebuffers(void *vedata) &draw_engine_gpencil_type); e_data.temp_color_tx_a = DRW_texture_pool_query_2D(size[0], size[1], fb_format, &draw_engine_gpencil_type); - GPU_framebuffer_ensure_config(&fbl->temp_fb_a, { - GPU_ATTACHMENT_TEXTURE(e_data.temp_depth_tx_a), - GPU_ATTACHMENT_TEXTURE(e_data.temp_color_tx_a) - }); - - e_data.temp_depth_tx_b = DRW_texture_pool_query_2D(size[0], size[1], GPU_DEPTH24_STENCIL8, - &draw_engine_gpencil_type); - e_data.temp_color_tx_b = DRW_texture_pool_query_2D(size[0], size[1], fb_format, - &draw_engine_gpencil_type); - GPU_framebuffer_ensure_config(&fbl->temp_fb_b, { - GPU_ATTACHMENT_TEXTURE(e_data.temp_depth_tx_b), - GPU_ATTACHMENT_TEXTURE(e_data.temp_color_tx_b) - }); + GPU_framebuffer_ensure_config( + &fbl->temp_fb_a, { + GPU_ATTACHMENT_TEXTURE(e_data.temp_depth_tx_a), + GPU_ATTACHMENT_TEXTURE(e_data.temp_color_tx_a) + }); + + e_data.temp_depth_tx_b = DRW_texture_pool_query_2D( + size[0], size[1], GPU_DEPTH24_STENCIL8, + &draw_engine_gpencil_type); + e_data.temp_color_tx_b = DRW_texture_pool_query_2D( + size[0], size[1], fb_format, + &draw_engine_gpencil_type); + GPU_framebuffer_ensure_config( + &fbl->temp_fb_b, { + GPU_ATTACHMENT_TEXTURE(e_data.temp_depth_tx_b), + GPU_ATTACHMENT_TEXTURE(e_data.temp_color_tx_b) + }); /* used for rim FX effect */ - e_data.temp_depth_tx_rim = DRW_texture_pool_query_2D(size[0], size[1], GPU_DEPTH24_STENCIL8, - &draw_engine_gpencil_type); - e_data.temp_color_tx_rim = DRW_texture_pool_query_2D(size[0], size[1], fb_format, - &draw_engine_gpencil_type); - GPU_framebuffer_ensure_config(&fbl->temp_fb_rim, { - GPU_ATTACHMENT_TEXTURE(e_data.temp_depth_tx_rim), - GPU_ATTACHMENT_TEXTURE(e_data.temp_color_tx_rim), - }); + e_data.temp_depth_tx_rim = DRW_texture_pool_query_2D( + size[0], size[1], GPU_DEPTH24_STENCIL8, + &draw_engine_gpencil_type); + e_data.temp_color_tx_rim = DRW_texture_pool_query_2D( + size[0], size[1], fb_format, + &draw_engine_gpencil_type); + GPU_framebuffer_ensure_config( + &fbl->temp_fb_rim, { + GPU_ATTACHMENT_TEXTURE(e_data.temp_depth_tx_rim), + GPU_ATTACHMENT_TEXTURE(e_data.temp_color_tx_rim), + }); /* background framebuffer to speed up drawing process (always 16 bits) */ - e_data.background_depth_tx = DRW_texture_pool_query_2D(size[0], size[1], GPU_DEPTH24_STENCIL8, - &draw_engine_gpencil_type); - e_data.background_color_tx = DRW_texture_pool_query_2D(size[0], size[1], GPU_RGBA32F, - &draw_engine_gpencil_type); - GPU_framebuffer_ensure_config(&fbl->background_fb, { - GPU_ATTACHMENT_TEXTURE(e_data.background_depth_tx), - GPU_ATTACHMENT_TEXTURE(e_data.background_color_tx) - }); + e_data.background_depth_tx = DRW_texture_pool_query_2D( + size[0], size[1], GPU_DEPTH24_STENCIL8, + &draw_engine_gpencil_type); + e_data.background_color_tx = DRW_texture_pool_query_2D( + size[0], size[1], GPU_RGBA32F, + &draw_engine_gpencil_type); + GPU_framebuffer_ensure_config( + &fbl->background_fb, { + GPU_ATTACHMENT_TEXTURE(e_data.background_depth_tx), + GPU_ATTACHMENT_TEXTURE(e_data.background_color_tx) + }); } } @@ -358,7 +369,7 @@ void GPENCIL_cache_init(void *vedata) (stl->storage->playing == 0)) { if (((obact_gpd->runtime.sbuffer_sflag & GP_STROKE_ERASER) == 0) && - (obact_gpd->runtime.sbuffer_size > 1)) + (obact_gpd->runtime.sbuffer_size > 1)) { stl->g_data->session_flag = GP_DRW_PAINT_PAINTING; } @@ -485,8 +496,9 @@ void GPENCIL_cache_populate(void *vedata, Object *ob) } /* allocate memory for saving gp objects for drawing later */ - stl->g_data->gp_object_cache = gpencil_object_cache_add(stl->g_data->gp_object_cache, ob, false, - &stl->g_data->gp_cache_size, &stl->g_data->gp_cache_used); + stl->g_data->gp_object_cache = gpencil_object_cache_add( + stl->g_data->gp_object_cache, ob, false, + &stl->g_data->gp_cache_size, &stl->g_data->gp_cache_used); /* generate instances as separate cache objects for instance modifiers * with the "Make as Objects" option enabled @@ -500,9 +512,9 @@ void GPENCIL_cache_populate(void *vedata, Object *ob) /* grid */ if ((v3d) && - ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) && - (v3d->flag3 & V3D_GP_SHOW_GRID) && - (ob->type == OB_GPENCIL) && (ob == draw_ctx->obact)) + ((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) && + (v3d->flag3 & V3D_GP_SHOW_GRID) && + (ob->type == OB_GPENCIL) && (ob == draw_ctx->obact)) { stl->g_data->batch_grid = DRW_gpencil_get_grid(); DRW_shgroup_call_add(stl->g_data->shgrps_grid, @@ -631,8 +643,8 @@ void GPENCIL_draw_scene(void *ved) /* paper pass to display a confortable area to draw over complex scenes with geometry */ if ((!is_render) && (obact) && (obact->type == OB_GPENCIL)) { if (((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) && - (v3d->flag3 & V3D_GP_SHOW_PAPER) && - (stl->g_data->gp_cache_used > 0)) + (v3d->flag3 & V3D_GP_SHOW_PAPER) && + (stl->g_data->gp_cache_used > 0)) { DRW_draw_pass(psl->paper_pass); } @@ -655,7 +667,7 @@ void GPENCIL_draw_scene(void *ved) /* grid pass */ if ((!is_render) && (obact) && (obact->type == OB_GPENCIL)) { if (((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) && - (v3d->flag3 & V3D_GP_SHOW_GRID)) + (v3d->flag3 & V3D_GP_SHOW_GRID)) { DRW_draw_pass(psl->grid_pass); } @@ -744,7 +756,7 @@ void GPENCIL_draw_scene(void *ved) /* grid pass */ if ((!is_render) && (obact) && (obact->type == OB_GPENCIL)) { if (((v3d->flag2 & V3D_RENDER_OVERRIDE) == 0) && - (v3d->flag3 & V3D_GP_SHOW_GRID)) + (v3d->flag3 & V3D_GP_SHOW_GRID)) { DRW_draw_pass(psl->grid_pass); } diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.h b/source/blender/draw/engines/gpencil/gpencil_engine.h index 24a627f1012..5d276490663 100644 --- a/source/blender/draw/engines/gpencil/gpencil_engine.h +++ b/source/blender/draw/engines/gpencil/gpencil_engine.h @@ -279,8 +279,9 @@ typedef struct GpencilBatchCache { } GpencilBatchCache; /* general drawing functions */ -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 MaterialGPencilStyle *gp_style, int id, bool onion); +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 MaterialGPencilStyle *gp_style, int id, bool onion); void DRW_gpencil_populate_datablock(struct GPENCIL_e_data *e_data, void *vedata, struct Scene *scene, struct Object *ob, struct bGPdata *gpd); void DRW_gpencil_populate_buffer_strokes(struct GPENCIL_e_data *e_data, void *vedata, struct ToolSettings *ts, struct Object *ob); void DRW_gpencil_populate_multiedit(struct GPENCIL_e_data *e_data, void *vedata, struct Scene *scene, struct Object *ob, struct bGPdata *gpd); @@ -300,8 +301,9 @@ struct GPUBatch *DRW_gpencil_get_buffer_point_geom(struct bGPdata *gpd, float ma struct GPUBatch *DRW_gpencil_get_grid(void); /* object cache functions */ -struct tGPencilObjectCache *gpencil_object_cache_add(struct tGPencilObjectCache *cache_array, struct Object *ob, - bool is_temp, int *gp_cache_size, int *gp_cache_used); +struct tGPencilObjectCache *gpencil_object_cache_add( + struct tGPencilObjectCache *cache_array, struct Object *ob, + bool is_temp, int *gp_cache_size, int *gp_cache_used); /* geometry batch cache functions */ void gpencil_batch_cache_check_free_slots(struct Object *ob); diff --git a/source/blender/draw/engines/gpencil/gpencil_render.c b/source/blender/draw/engines/gpencil/gpencil_render.c index d76ea56894f..0b90de88ec1 100644 --- a/source/blender/draw/engines/gpencil/gpencil_render.c +++ b/source/blender/draw/engines/gpencil/gpencil_render.c @@ -84,14 +84,17 @@ void GPENCIL_render_init(GPENCIL_Data *ved, RenderEngine *engine, struct Depsgra DRW_gpencil_multisample_ensure(vedata, rect_w, rect_h); } - vedata->render_depth_tx = DRW_texture_pool_query_2D(size[0], size[1], GPU_DEPTH24_STENCIL8, - &draw_engine_gpencil_type); - vedata->render_color_tx = DRW_texture_pool_query_2D(size[0], size[1], GPU_RGBA32F, - &draw_engine_gpencil_type); - GPU_framebuffer_ensure_config(&fbl->main, { - GPU_ATTACHMENT_TEXTURE(vedata->render_depth_tx), - GPU_ATTACHMENT_TEXTURE(vedata->render_color_tx) - }); + vedata->render_depth_tx = DRW_texture_pool_query_2D( + size[0], size[1], GPU_DEPTH24_STENCIL8, + &draw_engine_gpencil_type); + vedata->render_color_tx = DRW_texture_pool_query_2D( + size[0], size[1], GPU_RGBA32F, + &draw_engine_gpencil_type); + GPU_framebuffer_ensure_config( + &fbl->main, { + GPU_ATTACHMENT_TEXTURE(vedata->render_depth_tx), + GPU_ATTACHMENT_TEXTURE(vedata->render_color_tx) + }); /* Alloc transient data. */ if (!stl->g_data) { diff --git a/source/blender/draw/engines/gpencil/gpencil_shader_fx.c b/source/blender/draw/engines/gpencil/gpencil_shader_fx.c index e453224020d..827f2e9344b 100644 --- a/source/blender/draw/engines/gpencil/gpencil_shader_fx.c +++ b/source/blender/draw/engines/gpencil/gpencil_shader_fx.c @@ -211,8 +211,9 @@ static void DRW_gpencil_fx_blur( struct GPUBatch *fxquad = DRW_cache_fullscreen_quad_get(); - fx_shgrp = DRW_shgroup_create(e_data->gpencil_fx_blur_sh, - psl->fx_shader_pass_blend); + fx_shgrp = DRW_shgroup_create( + e_data->gpencil_fx_blur_sh, + psl->fx_shader_pass_blend); DRW_shgroup_call_add(fx_shgrp, fxquad, NULL); DRW_shgroup_uniform_texture_ref(fx_shgrp, "strokeColor", &e_data->temp_color_tx_a); DRW_shgroup_uniform_texture_ref(fx_shgrp, "strokeDepth", &e_data->temp_depth_tx_a); @@ -389,8 +390,9 @@ static void DRW_gpencil_fx_rim( struct GPUBatch *fxquad = DRW_cache_fullscreen_quad_get(); /* prepare pass */ - fx_shgrp = DRW_shgroup_create(e_data->gpencil_fx_rim_prepare_sh, - psl->fx_shader_pass_blend); + fx_shgrp = DRW_shgroup_create( + e_data->gpencil_fx_rim_prepare_sh, + psl->fx_shader_pass_blend); DRW_shgroup_call_add(fx_shgrp, fxquad, NULL); DRW_shgroup_uniform_texture_ref(fx_shgrp, "strokeColor", &e_data->temp_color_tx_a); DRW_shgroup_uniform_texture_ref(fx_shgrp, "strokeDepth", &e_data->temp_depth_tx_a); @@ -408,8 +410,9 @@ static void DRW_gpencil_fx_rim( fxd->runtime.fx_sh = fx_shgrp; /* blur pass */ - fx_shgrp = DRW_shgroup_create(e_data->gpencil_fx_blur_sh, - psl->fx_shader_pass_blend); + fx_shgrp = DRW_shgroup_create( + e_data->gpencil_fx_blur_sh, + psl->fx_shader_pass_blend); DRW_shgroup_call_add(fx_shgrp, fxquad, NULL); DRW_shgroup_uniform_texture_ref(fx_shgrp, "strokeColor", &e_data->temp_color_tx_rim); DRW_shgroup_uniform_texture_ref(fx_shgrp, "strokeDepth", &e_data->temp_depth_tx_rim); @@ -423,8 +426,9 @@ static void DRW_gpencil_fx_rim( fxd->runtime.fx_sh_b = fx_shgrp; /* resolve pass */ - fx_shgrp = DRW_shgroup_create(e_data->gpencil_fx_rim_resolve_sh, - psl->fx_shader_pass_blend); + fx_shgrp = DRW_shgroup_create( + e_data->gpencil_fx_rim_resolve_sh, + psl->fx_shader_pass_blend); DRW_shgroup_call_add(fx_shgrp, fxquad, NULL); DRW_shgroup_uniform_texture_ref(fx_shgrp, "strokeColor", &e_data->temp_color_tx_a); DRW_shgroup_uniform_texture_ref(fx_shgrp, "strokeDepth", &e_data->temp_depth_tx_a); diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index 2431bd50e1b..79b7c7988fd 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -84,8 +84,6 @@ #include "BIF_gl.h" -#include "DEG_depsgraph.h" - #include "WM_api.h" #include "WM_types.h" diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index 1981814eb02..54590c5f66c 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -2615,7 +2615,7 @@ static size_t animdata_filter_dopesheet_ob(bAnimContext *ac, ListBase *anim_data /* grease pencil */ if ((ob->type == OB_GPENCIL) && - (ob->data) && !(ads->filterflag & ADS_FILTER_NOGPENCIL)) + (ob->data) && !(ads->filterflag & ADS_FILTER_NOGPENCIL)) { tmp_items += animdata_filter_ds_gpencil(ac, &tmp_data, ads, ob->data, filter_mode); } diff --git a/source/blender/editors/gpencil/annotate_draw.c b/source/blender/editors/gpencil/annotate_draw.c index dad5af7379c..4f6e2004197 100644 --- a/source/blender/editors/gpencil/annotate_draw.c +++ b/source/blender/editors/gpencil/annotate_draw.c @@ -787,9 +787,10 @@ static void gp_draw_data_layers( * It should also be noted that sbuffer contains temporary point types * i.e. tGPspoints NOT bGPDspoints */ - gp_draw_stroke_buffer(gpd->runtime.sbuffer, - gpd->runtime.sbuffer_size, lthick, - dflag, gpd->runtime.sbuffer_sflag, ink); + gp_draw_stroke_buffer( + gpd->runtime.sbuffer, + gpd->runtime.sbuffer_size, lthick, + dflag, gpd->runtime.sbuffer_sflag, ink); } } } diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c index 5c56877cbe6..2c0b3e9900a 100644 --- a/source/blender/editors/gpencil/drawgpencil.c +++ b/source/blender/editors/gpencil/drawgpencil.c @@ -1047,7 +1047,7 @@ static void gp_draw_strokes(tGPDdraw *tgpw) (gp_style->fill_rgba[3] > 0.0f) && ((gps->flag & GP_STROKE_NOFILL) == 0)) { - continue; + continue; } /* calculate thickness */ diff --git a/source/blender/editors/gpencil/gpencil_brush.c b/source/blender/editors/gpencil/gpencil_brush.c index 52642fb2570..0fadef55b9d 100644 --- a/source/blender/editors/gpencil/gpencil_brush.c +++ b/source/blender/editors/gpencil/gpencil_brush.c @@ -755,10 +755,11 @@ static bool gp_brush_randomize_apply( const float inf = gp_brush_influence_calc(gso, radius, co) / 2.0f; const float fac = BLI_rng_get_float(gso->rng) * inf; /* need one flag enabled by default */ - if ((gso->settings->flag & (GP_BRUSHEDIT_FLAG_APPLY_POSITION | - GP_BRUSHEDIT_FLAG_APPLY_STRENGTH | - GP_BRUSHEDIT_FLAG_APPLY_THICKNESS | - GP_BRUSHEDIT_FLAG_APPLY_UV)) == 0) + if ((gso->settings->flag & + (GP_BRUSHEDIT_FLAG_APPLY_POSITION | + GP_BRUSHEDIT_FLAG_APPLY_STRENGTH | + GP_BRUSHEDIT_FLAG_APPLY_THICKNESS | + GP_BRUSHEDIT_FLAG_APPLY_UV)) == 0) { gso->settings->flag |= GP_BRUSHEDIT_FLAG_APPLY_POSITION; } diff --git a/source/blender/editors/gpencil/gpencil_data.c b/source/blender/editors/gpencil/gpencil_data.c index dd1852ca8ce..c58c45b3117 100644 --- a/source/blender/editors/gpencil/gpencil_data.c +++ b/source/blender/editors/gpencil/gpencil_data.c @@ -67,7 +67,6 @@ #include "BKE_gpencil.h" #include "BKE_gpencil_modifier.h" #include "BKE_library.h" -#include "BKE_main.h" #include "BKE_modifier.h" #include "BKE_object.h" #include "BKE_material.h" @@ -462,8 +461,7 @@ void GPENCIL_OT_frame_duplicate(wmOperatorType *ot) { GP_FRAME_DUP_ACTIVE, "ACTIVE", 0, "Active", "Duplicate frame in active layer only" }, { GP_FRAME_DUP_ALL, "ALL", 0, "All", "Duplicate active frames in all layers" }, { 0, NULL, 0, NULL, NULL } - }; - + }; /* identifiers */ ot->name = "Duplicate Frame"; @@ -1401,8 +1399,8 @@ static bool gpencil_vertex_group_poll(bContext *C) if ((ob) && (ob->type == OB_GPENCIL)) { if (!ID_IS_LINKED(ob) && !ID_IS_LINKED(ob->data) && ob->defbase.first) { if (ELEM(ob->mode, - OB_MODE_GPENCIL_EDIT, - OB_MODE_GPENCIL_SCULPT)) + OB_MODE_GPENCIL_EDIT, + OB_MODE_GPENCIL_SCULPT)) { return true; } @@ -1418,8 +1416,7 @@ static bool gpencil_vertex_group_weight_poll(bContext *C) if ((ob) && (ob->type == OB_GPENCIL)) { if (!ID_IS_LINKED(ob) && !ID_IS_LINKED(ob->data) && ob->defbase.first) { - if (ob->mode == OB_MODE_GPENCIL_WEIGHT) - { + if (ob->mode == OB_MODE_GPENCIL_WEIGHT) { return true; } } @@ -1807,8 +1804,8 @@ int ED_gpencil_join_objects_exec(bContext *C, wmOperator *op) { if (base->object->type == OB_GPENCIL) { if ((base->object->rot[0] != 0) || - (base->object->rot[1] != 0) || - (base->object->rot[2] != 0)) + (base->object->rot[1] != 0) || + (base->object->rot[2] != 0)) { BKE_report(op->reports, RPT_ERROR, "Apply all rotations before join objects"); return OPERATOR_CANCELLED; diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index 93cf2f18233..fdeadcc648a 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -62,7 +62,6 @@ #include "BKE_gpencil.h" #include "BKE_paint.h" #include "BKE_library.h" -#include "BKE_main.h" #include "BKE_material.h" #include "BKE_object.h" #include "BKE_report.h" @@ -861,8 +860,7 @@ static int gp_strokes_copy_exec(bContext *C, wmOperator *op) for (bGPDstroke *gps = gp_strokes_copypastebuf.first; gps; gps = gps->next) { if (ED_gpencil_stroke_can_use(C, gps)) { ma = give_current_material(ob, gps->mat_nr + 1); - if (BLI_ghash_haskey(gp_strokes_copypastebuf_colors, &gps->mat_nr) == false) - { + if (BLI_ghash_haskey(gp_strokes_copypastebuf_colors, &gps->mat_nr) == false) { BLI_ghash_insert(gp_strokes_copypastebuf_colors, &gps->mat_nr, ma); } } @@ -2153,7 +2151,7 @@ static int gp_snap_to_cursor(bContext *C, wmOperator *op) } DEG_id_tag_update(&gpd->id, OB_RECALC_OB | OB_RECALC_DATA); - DEG_id_tag_update(&obact->id, DEG_TAG_COPY_ON_WRITE); + DEG_id_tag_update(&obact->id, DEG_TAG_COPY_ON_WRITE); WM_event_add_notifier(C, NC_GPENCIL | ND_DATA | NA_EDITED, NULL); return OPERATOR_FINISHED; } @@ -2757,7 +2755,7 @@ static int gp_strokes_reproject_exec(bContext *C, wmOperator *op) Object *ob = CTX_data_active_object(C); ScrArea *sa = CTX_wm_area(C); ARegion *ar = CTX_wm_region(C); - RegionView3D *rv3d = ar->regiondata; + RegionView3D *rv3d = ar->regiondata; View3D *v3d = sa->spacedata.first; GP_SpaceConversion gsc = {NULL}; diff --git a/source/blender/editors/gpencil/gpencil_fill.c b/source/blender/editors/gpencil/gpencil_fill.c index a0626dd69b1..20db5c1504f 100644 --- a/source/blender/editors/gpencil/gpencil_fill.c +++ b/source/blender/editors/gpencil/gpencil_fill.c @@ -125,8 +125,9 @@ typedef struct tGPDfill { /* draw a given stroke using same thickness and color for all points */ -static void gp_draw_basic_stroke(tGPDfill *tgpf, bGPDstroke *gps, const float diff_mat[4][4], - bool cyclic, float ink[4], int flag, float thershold) +static void gp_draw_basic_stroke( + tGPDfill *tgpf, bGPDstroke *gps, const float diff_mat[4][4], + bool cyclic, float ink[4], int flag, float thershold) { bGPDspoint *points = gps->points; @@ -228,8 +229,7 @@ static void gp_draw_datablock(tGPDfill *tgpf, float ink[4]) } /* check if the color is visible */ MaterialGPencilStyle *gp_style = BKE_material_gpencil_settings_get(ob, gps->mat_nr + 1); - if ((gp_style == NULL) || (gp_style->flag & GP_STYLE_COLOR_HIDE)) - { + if ((gp_style == NULL) || (gp_style->flag & GP_STYLE_COLOR_HIDE)) { continue; } @@ -247,7 +247,7 @@ static void gp_draw_datablock(tGPDfill *tgpf, float ink[4]) /* normal strokes */ if ((tgpf->fill_draw_mode == GP_FILL_DMODE_STROKE) || - (tgpf->fill_draw_mode == GP_FILL_DMODE_BOTH)) + (tgpf->fill_draw_mode == GP_FILL_DMODE_BOTH)) { ED_gp_draw_fill(&tgpw); @@ -255,7 +255,7 @@ static void gp_draw_datablock(tGPDfill *tgpf, float ink[4]) /* 3D Lines with basic shapes and invisible lines */ if ((tgpf->fill_draw_mode == GP_FILL_DMODE_CONTROL) || - (tgpf->fill_draw_mode == GP_FILL_DMODE_BOTH)) + (tgpf->fill_draw_mode == GP_FILL_DMODE_BOTH)) { gp_draw_basic_stroke(tgpf, gps, tgpw.diff_mat, gps->flag & GP_STROKE_CYCLIC, ink, tgpf->flag, tgpf->fill_threshold); @@ -313,8 +313,9 @@ static void gp_render_offscreen(tGPDfill *tgpf) glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - ED_view3d_update_viewmat(tgpf->depsgraph, tgpf->scene, tgpf->v3d, tgpf->ar, - NULL, winmat, NULL); + ED_view3d_update_viewmat( + tgpf->depsgraph, tgpf->scene, tgpf->v3d, tgpf->ar, + NULL, winmat, NULL); /* set for opengl */ GPU_matrix_projection_set(tgpf->rv3d->winmat); GPU_matrix_set(tgpf->rv3d->viewmat); @@ -531,8 +532,7 @@ static void gpencil_boundaryfill_area(tGPDfill *tgpf) if (true) { /* Was: 'rgba' */ /* check if no border(red) or already filled color(green) */ - if ((rgba[0] != 1.0f) && (rgba[1] != 1.0f)) - { + if ((rgba[0] != 1.0f) && (rgba[1] != 1.0f)) { /* fill current pixel */ set_pixel(ibuf, v, fill_col); @@ -627,7 +627,7 @@ static void gpencil_get_outline_points(tGPDfill *tgpf) int backtracked_co[2]; int current_check_co[2]; int prev_check_co[2]; - int backtracked_offset[1][2] = { { 0,0 } }; + int backtracked_offset[1][2] = {{0, 0}}; // bool boundary_found = false; bool start_found = false; const int NEIGHBOR_COUNT = 8; @@ -667,12 +667,11 @@ static void gpencil_get_outline_points(tGPDfill *tgpf) } } - while (true && start_found) - { + while (start_found) { int cur_back_offset = -1; for (int i = 0; i < NEIGHBOR_COUNT; i++) { if (backtracked_offset[0][0] == offset[i][0] && - backtracked_offset[0][1] == offset[i][1]) + backtracked_offset[0][1] == offset[i][1]) { /* Finding the bracktracked pixel offset index */ cur_back_offset = i; @@ -706,7 +705,7 @@ static void gpencil_get_outline_points(tGPDfill *tgpf) } /* current pixel is equal to starting pixel */ if (boundary_co[0] == start_co[0] && - boundary_co[1] == start_co[1]) + boundary_co[1] == start_co[1]) { BLI_stack_pop(tgpf->stack, &v); // boundary_found = true; @@ -753,8 +752,10 @@ static void gpencil_get_depth_array(tGPDfill *tgpf) for (i = 0, ptc = tgpf->sbuffer; i < totpoints; i++, ptc++) { copy_v2_v2_int(mval, &ptc->x); - if ((ED_view3d_autodist_depth(tgpf->ar, mval, depth_margin, tgpf->depth_arr + i) == 0) && - (i && (ED_view3d_autodist_depth_seg(tgpf->ar, mval, mval_prev, depth_margin + 1, tgpf->depth_arr + i) == 0))) + if ((ED_view3d_autodist_depth( + tgpf->ar, mval, depth_margin, tgpf->depth_arr + i) == 0) && + (i && (ED_view3d_autodist_depth_seg( + tgpf->ar, mval, mval_prev, depth_margin + 1, tgpf->depth_arr + i) == 0))) { interp_depth = true; } @@ -849,7 +850,7 @@ static void gpencil_stroke_from_buffer(tGPDfill *tgpf) gps->flag |= GP_STROKE_RECALC_CACHES; /* add stroke to frame */ - if ((ts->gpencil_flags & GP_TOOL_FLAG_PAINT_ONBACK) || (tgpf->on_back == true)){ + if ((ts->gpencil_flags & GP_TOOL_FLAG_PAINT_ONBACK) || (tgpf->on_back == true)) { BLI_addhead(&tgpf->gpf->strokes, gps); } else { @@ -862,10 +863,11 @@ static void gpencil_stroke_from_buffer(tGPDfill *tgpf) point2D = (tGPspoint *)tgpf->sbuffer; for (int i = 0; i < tgpf->sbuffer_size && point2D; i++, point2D++, pt++, dvert++) { /* convert screen-coordinates to 3D coordinates */ - gp_stroke_convertcoords_tpoint(tgpf->scene, tgpf->ar, tgpf->v3d, tgpf->ob, - tgpf->gpl, point2D, - tgpf->depth_arr ? tgpf->depth_arr + i : NULL, - &pt->x); + gp_stroke_convertcoords_tpoint( + tgpf->scene, tgpf->ar, tgpf->v3d, tgpf->ob, + tgpf->gpl, point2D, + tgpf->depth_arr ? tgpf->depth_arr + i : NULL, + &pt->x); pt->pressure = 1.0f; pt->strength = 1.0f;; diff --git a/source/blender/editors/gpencil/gpencil_intern.h b/source/blender/editors/gpencil/gpencil_intern.h index 0218530be4e..a51f9e7a065 100644 --- a/source/blender/editors/gpencil/gpencil_intern.h +++ b/source/blender/editors/gpencil/gpencil_intern.h @@ -216,10 +216,11 @@ void gp_apply_parent_point(struct Depsgraph *depsgraph, struct Object *obact, bG bool gp_point_xy_to_3d(GP_SpaceConversion *gsc, struct Scene *scene, const float screen_co[2], float r_out[3]); /* helper to convert 2d to 3d */ -void gp_stroke_convertcoords_tpoint(struct Scene *scene, struct ARegion *ar, - struct View3D *v3d, struct Object *ob, - bGPDlayer *gpl, const struct tGPspoint *point2D, - float *depth, float out[3]); +void gp_stroke_convertcoords_tpoint( + struct Scene *scene, struct ARegion *ar, + struct View3D *v3d, struct Object *ob, + bGPDlayer *gpl, const struct tGPspoint *point2D, + float *depth, float out[3]); /* Poll Callbacks ------------------------------------ */ /* gpencil_utils.c */ @@ -239,8 +240,9 @@ struct GHash *gp_copybuf_validate_colormap(struct bContext *C); /* Stroke Editing ------------------------------------ */ -void gp_stroke_delete_tagged_points(bGPDframe *gpf, bGPDstroke *gps, bGPDstroke *next_stroke, - int tag_flags, bool select); +void gp_stroke_delete_tagged_points( + bGPDframe *gpf, bGPDstroke *gps, bGPDstroke *next_stroke, + int tag_flags, bool select); int gp_delete_selected_point_wrap(bContext *C); bool gp_smooth_stroke(bGPDstroke *gps, int i, float inf, bool affect_pressure); diff --git a/source/blender/editors/gpencil/gpencil_ops.c b/source/blender/editors/gpencil/gpencil_ops.c index 991bfb622b7..e5ebfcecdf8 100644 --- a/source/blender/editors/gpencil/gpencil_ops.c +++ b/source/blender/editors/gpencil/gpencil_ops.c @@ -128,8 +128,8 @@ static bool gp_stroke_paintmode_draw_poll(bContext *C) bGPdata *gpd = CTX_data_gpencil_data(C); ToolSettings *ts = CTX_data_tool_settings(C); Brush *brush = BKE_brush_getactive_gpencil(ts); - return (gpd && (gpd->flag & GP_DATA_STROKE_PAINTMODE) && (brush) - && (brush->gpencil_settings->brush_type == GP_BRUSH_TYPE_DRAW)); + return (gpd && (gpd->flag & GP_DATA_STROKE_PAINTMODE) && (brush) && + (brush->gpencil_settings->brush_type == GP_BRUSH_TYPE_DRAW)); } /* Poll callback for stroke painting (erase brush) */ @@ -139,8 +139,8 @@ static bool gp_stroke_paintmode_erase_poll(bContext *C) bGPdata *gpd = CTX_data_gpencil_data(C); ToolSettings *ts = CTX_data_tool_settings(C); Brush *brush = BKE_brush_getactive_gpencil(ts); - return (gpd && (gpd->flag & GP_DATA_STROKE_PAINTMODE) && (brush) - && (brush->gpencil_settings->brush_type == GP_BRUSH_TYPE_ERASE)); + return (gpd && (gpd->flag & GP_DATA_STROKE_PAINTMODE) && (brush) && + (brush->gpencil_settings->brush_type == GP_BRUSH_TYPE_ERASE)); } /* Poll callback for stroke painting (fill) */ @@ -150,8 +150,8 @@ static bool gp_stroke_paintmode_fill_poll(bContext *C) bGPdata *gpd = CTX_data_gpencil_data(C); ToolSettings *ts = CTX_data_tool_settings(C); Brush *brush = BKE_brush_getactive_gpencil(ts); - return (gpd && (gpd->flag & GP_DATA_STROKE_PAINTMODE) && (brush) - && (brush->gpencil_settings->brush_type == GP_BRUSH_TYPE_FILL)); + return (gpd && (gpd->flag & GP_DATA_STROKE_PAINTMODE) && (brush) && + (brush->gpencil_settings->brush_type == GP_BRUSH_TYPE_FILL)); } /* Poll callback for stroke sculpting mode */ diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index fd5b2803650..0c411db57b4 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -61,8 +61,6 @@ #include "BKE_context.h" #include "BKE_global.h" #include "BKE_gpencil.h" -#include "BKE_main.h" -#include "BKE_paint.h" #include "BKE_report.h" #include "BKE_layer.h" #include "BKE_material.h" @@ -624,7 +622,7 @@ static short gp_stroke_addpoint( } /* apply randomness to pressure */ if ((brush->gpencil_settings->flag & GP_BRUSH_GROUP_RANDOM) && - (brush->gpencil_settings->draw_random_press > 0.0f)) + (brush->gpencil_settings->draw_random_press > 0.0f)) { float curvef = curvemapping_evaluateF(brush->gpencil_settings->curve_sensitivity, 0, pressure); float tmp_pressure = curvef * brush->gpencil_settings->draw_sensitivity; @@ -672,7 +670,7 @@ static short gp_stroke_addpoint( /* apply randomness to color strength */ if ((brush->gpencil_settings->flag & GP_BRUSH_GROUP_RANDOM) && - (brush->gpencil_settings->draw_random_strength > 0.0f)) + (brush->gpencil_settings->draw_random_strength > 0.0f)) { if (BLI_rng_get_float(p->rng) > 0.5f) { pt->strength -= pt->strength * brush->gpencil_settings->draw_random_strength * BLI_rng_get_float(p->rng); @@ -1381,13 +1379,13 @@ static void gp_stroke_eraser_dostroke(tGPsdata *p, /* 2) Tag any point with overly low influence for removal in the next pass */ if ((pt1->pressure < cull_thresh) || (p->flags & GP_PAINTFLAG_HARD_ERASER) || - (eraser->gpencil_settings->eraser_mode == GP_BRUSH_ERASER_HARD)) + (eraser->gpencil_settings->eraser_mode == GP_BRUSH_ERASER_HARD)) { pt1->flag |= GP_SPOINT_TAG; do_cull = true; } if ((pt2->pressure < cull_thresh) || (p->flags & GP_PAINTFLAG_HARD_ERASER) || - (eraser->gpencil_settings->eraser_mode == GP_BRUSH_ERASER_HARD)) + (eraser->gpencil_settings->eraser_mode == GP_BRUSH_ERASER_HARD)) { pt2->flag |= GP_SPOINT_TAG; do_cull = true; @@ -1500,14 +1498,14 @@ static Brush *gp_get_default_eraser(Main *bmain, ToolSettings *ts) Brush *brush_old = paint->brush; for (Brush *brush = bmain->brush.first; brush; brush = brush->id.next) { if ((brush->ob_mode == OB_MODE_GPENCIL_PAINT) && - (brush->gpencil_settings->brush_type == GP_BRUSH_TYPE_ERASE)) + (brush->gpencil_settings->brush_type == GP_BRUSH_TYPE_ERASE)) { /* save first eraser to use later if no default */ if (brush_dft == NULL) { brush_dft = brush; } /* found default */ - if(brush->gpencil_settings->flag & GP_BRUSH_DEFAULT_ERASER) { + if (brush->gpencil_settings->flag & GP_BRUSH_DEFAULT_ERASER) { return brush; } } @@ -2201,7 +2199,7 @@ static void gpencil_draw_cursor_set(tGPsdata *p) { Brush *brush = p->brush; if ((p->paintmode == GP_PAINTMODE_ERASER) || - (brush->gpencil_settings->brush_type == GP_BRUSH_TYPE_ERASE)) + (brush->gpencil_settings->brush_type == GP_BRUSH_TYPE_ERASE)) { WM_cursor_modal_set(p->win, BC_CROSSCURSOR); /* XXX need a better cursor */ } @@ -2218,17 +2216,20 @@ static void gpencil_draw_status_indicators(bContext *C, tGPsdata *p) #if 0 /* FIXME, this never runs! */ switch (p->paintmode) { - case GP_PAINTMODE_DRAW_POLY: - /* Provide usage tips, since this is modal, and unintuitive without hints */ - ED_workspace_status_text(C, IFACE_("Annotation Create Poly: LMB click to place next stroke vertex | " - "ESC/Enter to end (or click outside this area)")); - break; - default: - /* Do nothing - the others are self explanatory, exit quickly once the mouse is released - * Showing any text would just be annoying as it would flicker. - */ - break; - } + case GP_PAINTMODE_DRAW_POLY: + /* Provide usage tips, since this is modal, and unintuitive without hints */ + ED_workspace_status_text( + C, IFACE_( + "Annotation Create Poly: LMB click to place next stroke vertex | " + "ESC/Enter to end (or click outside this area)" + )); + break; + default: + /* Do nothing - the others are self explanatory, exit quickly once the mouse is released + * Showing any text would just be annoying as it would flicker. + */ + break; + } #endif case GP_STATUS_IDLING: diff --git a/source/blender/editors/gpencil/gpencil_primitive.c b/source/blender/editors/gpencil/gpencil_primitive.c index ef09c5c3f76..9dbec666cc4 100644 --- a/source/blender/editors/gpencil/gpencil_primitive.c +++ b/source/blender/editors/gpencil/gpencil_primitive.c @@ -230,23 +230,27 @@ static void gpencil_primitive_status_indicators(bContext *C, tGPDprimitive *tgpi } else { if (tgpi->flag == IN_PROGRESS) { - BLI_snprintf(status_str, sizeof(status_str), "%s: %d (%d, %d) (%d, %d)", msg_str, (int)tgpi->tot_edges, - tgpi->top[0], tgpi->top[1], tgpi->bottom[0], tgpi->bottom[1]); + BLI_snprintf( + status_str, sizeof(status_str), "%s: %d (%d, %d) (%d, %d)", msg_str, (int)tgpi->tot_edges, + tgpi->top[0], tgpi->top[1], tgpi->bottom[0], tgpi->bottom[1]); } else { - BLI_snprintf(status_str, sizeof(status_str), "%s: %d (%d, %d)", msg_str, (int)tgpi->tot_edges, - tgpi->bottom[0], tgpi->bottom[1]); + BLI_snprintf( + status_str, sizeof(status_str), "%s: %d (%d, %d)", msg_str, (int)tgpi->tot_edges, + tgpi->bottom[0], tgpi->bottom[1]); } } } else { if (tgpi->flag == IN_PROGRESS) { - BLI_snprintf(status_str, sizeof(status_str), "%s: (%d, %d) (%d, %d)", msg_str, - tgpi->top[0], tgpi->top[1], tgpi->bottom[0], tgpi->bottom[1]); + BLI_snprintf( + status_str, sizeof(status_str), "%s: (%d, %d) (%d, %d)", msg_str, + tgpi->top[0], tgpi->top[1], tgpi->bottom[0], tgpi->bottom[1]); } else { - BLI_snprintf(status_str, sizeof(status_str), "%s: (%d, %d)", msg_str, - tgpi->bottom[0], tgpi->bottom[1]); + BLI_snprintf( + status_str, sizeof(status_str), "%s: (%d, %d)", msg_str, + tgpi->bottom[0], tgpi->bottom[1]); } } ED_workspace_status_text(C, status_str); @@ -467,7 +471,7 @@ static void gpencil_primitive_init(bContext *C, wmOperator *op) if (tgpi->type == GP_STROKE_CIRCLE) { RNA_int_set(op->ptr, "edges", 32); } - else if(tgpi->type == GP_STROKE_BOX) { + else if (tgpi->type == GP_STROKE_BOX) { RNA_int_set(op->ptr, "edges", 4); } else { /* LINE */ diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c index 7262c537321..cd352579b4a 100644 --- a/source/blender/editors/gpencil/gpencil_utils.c +++ b/source/blender/editors/gpencil/gpencil_utils.c @@ -1426,9 +1426,9 @@ static void gp_brush_drawcursor(bContext *C, int x, int y, void *customdata) * The decision was to use a fix size, instead of paintbrush->thickness value. */ if ((gp_style) && (GPENCIL_PAINT_MODE(gpd)) && - ((paintbrush->gpencil_settings->flag & GP_BRUSH_STABILIZE_MOUSE) == 0) && - ((paintbrush->gpencil_settings->flag & GP_BRUSH_STABILIZE_MOUSE_TEMP) == 0) && - (paintbrush->gpencil_settings->brush_type == GP_BRUSH_TYPE_DRAW)) + ((paintbrush->gpencil_settings->flag & GP_BRUSH_STABILIZE_MOUSE) == 0) && + ((paintbrush->gpencil_settings->flag & GP_BRUSH_STABILIZE_MOUSE_TEMP) == 0) && + (paintbrush->gpencil_settings->brush_type == GP_BRUSH_TYPE_DRAW)) { radius = 2.0f; copy_v3_v3(color, gp_style->stroke_rgba); @@ -1491,7 +1491,7 @@ static void gp_brush_drawcursor(bContext *C, int x, int y, void *customdata) /* Draw line for lazy mouse */ if ((last_mouse_position) && - (paintbrush->gpencil_settings->flag & GP_BRUSH_STABILIZE_MOUSE_TEMP)) + (paintbrush->gpencil_settings->flag & GP_BRUSH_STABILIZE_MOUSE_TEMP)) { glEnable(GL_LINE_SMOOTH); glEnable(GL_BLEND); @@ -1501,8 +1501,10 @@ static void gp_brush_drawcursor(bContext *C, int x, int y, void *customdata) immBegin(GPU_PRIM_LINES, 2); immVertex2f(pos, x, y); - immVertex2f(pos, last_mouse_position[0] + ar->winrct.xmin, - last_mouse_position[1] + ar->winrct.ymin); + immVertex2f( + pos, + last_mouse_position[0] + ar->winrct.xmin, + last_mouse_position[1] + ar->winrct.ymin); immEnd(); glDisable(GL_BLEND); diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index fc3dd3f9968..d174a78ee23 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -1023,7 +1023,7 @@ void uiTemplateHeader(uiLayout *layout, struct bContext *C); void uiTemplateID( uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, const char *propname, const char *newop, const char *openop, const char *unlinkop, - int filter, const bool live_icon); + int filter, const bool live_icon); void uiTemplateIDBrowse( uiLayout *layout, struct bContext *C, struct PointerRNA *ptr, const char *propname, const char *newop, const char *openop, const char *unlinkop, int filter); diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 07d259dd047..e81ad1428d1 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -174,7 +174,7 @@ static uiBlock *template_common_search_menu( uiButSearchFunc search_func, void *search_arg, uiButHandleFunc handle_func, void *active_item, const int preview_rows, const int preview_cols, - float scale) + float scale) { static char search[256]; wmWindow *win = CTX_wm_window(C); @@ -644,7 +644,7 @@ static uiBut *template_id_def_new_but( static void template_ID( bContext *C, uiLayout *layout, TemplateID *template_ui, StructRNA *type, int flag, const char *newop, const char *openop, const char *unlinkop, - const bool live_icon) + const bool live_icon) { uiBut *but; uiBlock *block; @@ -875,7 +875,7 @@ static void ui_template_id( PointerRNA *ptr, const char *propname, const char *newop, const char *openop, const char *unlinkop, int flag, int prv_rows, int prv_cols, int filter, bool use_tabs, - float scale, bool live_icon) + float scale, bool live_icon) { TemplateID *template_ui; PropertyRNA *prop; @@ -933,7 +933,7 @@ static void ui_template_id( void uiTemplateID( uiLayout *layout, bContext *C, PointerRNA *ptr, const char *propname, const char *newop, const char *openop, const char *unlinkop, - int filter, const bool live_icon) + int filter, const bool live_icon) { ui_template_id( layout, C, ptr, propname, @@ -1569,8 +1569,9 @@ uiLayout *uiTemplateModifier(uiLayout *layout, bContext *C, PointerRNA *ptr) /************************ Grease Pencil Modifier Template *************************/ -static uiLayout *gpencil_draw_modifier(uiLayout *layout, Object *ob, - GpencilModifierData *md) +static uiLayout *gpencil_draw_modifier( + uiLayout *layout, Object *ob, + GpencilModifierData *md) { const GpencilModifierTypeInfo *mti = BKE_gpencil_modifierType_getInfo(md->type); PointerRNA ptr; diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index d3181441168..1ae441ee2f4 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -1005,7 +1005,8 @@ static int object_gpencil_add_exec(bContext *C, wmOperator *op) * for them to end up aligned oddly, but only for Monkey */ if ((RNA_struct_property_is_set(op->ptr, "view_align") == false) && - (type == GP_MONKEY)) { + (type == GP_MONKEY)) + { RNA_boolean_set(op->ptr, "view_align", true); } diff --git a/source/blender/editors/object/object_modes.c b/source/blender/editors/object/object_modes.c index 261f7f42bc0..b9bfb44f680 100644 --- a/source/blender/editors/object/object_modes.c +++ b/source/blender/editors/object/object_modes.c @@ -118,7 +118,7 @@ bool ED_object_mode_compat_test(const Object *ob, eObjectMode mode) break; case OB_GPENCIL: if (mode & (OB_MODE_EDIT | OB_MODE_GPENCIL_EDIT | OB_MODE_GPENCIL_PAINT | - OB_MODE_GPENCIL_SCULPT | OB_MODE_GPENCIL_WEIGHT)) + OB_MODE_GPENCIL_SCULPT | OB_MODE_GPENCIL_WEIGHT)) { return true; } diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index f83c6af08ee..43f651b0532 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -204,9 +204,10 @@ static bool object_has_modifier(const Object *ob, const ModifierData *exclude, * If the callback ever returns true, iteration will stop and the * function value will be true. Otherwise the function returns false. */ -bool ED_object_iter_other(Main *bmain, Object *orig_ob, const bool include_orig, - bool (*callback)(Object *ob, void *callback_data), - void *callback_data) +bool ED_object_iter_other( + Main *bmain, Object *orig_ob, const bool include_orig, + bool (*callback)(Object *ob, void *callback_data), + void *callback_data) { ID *ob_data_id = orig_ob->data; int users = ob_data_id->us; @@ -220,10 +221,10 @@ bool ED_object_iter_other(Main *bmain, Object *orig_ob, const bool include_orig, int totfound = include_orig ? 0 : 1; for (ob = bmain->object.first; ob && totfound < users; - ob = ob->id.next) + ob = ob->id.next) { if (((ob != orig_ob) || include_orig) && - (ob->data == orig_ob->data)) + (ob->data == orig_ob->data)) { if (callback(ob, callback_data)) return true; @@ -318,7 +319,7 @@ static bool object_modifier_remove(Main *bmain, Object *ob, ModifierData *md, } if (ELEM(md->type, eModifierType_Softbody, eModifierType_Cloth) && - BLI_listbase_is_empty(&ob->particlesystem)) + BLI_listbase_is_empty(&ob->particlesystem)) { ob->mode &= ~OB_MODE_PARTICLE_EDIT; } @@ -681,8 +682,8 @@ int ED_object_modifier_apply( return 0; } else if ((ob->mode & OB_MODE_SCULPT) && - (find_multires_modifier_before(scene, md)) && - (modifier_isSameTopology(md) == false)) + (find_multires_modifier_before(scene, md)) && + (modifier_isSameTopology(md) == false)) { BKE_report(reports, RPT_ERROR, "Constructive modifier cannot be applied to multi-res data in sculpt mode"); return 0; @@ -1525,7 +1526,7 @@ static int skin_root_mark_exec(bContext *C, wmOperator *UNUSED(op)) BM_ITER_MESH (bm_vert, &bm_iter, bm, BM_VERTS_OF_MESH) { if (BM_elem_flag_test(bm_vert, BM_ELEM_SELECT) && - BLI_gset_add(visited, bm_vert)) + BLI_gset_add(visited, bm_vert)) { MVertSkin *vs = BM_ELEM_CD_GET_VOID_P(bm_vert, cd_vert_skin_offset); diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c index 62115aea11d..98ff2f67b58 100644 --- a/source/blender/editors/space_buttons/space_buttons.c +++ b/source/blender/editors/space_buttons/space_buttons.c @@ -527,7 +527,7 @@ static void buttons_area_listener( } break; case NC_GPENCIL: - switch(wmn->data) { + switch (wmn->data) { case ND_DATA: if (ELEM(wmn->action, NA_EDITED, NA_ADDED, NA_REMOVED)) ED_area_tag_redraw(sa); diff --git a/source/blender/editors/space_view3d/view3d_gizmo_ruler.c b/source/blender/editors/space_view3d/view3d_gizmo_ruler.c index d5ef7cdf441..fb335d5f922 100644 --- a/source/blender/editors/space_view3d/view3d_gizmo_ruler.c +++ b/source/blender/editors/space_view3d/view3d_gizmo_ruler.c @@ -37,7 +37,6 @@ #include "BKE_object.h" #include "BKE_unit.h" #include "BKE_material.h" -#include "BKE_main.h" #include "DNA_meshdata_types.h" #include "DNA_object_types.h" diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index afff5eb7f66..2f65ad1fde4 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -1683,22 +1683,23 @@ static bool ed_object_select_pick( The grease pencil modes are not real modes, but a hack to make the interface consistent, so need some tricks to keep UI synchronized */ // XXX: This stuff neeeds reviewing (Aligorith) -#if 0 - if (((oldbasact) && oldbasact->object->type == OB_GPENCIL) || (basact->object->type == OB_GPENCIL)) { + if (false && + (((oldbasact) && oldbasact->object->type == OB_GPENCIL) || + (basact->object->type == OB_GPENCIL))) + { /* set cursor */ - if (ELEM(basact->object->mode == OB_MODE_GPENCIL_PAINT, - OB_MODE_GPENCIL_SCULPT, - OB_MODE_GPENCIL_WEIGHT)) { + if (ELEM(basact->object->mode, + OB_MODE_GPENCIL_PAINT, + OB_MODE_GPENCIL_SCULPT, + OB_MODE_GPENCIL_WEIGHT)) + { ED_gpencil_toggle_brush_cursor(C, true, NULL); } else { /* TODO: maybe is better use restore */ ED_gpencil_toggle_brush_cursor(C, false, NULL); } - /* set workspace mode */ - BKE_workspace_object_mode_set(CTX_wm_workspace(C), scene, basact->object->mode); } -#endif } DEG_id_tag_update(&scene->id, DEG_TAG_SELECT_UPDATE); diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 9ad80f2ab12..b0de996ee0e 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -103,8 +103,6 @@ #include "transform.h" -#include "DEG_depsgraph.h" - /* Disabling, since when you type you know what you are doing, and being able to set it to zero is handy. */ // #define USE_NUM_NO_ZERO diff --git a/source/blender/editors/transform/transform_snap_object.c b/source/blender/editors/transform/transform_snap_object.c index bc35e6e6b89..6dfcfe11af2 100644 --- a/source/blender/editors/transform/transform_snap_object.c +++ b/source/blender/editors/transform/transform_snap_object.c @@ -2282,9 +2282,9 @@ static short snapObject( break; case OB_GPENCIL: retval = snapEmpty( - snapdata, ob, obmat, - dist_px, - r_loc, r_no, r_index); + snapdata, ob, obmat, + dist_px, + r_loc, r_no, r_index); break; case OB_CAMERA: retval = snapCamera( diff --git a/source/blender/gpencil_modifiers/MOD_gpencil_modifiertypes.h b/source/blender/gpencil_modifiers/MOD_gpencil_modifiertypes.h index ca941017ff9..73386601d10 100644 --- a/source/blender/gpencil_modifiers/MOD_gpencil_modifiertypes.h +++ b/source/blender/gpencil_modifiers/MOD_gpencil_modifiertypes.h @@ -15,17 +15,15 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * Contributor(s): Ben Batt - * * ***** END GPL LICENSE BLOCK ***** */ -/** \file MOD_modifiertypes.h +/** \file MOD_gpencil_modifiertypes.h * \ingroup modifiers */ -#ifndef __MOD_GP_MODIFIERTYPES_H__ -#define __MOD_GP_MODIFIERTYPES_H__ +#ifndef __MOD_GPENCIL_MODIFIERTYPES_H__ +#define __MOD_GPENCIL_MODIFIERTYPES_H__ #include "BKE_gpencil_modifier.h" @@ -50,4 +48,4 @@ extern GpencilModifierTypeInfo modifierType_Gpencil_Offset; /* MOD_gpencil_util.c */ void gpencil_modifier_type_init(GpencilModifierTypeInfo *types[]); -#endif /* __MOD_GP_MODIFIERTYPES_H__ */ +#endif /* __MOD_GPENCIL_MODIFIERTYPES_H__ */ diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencil_util.c b/source/blender/gpencil_modifiers/intern/MOD_gpencil_util.c index 97d28863095..664f4b6976c 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencil_util.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencil_util.c @@ -23,7 +23,7 @@ * ***** END GPL LICENSE BLOCK ***** */ -/** \file blender/modifiers/intern/MOD_gpencil_util.c +/** \file blender/gpencil_modifiers/intern/MOD_gpencil_util.c * \ingroup bke */ diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencil_util.h b/source/blender/gpencil_modifiers/intern/MOD_gpencil_util.h index 50ac557042d..39a4947573e 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencil_util.h +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencil_util.h @@ -25,7 +25,7 @@ * ***** END GPL LICENSE BLOCK ***** */ -/** \file blender/modifiers/intern/MOD_gpencil_util.h +/** \file blender/gpencil_modifiers/intern/MOD_gpencil_util.h * \ingroup modifiers */ diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilbuild.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilbuild.c index 6b959659a60..945afec002d 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencilbuild.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilbuild.c @@ -24,7 +24,7 @@ * */ -/** \file blender/modifiers/intern/MOD_gpencilbuild.c +/** \file blender/gpencil_modifiers/intern/MOD_gpencilbuild.c * \ingroup modifiers */ @@ -519,7 +519,7 @@ static void generateStrokes( */ #if 0 static void bakeModifier( - Main *bmain, const Depsgraph *UNUSED(depsgraph), + Main *bmain, const Depsgraph *UNUSED(depsgraph), GpencilModifierData *md, Object *ob) { bGPdata *gpd = ob->data; diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilcolor.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilcolor.c index af00b24715f..3cd298e9b87 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencilcolor.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilcolor.c @@ -24,7 +24,7 @@ * */ -/** \file blender/modifiers/intern/MOD_gpencilcolor.c +/** \file blender/gpencil_modifiers/intern/MOD_gpencilcolor.c * \ingroup modifiers */ @@ -98,7 +98,7 @@ static void deformStroke( } static void bakeModifier( - Main *bmain, Depsgraph *depsgraph, + Main *bmain, Depsgraph *depsgraph, GpencilModifierData *md, Object *ob) { ColorGpencilModifierData *mmd = (ColorGpencilModifierData *)md; diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c index e036b6b78be..40e5e718bdc 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c @@ -24,7 +24,7 @@ * */ -/** \file blender/modifiers/intern/MOD_gpencilhook.c +/** \file blender/gpencil_modifiers/intern/MOD_gpencilhook.c * \ingroup modifiers */ @@ -265,7 +265,7 @@ static void deformStroke( * (i.e. one where we don't have to worry about restoring state) */ static void bakeModifier( - Main *bmain, Depsgraph *depsgraph, + Main *bmain, Depsgraph *depsgraph, GpencilModifierData *md, Object *ob) { HookGpencilModifierData *mmd = (HookGpencilModifierData *)md; diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilinstance.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilinstance.c index 64f3fbc4a95..a35174d882f 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencilinstance.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilinstance.c @@ -24,7 +24,7 @@ * */ -/** \file blender/modifiers/intern/MOD_gpencilinstance.c +/** \file blender/gpencil_modifiers/intern/MOD_gpencilinstance.c * \ingroup modifiers */ @@ -320,7 +320,7 @@ static void generateStrokes( /* Generic "bakeModifier" callback */ static void bakeModifier( - Main *bmain, Depsgraph *depsgraph, + Main *bmain, Depsgraph *depsgraph, GpencilModifierData *md, Object *ob) { InstanceGpencilModifierData *mmd = (InstanceGpencilModifierData *)md; diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencillattice.c b/source/blender/gpencil_modifiers/intern/MOD_gpencillattice.c index 944e787020e..c4ff44af927 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencillattice.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencillattice.c @@ -24,7 +24,7 @@ * */ -/** \file blender/modifiers/intern/MOD_gpencillattice.c +/** \file blender/gpencil_modifiers/intern/MOD_gpencillattice.c * \ingroup modifiers */ @@ -111,7 +111,7 @@ static void deformStroke( * (i.e. one where we don't have to worry about restoring state) */ static void bakeModifier( - Main *bmain, Depsgraph *depsgraph, + Main *bmain, Depsgraph *depsgraph, GpencilModifierData *md, Object *ob) { LatticeGpencilModifierData *mmd = (LatticeGpencilModifierData *)md; diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilmirror.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilmirror.c index 9b5186755d6..afecdd34a5c 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencilmirror.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilmirror.c @@ -24,7 +24,7 @@ * */ -/** \file blender/modifiers/intern/MOD_gpencilmirror.c +/** \file blender/gpencil_modifiers/intern/MOD_gpencilmirror.c * \ingroup modifiers */ @@ -142,9 +142,9 @@ static void generateStrokes( tot_strokes = BLI_listbase_count(&gpf->strokes); for (i = 0, gps = gpf->strokes.first; i < tot_strokes; i++, gps = gps->next) { - if (is_stroke_affected_by_modifier(ob, - mmd->layername, mmd->pass_index, 1, gpl, gps, - mmd->flag & GP_MIRROR_INVERT_LAYER, mmd->flag & GP_MIRROR_INVERT_PASS)) + if (is_stroke_affected_by_modifier( + ob, mmd->layername, mmd->pass_index, 1, gpl, gps, + mmd->flag & GP_MIRROR_INVERT_LAYER, mmd->flag & GP_MIRROR_INVERT_PASS)) { /* check each axis for mirroring */ for (int xi = 0; xi < 3; ++xi) { @@ -162,7 +162,7 @@ static void generateStrokes( } static void bakeModifier( - Main *bmain, Depsgraph *depsgraph, + Main *bmain, Depsgraph *depsgraph, GpencilModifierData *md, Object *ob) { MirrorGpencilModifierData *mmd = (MirrorGpencilModifierData *)md; diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilnoise.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilnoise.c index 37c8bf0b0f0..1edcaf84b81 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencilnoise.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilnoise.c @@ -24,7 +24,7 @@ * */ -/** \file blender/modifiers/intern/MOD_gpencilnoise.c +/** \file blender/gpencil_modifiers/intern/MOD_gpencilnoise.c * \ingroup modifiers */ diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpenciloffset.c b/source/blender/gpencil_modifiers/intern/MOD_gpenciloffset.c index 8a96c705f08..50ff3f8766a 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpenciloffset.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpenciloffset.c @@ -24,7 +24,7 @@ * */ -/** \file blender/modifiers/intern/MOD_gpenciloffset.c +/** \file blender/gpencil_modifiers/intern/MOD_gpenciloffset.c * \ingroup modifiers */ @@ -105,7 +105,7 @@ static void deformStroke( } static void bakeModifier( - struct Main *UNUSED(bmain), Depsgraph *depsgraph, + struct Main *UNUSED(bmain), Depsgraph *depsgraph, GpencilModifierData *md, Object *ob) { bGPdata *gpd = ob->data; diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilopacity.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilopacity.c index bdd651a69fc..361668f8725 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencilopacity.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilopacity.c @@ -24,7 +24,7 @@ * */ -/** \file blender/modifiers/intern/MOD_gpencilopacity.c +/** \file blender/gpencil_modifiers/intern/MOD_gpencilopacity.c * \ingroup modifiers */ @@ -81,7 +81,7 @@ static void deformStroke( return; } - gp_style->fill_rgba[3]*= mmd->factor; + gp_style->fill_rgba[3] *= mmd->factor; /* if factor is > 1, then force opacity */ if (mmd->factor > 1.0f) { @@ -133,7 +133,7 @@ static void deformStroke( } static void bakeModifier( - struct Main *UNUSED(bmain), Depsgraph *depsgraph, + struct Main *UNUSED(bmain), Depsgraph *depsgraph, GpencilModifierData *md, Object *ob) { bGPdata *gpd = ob->data; diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilsimplify.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilsimplify.c index f0400e39b73..a8d10c973ce 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencilsimplify.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilsimplify.c @@ -23,7 +23,7 @@ * */ -/** \file blender/modifiers/intern/MOD_gpencilsimplify.c +/** \file blender/gpencil_modifiers/intern/MOD_gpencilsimplify.c * \ingroup modifiers */ @@ -85,7 +85,7 @@ static void deformStroke( } static void bakeModifier( - struct Main *UNUSED(bmain), Depsgraph *depsgraph, + struct Main *UNUSED(bmain), Depsgraph *depsgraph, GpencilModifierData *md, Object *ob) { bGPdata *gpd = ob->data; diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilsmooth.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilsmooth.c index b83c8ed98b1..182bd974959 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencilsmooth.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilsmooth.c @@ -24,7 +24,7 @@ * */ -/** \file blender/modifiers/intern/MOD_gpencilsmooth.c +/** \file blender/gpencil_modifiers/intern/MOD_gpencilsmooth.c * \ingroup modifiers */ @@ -114,7 +114,7 @@ static void deformStroke( } static void bakeModifier( - struct Main *UNUSED(bmain), Depsgraph *depsgraph, + struct Main *UNUSED(bmain), Depsgraph *depsgraph, GpencilModifierData *md, Object *ob) { bGPdata *gpd = ob->data; diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilsubdiv.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilsubdiv.c index 6fe9c34c06b..dba3e028904 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencilsubdiv.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilsubdiv.c @@ -24,7 +24,7 @@ * */ -/** \file blender/modifiers/intern/MOD_gpencilsubdiv.c +/** \file blender/gpencil_modifiers/intern/MOD_gpencilsubdiv.c * \ingroup modifiers */ @@ -155,7 +155,7 @@ static void deformStroke( } static void bakeModifier( - struct Main *UNUSED(bmain), Depsgraph *depsgraph, + struct Main *UNUSED(bmain), Depsgraph *depsgraph, GpencilModifierData *md, Object *ob) { bGPdata *gpd = ob->data; diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilthick.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilthick.c index 118cc33255f..fb63aa31364 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpencilthick.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilthick.c @@ -24,7 +24,7 @@ * */ -/** \file blender/modifiers/intern/MOD_gpencilthick.c +/** \file blender/gpencil_modifiers/intern/MOD_gpencilthick.c * \ingroup modifiers */ @@ -133,7 +133,7 @@ static void deformStroke( } static void bakeModifier( - struct Main *UNUSED(bmain), Depsgraph *depsgraph, + struct Main *UNUSED(bmain), Depsgraph *depsgraph, GpencilModifierData *md, Object *ob) { bGPdata *gpd = ob->data; diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpenciltint.c b/source/blender/gpencil_modifiers/intern/MOD_gpenciltint.c index 9d1e9eccb8c..859e12adfb5 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpenciltint.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpenciltint.c @@ -24,7 +24,7 @@ * */ -/** \file blender/modifiers/intern/MOD_gpenciltint.c +/** \file blender/gpencil_modifiers/intern/MOD_gpenciltint.c * \ingroup modifiers */ @@ -106,7 +106,7 @@ static void deformStroke( } static void bakeModifier( - Main *bmain, Depsgraph *depsgraph, + Main *bmain, Depsgraph *depsgraph, GpencilModifierData *md, Object *ob) { TintGpencilModifierData *mmd = (TintGpencilModifierData *)md; diff --git a/source/blender/makesdna/DNA_gpencil_modifier_types.h b/source/blender/makesdna/DNA_gpencil_modifier_types.h index 150b4a2d9f1..1e3a4bf09f0 100644 --- a/source/blender/makesdna/DNA_gpencil_modifier_types.h +++ b/source/blender/makesdna/DNA_gpencil_modifier_types.h @@ -18,12 +18,12 @@ * ***** END GPL LICENSE BLOCK ***** */ -/** \file DNA_greasepencil_modifier_types.h +/** \file DNA_gpencil_modifier_types.h * \ingroup DNA */ -#ifndef __DNA_GREASEPENCIL_TYPES_H__ -#define __DNA_GREASEPENCIL_TYPES_H__ +#ifndef __DNA_GPENCIL_MODIFIER_TYPES_H__ +#define __DNA_GPENCIL_MODIFIER_TYPES_H__ #include "DNA_defs.h" #include "DNA_listBase.h" @@ -401,4 +401,4 @@ typedef enum eSmoothGpencil_Flag { #define MOD_MESHSEQ_READ_ALL \ (MOD_MESHSEQ_READ_VERT | MOD_MESHSEQ_READ_POLY | MOD_MESHSEQ_READ_UV | MOD_MESHSEQ_READ_COLOR) -#endif /* __DNA_GREASEPENCIL_TYPES_H__ */ +#endif /* __DNA_GPENCIL_MODIFIER_TYPES_H__ */ diff --git a/source/blender/makesdna/DNA_shader_fx_types.h b/source/blender/makesdna/DNA_shader_fx_types.h index 15147cf2b6c..f3c9f06c8dc 100644 --- a/source/blender/makesdna/DNA_shader_fx_types.h +++ b/source/blender/makesdna/DNA_shader_fx_types.h @@ -22,8 +22,8 @@ * \ingroup DNA */ -#ifndef __DNA_SHADERFX_TYPES_H__ -#define __DNA_SHADERFX_TYPES_H__ +#ifndef __DNA_SHADER_FX_TYPES_H__ +#define __DNA_SHADER_FX_TYPES_H__ #include "DNA_defs.h" #include "DNA_listBase.h" @@ -130,7 +130,7 @@ typedef struct LightShaderFxData { int flag; /* flags */ float energy; float ambient; - float loc[4]; /* internal, not visible in rna */ + float loc[4]; /* internal, not visible in rna */ char pad[4]; ShaderFxData_runtime runtime; } LightShaderFxData; @@ -193,4 +193,4 @@ typedef struct WaveShaderFxData { char pad[4]; ShaderFxData_runtime runtime; } WaveShaderFxData; -#endif /* __DNA_SHADERFX_TYPES_H__ */ +#endif /* __DNA_SHADER_FX_TYPES_H__ */ diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c index f84f31b02f1..4b69a395ab6 100644 --- a/source/blender/makesrna/intern/rna_gpencil.c +++ b/source/blender/makesrna/intern/rna_gpencil.c @@ -32,6 +32,7 @@ #include "DNA_gpencil_types.h" #include "DNA_scene_types.h" #include "DNA_brush_types.h" +#include "DNA_object_types.h" #include "MEM_guardedalloc.h" @@ -47,9 +48,6 @@ #include "rna_internal.h" #include "WM_types.h" -#include "DNA_meshdata_types.h" -#include "DNA_object_types.h" -#include "ED_gpencil.h" /* parent type */ static const EnumPropertyItem parent_type_items[] = { @@ -77,7 +75,6 @@ static EnumPropertyItem rna_enum_gpencil_onion_modes_items[] = { #ifdef RNA_RUNTIME -#include "BLI_math.h" #include "BLI_ghash.h" #include "WM_api.h" diff --git a/source/blender/makesrna/intern/rna_gpencil_modifier.c b/source/blender/makesrna/intern/rna_gpencil_modifier.c index df64121b2b4..8c4edf8030c 100644 --- a/source/blender/makesrna/intern/rna_gpencil_modifier.c +++ b/source/blender/makesrna/intern/rna_gpencil_modifier.c @@ -50,7 +50,6 @@ #include "BKE_mesh_remap.h" #include "BKE_multires.h" #include "BKE_smoke.h" /* For smokeModifier_free & smokeModifier_createType */ -#include "BKE_gpencil_modifier.h" #include "RNA_access.h" #include "RNA_define.h" diff --git a/source/blender/makesrna/intern/rna_shader_fx.c b/source/blender/makesrna/intern/rna_shader_fx.c index 950aef9a8dd..a005699dc32 100644 --- a/source/blender/makesrna/intern/rna_shader_fx.c +++ b/source/blender/makesrna/intern/rna_shader_fx.c @@ -38,7 +38,6 @@ #include "BLT_translation.h" #include "BKE_animsys.h" -#include "BKE_shader_fx.h" #include "RNA_access.h" #include "RNA_define.h" -- cgit v1.2.3