Cleanup: use eval as a suffix

Follow conversion already used in most places.
This commit is contained in:
Campbell Barton 2019-08-24 08:50:58 +10:00
parent a68e8ac993
commit 67d9647ae4
6 changed files with 42 additions and 42 deletions

View File

@ -75,7 +75,7 @@ void BKE_gpencil_free_stroke(struct bGPDstroke *gps);
bool BKE_gpencil_free_strokes(struct bGPDframe *gpf); bool BKE_gpencil_free_strokes(struct bGPDframe *gpf);
void BKE_gpencil_free_frames(struct bGPDlayer *gpl); void BKE_gpencil_free_frames(struct bGPDlayer *gpl);
void BKE_gpencil_free_layers(struct ListBase *list); void BKE_gpencil_free_layers(struct ListBase *list);
bool BKE_gpencil_free_frame_runtime_data(struct bGPDframe *eval_gpf); bool BKE_gpencil_free_frame_runtime_data(struct bGPDframe *gpf_eval);
void BKE_gpencil_free(struct bGPdata *gpd, bool free_all); void BKE_gpencil_free(struct bGPdata *gpd, bool free_all);
void BKE_gpencil_batch_cache_dirty_tag(struct bGPdata *gpd); void BKE_gpencil_batch_cache_dirty_tag(struct bGPdata *gpd);

View File

@ -148,19 +148,19 @@ bool BKE_gpencil_free_strokes(bGPDframe *gpf)
} }
/* Free strokes and colors belonging to a gp-frame */ /* Free strokes and colors belonging to a gp-frame */
bool BKE_gpencil_free_frame_runtime_data(bGPDframe *eval_gpf) bool BKE_gpencil_free_frame_runtime_data(bGPDframe *gpu_eval)
{ {
bGPDstroke *gps_next; bGPDstroke *gps_next;
if (!eval_gpf) { if (!gpu_eval) {
return false; return false;
} }
/* free strokes */ /* free strokes */
for (bGPDstroke *gps = eval_gpf->strokes.first; gps; gps = gps_next) { for (bGPDstroke *gps = gpu_eval->strokes.first; gps; gps = gps_next) {
gps_next = gps->next; gps_next = gps->next;
BKE_gpencil_free_stroke(gps); BKE_gpencil_free_stroke(gps);
} }
BLI_listbase_clear(&eval_gpf->strokes); BLI_listbase_clear(&gpu_eval->strokes);
return true; return true;
} }

View File

@ -779,18 +779,18 @@ void BKE_gpencil_subdivide(bGPDstroke *gps, int level, int flag)
} }
/* Copy frame but do not assign new memory */ /* Copy frame but do not assign new memory */
static void gpencil_frame_copy_noalloc(Object *ob, bGPDframe *gpf, bGPDframe *eval_gpf) static void gpencil_frame_copy_noalloc(Object *ob, bGPDframe *gpf, bGPDframe *gpf_eval)
{ {
eval_gpf->prev = gpf->prev; gpf_eval->prev = gpf->prev;
eval_gpf->next = gpf->next; gpf_eval->next = gpf->next;
eval_gpf->framenum = gpf->framenum; gpf_eval->framenum = gpf->framenum;
eval_gpf->flag = gpf->flag; gpf_eval->flag = gpf->flag;
eval_gpf->key_type = gpf->key_type; gpf_eval->key_type = gpf->key_type;
eval_gpf->runtime = gpf->runtime; gpf_eval->runtime = gpf->runtime;
copy_m4_m4(eval_gpf->runtime.parent_obmat, gpf->runtime.parent_obmat); copy_m4_m4(gpf_eval->runtime.parent_obmat, gpf->runtime.parent_obmat);
/* copy strokes */ /* copy strokes */
BLI_listbase_clear(&eval_gpf->strokes); BLI_listbase_clear(&gpf_eval->strokes);
for (bGPDstroke *gps_src = gpf->strokes.first; gps_src; gps_src = gps_src->next) { for (bGPDstroke *gps_src = gpf->strokes.first; gps_src; gps_src = gps_src->next) {
/* make copy of source stroke */ /* make copy of source stroke */
bGPDstroke *gps_dst = BKE_gpencil_stroke_duplicate(gps_src); bGPDstroke *gps_dst = BKE_gpencil_stroke_duplicate(gps_src);
@ -808,7 +808,7 @@ static void gpencil_frame_copy_noalloc(Object *ob, bGPDframe *gpf, bGPDframe *ev
pt_dst->runtime.idx_orig = i; pt_dst->runtime.idx_orig = i;
} }
BLI_addtail(&eval_gpf->strokes, gps_dst); BLI_addtail(&gpf_eval->strokes, gps_dst);
} }
} }
@ -816,19 +816,19 @@ static void gpencil_frame_copy_noalloc(Object *ob, bGPDframe *gpf, bGPDframe *ev
static void gpencil_evaluated_frame_ensure(int idx, static void gpencil_evaluated_frame_ensure(int idx,
Object *ob, Object *ob,
bGPDframe *gpf, bGPDframe *gpf,
bGPDframe **eval_gpf) bGPDframe **gpf_eval)
{ {
/* Create evaluated frames array data or expand. */ /* Create evaluated frames array data or expand. */
bGPDframe *evaluated_frames = ob->runtime.gpencil_evaluated_frames; bGPDframe *evaluated_frames = ob->runtime.gpencil_evaluated_frames;
*eval_gpf = &evaluated_frames[idx]; *gpf_eval = &evaluated_frames[idx];
/* If already exist a evaluated frame create a new one. */ /* If already exist a evaluated frame create a new one. */
if (*eval_gpf != NULL) { if (*gpf_eval != NULL) {
/* first clear temp data */ /* first clear temp data */
BKE_gpencil_free_frame_runtime_data(*eval_gpf); BKE_gpencil_free_frame_runtime_data(*gpf_eval);
} }
/* Copy data (do not assign new memory). */ /* Copy data (do not assign new memory). */
gpencil_frame_copy_noalloc(ob, gpf, *eval_gpf); gpencil_frame_copy_noalloc(ob, gpf, *gpf_eval);
} }
/* Calculate gpencil modifiers */ /* Calculate gpencil modifiers */
@ -880,8 +880,8 @@ void BKE_gpencil_modifiers_calc(Depsgraph *depsgraph, Scene *scene, Object *ob)
} }
/* Create a duplicate data set of stroke to modify. */ /* Create a duplicate data set of stroke to modify. */
bGPDframe *eval_gpf = NULL; bGPDframe *gpf_eval = NULL;
gpencil_evaluated_frame_ensure(idx, ob, gpf, &eval_gpf); gpencil_evaluated_frame_ensure(idx, ob, gpf, &gpf_eval);
/* Skip all if some disable flag is enabled. */ /* Skip all if some disable flag is enabled. */
if ((ob->greasepencil_modifiers.first == NULL) || (is_multiedit) || (simplify_modif)) { if ((ob->greasepencil_modifiers.first == NULL) || (is_multiedit) || (simplify_modif)) {
@ -891,13 +891,13 @@ void BKE_gpencil_modifiers_calc(Depsgraph *depsgraph, Scene *scene, Object *ob)
/* Apply geometry modifiers (create new geometry). */ /* Apply geometry modifiers (create new geometry). */
if (BKE_gpencil_has_geometry_modifiers(ob)) { if (BKE_gpencil_has_geometry_modifiers(ob)) {
BKE_gpencil_geometry_modifiers(depsgraph, ob, gpl, eval_gpf, is_render); BKE_gpencil_geometry_modifiers(depsgraph, ob, gpl, gpf_eval, is_render);
} }
/* Loop all strokes and deform them. */ /* Loop all strokes and deform them. */
for (bGPDstroke *gps = eval_gpf->strokes.first; gps; gps = gps->next) { for (bGPDstroke *gps = gpf_eval->strokes.first; gps; gps = gps->next) {
/* Apply modifiers that only deform geometry */ /* Apply modifiers that only deform geometry */
BKE_gpencil_stroke_modifiers(depsgraph, ob, gpl, eval_gpf, gps, is_render); BKE_gpencil_stroke_modifiers(depsgraph, ob, gpl, gpf_eval, gps, is_render);
} }
idx++; idx++;

View File

@ -351,9 +351,9 @@ void DRW_gpencil_freecache(struct Object *ob)
/* clear all frames evaluated data */ /* clear all frames evaluated data */
for (int i = 0; i < ob->runtime.gpencil_tot_layers; i++) { for (int i = 0; i < ob->runtime.gpencil_tot_layers; i++) {
bGPDframe *eval_gpf = &ob->runtime.gpencil_evaluated_frames[i]; bGPDframe *gpf_eval = &ob->runtime.gpencil_evaluated_frames[i];
BKE_gpencil_free_frame_runtime_data(eval_gpf); BKE_gpencil_free_frame_runtime_data(gpf_eval);
eval_gpf = NULL; gpf_eval = NULL;
} }
ob->runtime.gpencil_tot_layers = 0; ob->runtime.gpencil_tot_layers = 0;

View File

@ -1866,7 +1866,7 @@ void gpencil_populate_datablock(GPENCIL_e_data *e_data,
View3D *v3d = draw_ctx->v3d; View3D *v3d = draw_ctx->v3d;
int cfra_eval = (int)DEG_get_ctime(draw_ctx->depsgraph); int cfra_eval = (int)DEG_get_ctime(draw_ctx->depsgraph);
bGPDframe *eval_gpf = NULL; bGPDframe *gpf_eval = NULL;
const bool overlay = v3d != NULL ? (bool)((v3d->flag2 & V3D_HIDE_OVERLAYS) == 0) : true; const bool overlay = v3d != NULL ? (bool)((v3d->flag2 & V3D_HIDE_OVERLAYS) == 0) : true;
const bool time_remap = BKE_gpencil_has_time_modifiers(ob); const bool time_remap = BKE_gpencil_has_time_modifiers(ob);
@ -1937,7 +1937,7 @@ void gpencil_populate_datablock(GPENCIL_e_data *e_data,
/* Get evaluated frames array data */ /* Get evaluated frames array data */
int eval_idx = BLI_findindex(&gpd->layers, gpl); int eval_idx = BLI_findindex(&gpd->layers, gpl);
eval_gpf = &ob->runtime.gpencil_evaluated_frames[eval_idx]; gpf_eval = &ob->runtime.gpencil_evaluated_frames[eval_idx];
/* draw onion skins */ /* draw onion skins */
if (!ID_IS_LINKED(&gpd->id)) { if (!ID_IS_LINKED(&gpd->id)) {
@ -1952,7 +1952,7 @@ void gpencil_populate_datablock(GPENCIL_e_data *e_data,
} }
/* draw normal strokes */ /* draw normal strokes */
gpencil_draw_strokes( gpencil_draw_strokes(
cache, e_data, vedata, ob, gpd, gpl, eval_gpf, opacity, gpl->tintcolor, false, cache_ob); cache, e_data, vedata, ob, gpd, gpl, gpf_eval, opacity, gpl->tintcolor, false, cache_ob);
} }
/* create batchs and shading groups */ /* create batchs and shading groups */

View File

@ -205,14 +205,14 @@ static void draw_uvs_shadow(SpaceImage *UNUSED(sima),
Object *obedit, Object *obedit,
Depsgraph *depsgraph) Depsgraph *depsgraph)
{ {
Object *eval_ob = DEG_get_evaluated_object(depsgraph, obedit); Object *ob_eval = DEG_get_evaluated_object(depsgraph, obedit);
Mesh *me = eval_ob->data; Mesh *me = ob_eval->data;
float col[4]; float col[4];
UI_GetThemeColor4fv(TH_UV_SHADOW, col); UI_GetThemeColor4fv(TH_UV_SHADOW, col);
DRW_mesh_batch_cache_validate(me); DRW_mesh_batch_cache_validate(me);
GPUBatch *edges = DRW_mesh_batch_cache_get_uv_edges(me); GPUBatch *edges = DRW_mesh_batch_cache_get_uv_edges(me);
DRW_mesh_batch_cache_create_requested(eval_ob, me, scene, false, false); DRW_mesh_batch_cache_create_requested(ob_eval, me, scene, false, false);
if (edges) { if (edges) {
GPU_batch_program_set_builtin(edges, GPU_SHADER_2D_UV_UNIFORM_COLOR); GPU_batch_program_set_builtin(edges, GPU_SHADER_2D_UV_UNIFORM_COLOR);
@ -223,8 +223,8 @@ static void draw_uvs_shadow(SpaceImage *UNUSED(sima),
static void draw_uvs_texpaint(Scene *scene, Object *ob, Depsgraph *depsgraph) static void draw_uvs_texpaint(Scene *scene, Object *ob, Depsgraph *depsgraph)
{ {
Object *eval_ob = DEG_get_evaluated_object(depsgraph, ob); Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob);
Mesh *me = eval_ob->data; Mesh *me = ob_eval->data;
ToolSettings *ts = scene->toolsettings; ToolSettings *ts = scene->toolsettings;
float col[4]; float col[4];
UI_GetThemeColor4fv(TH_UV_SHADOW, col); UI_GetThemeColor4fv(TH_UV_SHADOW, col);
@ -235,7 +235,7 @@ static void draw_uvs_texpaint(Scene *scene, Object *ob, Depsgraph *depsgraph)
DRW_mesh_batch_cache_validate(me); DRW_mesh_batch_cache_validate(me);
GPUBatch *geom = DRW_mesh_batch_cache_get_uv_edges(me); GPUBatch *geom = DRW_mesh_batch_cache_get_uv_edges(me);
DRW_mesh_batch_cache_create_requested(eval_ob, me, scene, false, false); DRW_mesh_batch_cache_create_requested(ob_eval, me, scene, false, false);
GPU_batch_program_set_builtin(geom, GPU_SHADER_2D_UV_UNIFORM_COLOR); GPU_batch_program_set_builtin(geom, GPU_SHADER_2D_UV_UNIFORM_COLOR);
GPU_batch_uniform_4fv(geom, "color", col); GPU_batch_uniform_4fv(geom, "color", col);
@ -246,7 +246,7 @@ static void draw_uvs_texpaint(Scene *scene, Object *ob, Depsgraph *depsgraph)
MPoly *mpoly = me->mpoly; MPoly *mpoly = me->mpoly;
uint draw_start = 0; uint draw_start = 0;
uint idx = 0; uint idx = 0;
bool prev_ma_match = (mpoly->mat_nr == (eval_ob->actcol - 1)); bool prev_ma_match = (mpoly->mat_nr == (ob_eval->actcol - 1));
GPU_matrix_bind(geom->interface); GPU_matrix_bind(geom->interface);
GPU_batch_bind(geom); GPU_batch_bind(geom);
@ -255,7 +255,7 @@ static void draw_uvs_texpaint(Scene *scene, Object *ob, Depsgraph *depsgraph)
* we can use multi draw indirect drawcalls for this. * we can use multi draw indirect drawcalls for this.
* (not implemented in GPU module at the time of writing). */ * (not implemented in GPU module at the time of writing). */
for (int a = 0; a < me->totpoly; a++, mpoly++) { for (int a = 0; a < me->totpoly; a++, mpoly++) {
bool ma_match = (mpoly->mat_nr == (eval_ob->actcol - 1)); bool ma_match = (mpoly->mat_nr == (ob_eval->actcol - 1));
if (ma_match != prev_ma_match) { if (ma_match != prev_ma_match) {
if (ma_match == false) { if (ma_match == false) {
GPU_batch_draw_advanced(geom, draw_start, idx - draw_start, 0, 0); GPU_batch_draw_advanced(geom, draw_start, idx - draw_start, 0, 0);
@ -282,13 +282,13 @@ static void draw_uvs_texpaint(Scene *scene, Object *ob, Depsgraph *depsgraph)
static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit, Depsgraph *depsgraph) static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit, Depsgraph *depsgraph)
{ {
GPUBatch *faces, *edges, *verts, *facedots; GPUBatch *faces, *edges, *verts, *facedots;
Object *eval_ob = DEG_get_evaluated_object(depsgraph, obedit); Object *ob_eval = DEG_get_evaluated_object(depsgraph, obedit);
const ToolSettings *ts = scene->toolsettings; const ToolSettings *ts = scene->toolsettings;
float col1[4], col2[4], col3[4], transparent[4] = {0.0f, 0.0f, 0.0f, 0.0f}; float col1[4], col2[4], col3[4], transparent[4] = {0.0f, 0.0f, 0.0f, 0.0f};
if (sima->flag & SI_DRAWSHADOW) { if (sima->flag & SI_DRAWSHADOW) {
bool is_cage_like_final_meshes = false; bool is_cage_like_final_meshes = false;
Mesh *me = (Mesh *)eval_ob->data; Mesh *me = (Mesh *)ob_eval->data;
BMEditMesh *embm = me->edit_mesh; BMEditMesh *embm = me->edit_mesh;
is_cage_like_final_meshes = embm && embm->mesh_eval_final && is_cage_like_final_meshes = embm && embm->mesh_eval_final &&
embm->mesh_eval_final->runtime.is_original; embm->mesh_eval_final->runtime.is_original;
@ -300,7 +300,7 @@ static void draw_uvs(SpaceImage *sima, Scene *scene, Object *obedit, Depsgraph *
} }
} }
uvedit_get_batches(eval_ob, sima, scene, &faces, &edges, &verts, &facedots); uvedit_get_batches(ob_eval, sima, scene, &faces, &edges, &verts, &facedots);
bool interpedges; bool interpedges;
bool draw_stretch = (sima->flag & SI_DRAW_STRETCH) != 0; bool draw_stretch = (sima->flag & SI_DRAW_STRETCH) != 0;