From 28604c46a137c1288cc7a494b36ed72e44a0ab8b Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Wed, 10 Feb 2016 15:09:45 +0100 Subject: Cycles: Make Blender importer more forward compatible Basically the idea is to make code robust against extending enum options in the future by falling back to a known safe default setting when RNA is set to something unknown. While this approach solves the issues similar to T47377, but it wouldn't really help when/if any of the RNA values gets ever deprecated and removed. There'll be no simple solution to that apart from defining explicit mapping from RNA value to Cycles one. Another part which isn't so great actually is that we now have to have some enum guards and give some explicit values to the enum items, but we can live with that perhaps. Reviewers: dingto, juicyfruit, lukasstockner97, brecht Reviewed By: brecht Differential Revision: https://developer.blender.org/D1785 --- intern/cycles/render/scene.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'intern/cycles/render/scene.h') diff --git a/intern/cycles/render/scene.h b/intern/cycles/render/scene.h index a1ff6809f67..74976c1513c 100644 --- a/intern/cycles/render/scene.h +++ b/intern/cycles/render/scene.h @@ -125,7 +125,12 @@ public: class SceneParams { public: ShadingSystem shadingsystem; - enum BVHType { BVH_DYNAMIC, BVH_STATIC } bvh_type; + enum BVHType { + BVH_DYNAMIC = 0, + BVH_STATIC = 1, + + BVH_NUM_TYPES, + } bvh_type; bool use_bvh_spatial_split; bool use_qbvh; bool persistent_data; -- cgit v1.2.3