From 2fe0cf54a5827cac5a8d67dc6786bf7a7dc45950 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20T=C3=B6nne?= Date: Mon, 7 Jul 2014 10:50:43 +0200 Subject: Fix T40712: Duplicators don't generate orco and UV coordinates in Cycles viewport preview. Fix T39286: Display percentage ignored in Cycles viewport. The threaded depsgraph update changes included a cleanup of the global is_rendering flag, which was replaced by a general EvalContext being passed to dupli functions. Problem is that the global flag was true for viewport duplis before (ugly hack), which was used as a check for generating dupli orco/UV from mesh data layers. The new flag is stricter and only true for actual renders, which disables these attributes and breaks the Cycles Texture Coordinates and UVMap nodes. The solution is to extend the simple for_render boolean to an enum: * VIEWPORT: OpenGL viewport drawing (dupli tex coords omitted) * PREVIEW: Viewport preview render (simplified modifiers) * RENDER: Full render with all details and attributes There are still some areas that need to be examined, in particular modifiers seem to totally ignore the EvaluationContext! Instead they generally execute without render params from the depsgraph (BKE_object_handle_update_ex) and are built with render settings explicitly. Differential Revision: https://developer.blender.org/D613 --- source/blender/blenkernel/BKE_depsgraph.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'source/blender/blenkernel/BKE_depsgraph.h') diff --git a/source/blender/blenkernel/BKE_depsgraph.h b/source/blender/blenkernel/BKE_depsgraph.h index bde15d29a1b..2ac5e5eb4be 100644 --- a/source/blender/blenkernel/BKE_depsgraph.h +++ b/source/blender/blenkernel/BKE_depsgraph.h @@ -56,10 +56,15 @@ struct ListBase; * which is needed for it's evaluation, */ typedef struct EvaluationContext { - bool for_render; /* Set to true if evaluation shall be performed for render purposes, - * keep at false if update shall happen for the viewport. */ + int mode; /* evaluation mode */ } EvaluationContext; +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 */ +} eEvaluationMode; + /* DagNode->eval_flags */ enum { /* Regardless to curve->path animation flag path is to be evaluated anyway, -- cgit v1.2.3