Cleanup: style, duplicate includes

This commit is contained in:
2018-07-31 20:11:55 +10:00
parent b2193e020b
commit f06884b18a
60 changed files with 353 additions and 334 deletions

View File

@@ -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
*/

View File

@@ -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;

View File

@@ -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)) {

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -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));

View File

@@ -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,

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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);
}

View File

@@ -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)
});
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)
});
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);
}

View File

@@ -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);

View File

@@ -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) {

View File

@@ -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);

View File

@@ -84,8 +84,6 @@
#include "BIF_gl.h"
#include "DEG_depsgraph.h"
#include "WM_api.h"
#include "WM_types.h"

View File

@@ -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);
}

View File

@@ -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);
}
}
}

View File

@@ -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 */

View File

@@ -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;
}

View File

@@ -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;

View File

@@ -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};

View File

@@ -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;;

View File

@@ -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);

View File

@@ -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 */

View File

@@ -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:

View File

@@ -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 */

View File

@@ -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);

View File

@@ -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);

View File

@@ -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;

View File

@@ -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);
}

View File

@@ -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;
}

View File

@@ -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);

View File

@@ -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);

View File

@@ -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"

View File

@@ -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);

View File

@@ -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

View File

@@ -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(

View File

@@ -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__ */

View File

@@ -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
*/

View File

@@ -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
*/

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -24,7 +24,7 @@
*
*/
/** \file blender/modifiers/intern/MOD_gpencilnoise.c
/** \file blender/gpencil_modifiers/intern/MOD_gpencilnoise.c
* \ingroup modifiers
*/

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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__ */

View File

@@ -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__ */

View File

@@ -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"

View File

@@ -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"

View File

@@ -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"