Cleanup: remove unused DAG_EVAL_PREVIEW mode.

This commit is contained in:
Brecht Van Lommel 2018-06-11 11:48:16 +02:00
parent 2abb156b9f
commit 05111d79d0
6 changed files with 7 additions and 14 deletions

View File

@ -498,7 +498,7 @@ static void make_duplis_verts(const DupliContext *ctx)
{
Scene *scene = ctx->scene;
Object *parent = ctx->object;
bool use_texcoords = ELEM(DEG_get_mode(ctx->depsgraph), DAG_EVAL_RENDER, DAG_EVAL_PREVIEW);
bool use_texcoords = (DEG_get_mode(ctx->depsgraph) == DAG_EVAL_RENDER);
VertexDupliData vdd;
vdd.ctx = ctx;
@ -702,7 +702,7 @@ static void make_child_duplis_faces(const DupliContext *ctx, void *userdata, Obj
float (*orco)[3] = fdd->orco;
MLoopUV *mloopuv = fdd->mloopuv;
int a, totface = fdd->totface;
bool use_texcoords = ELEM(DEG_get_mode(ctx->depsgraph), DAG_EVAL_RENDER, DAG_EVAL_PREVIEW);
bool use_texcoords = (DEG_get_mode(ctx->depsgraph) == DAG_EVAL_RENDER);
float child_imat[4][4];
DupliObject *dob;
@ -768,7 +768,7 @@ static void make_duplis_faces(const DupliContext *ctx)
{
Scene *scene = ctx->scene;
Object *parent = ctx->object;
bool use_texcoords = ELEM(DEG_get_mode(ctx->depsgraph), DAG_EVAL_RENDER, DAG_EVAL_PREVIEW);
bool use_texcoords = (DEG_get_mode(ctx->depsgraph) == DAG_EVAL_RENDER);
FaceDupliData fdd;
fdd.use_scale = ((parent->transflag & OB_DUPLIFACES_SCALE) != 0);
@ -821,7 +821,7 @@ static void make_duplis_particle_system(const DupliContext *ctx, ParticleSystem
Scene *scene = ctx->scene;
Object *par = ctx->object;
bool for_render = DEG_get_mode(ctx->depsgraph) == DAG_EVAL_RENDER;
bool use_texcoords = ELEM(DEG_get_mode(ctx->depsgraph), DAG_EVAL_RENDER, DAG_EVAL_PREVIEW);
bool use_texcoords = for_render;
Object *ob = NULL, **oblist = NULL, obcopy, *obcopylist = NULL;
DupliObject *dob;

View File

@ -70,8 +70,7 @@ struct ViewLayer;
typedef enum eEvaluationMode {
DAG_EVAL_VIEWPORT = 0, /* evaluate for OpenGL viewport */
DAG_EVAL_PREVIEW = 1, /* evaluate for render with preview settings */
DAG_EVAL_RENDER = 2, /* evaluate for render purposes */
DAG_EVAL_RENDER = 1, /* evaluate for render purposes */
} eEvaluationMode;
/* DagNode->eval_flags */

View File

@ -212,7 +212,6 @@ void DEG_iterator_objects_begin(BLI_Iterator *iter, DEGObjectIterData *data)
data->id_node_index = 0;
data->num_id_nodes = num_id_nodes;
eEvaluationMode eval_mode = DEG_get_mode(depsgraph);
/* Viewport rendered mode is DAG_EVAL_PREVIEW but still treated as viewport. */
data->visibility_check = (eval_mode == DAG_EVAL_RENDER)
? OB_VISIBILITY_CHECK_FOR_RENDER
: OB_VISIBILITY_CHECK_FOR_VIEWPORT;

View File

@ -1623,7 +1623,7 @@ enum {
/* #define R_DEPRECATED 0x10000 */
/* #define R_RECURS_PROTECTION 0x20000 */
#define R_TEXNODE_PREVIEW 0x40000
#define R_VIEWPORT_PREVIEW 0x80000
/* #define R_VIEWPORT_PREVIEW 0x80000 */
#define R_EXR_CACHE_FILE 0x100000
#define R_MULTIVIEW 0x200000

View File

@ -474,7 +474,6 @@ static void rna_def_depsgraph(BlenderRNA *brna)
static EnumPropertyItem enum_depsgraph_mode_items[] = {
{DAG_EVAL_VIEWPORT, "VIEWPORT", 0, "Viewport", "Viewport non-rendered mode"},
{DAG_EVAL_PREVIEW, "PREVIEW", 0, "Preview", "Viewport rendered draw mode"},
{DAG_EVAL_RENDER, "RENDER", 0, "Render", "Render"},
{0, NULL, 0, NULL, NULL}
};

View File

@ -768,7 +768,7 @@ void RE_InitState(Render *re, Render *source, RenderData *rd,
/* if preview render, we try to keep old result */
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
if (re->r.scemode & (R_BUTS_PREVIEW|R_VIEWPORT_PREVIEW)) {
if (re->r.scemode & R_BUTS_PREVIEW) {
if (had_freestyle || (re->r.mode & R_EDGE_FRS)) {
/* freestyle manipulates render layers so always have to free */
render_result_free(re->result);
@ -806,10 +806,6 @@ void RE_InitState(Render *re, Render *source, RenderData *rd,
render_result_view_new(re->result, "");
}
eEvaluationMode mode = (re->r.scemode & R_VIEWPORT_PREVIEW) ? DAG_EVAL_PREVIEW : DAG_EVAL_RENDER;
/* This mode should have been set in the Depsgraph immediately when it was created. */
(void)mode;
/* ensure renderdatabase can use part settings correct */
RE_parts_clamp(re);