Merge branch 'master' into blender2.8
[blender.git] / intern / cycles / blender / blender_sync.h
index 1e7b0b32518e518d04fb9be3591a50389c1294dc..2ea86ba11332eed310a2f2072d19c66475277d08 100644 (file)
@@ -43,6 +43,7 @@ class Mesh;
 class Object;
 class ParticleSystem;
 class Scene;
+class ViewLayer;
 class Shader;
 class ShaderGraph;
 class ShaderNode;
@@ -60,14 +61,14 @@ public:
        /* sync */
        bool sync_recalc();
        void sync_data(BL::RenderSettings& b_render,
+                      BL::Depsgraph& b_depsgraph,
                       BL::SpaceView3D& b_v3d,
                       BL::Object& b_override,
                       int width, int height,
-                      void **python_thread_state,
-                      const char *layer = 0);
-       void sync_render_layers(BL::SpaceView3D& b_v3d, const char *layer);
-       array<Pass> sync_render_passes(BL::RenderLayer& b_rlay,
-                                      BL::SceneRenderLayer& b_srlay,
+                      void **python_thread_state);
+       void sync_view_layer(BL::SpaceView3D& b_v3d, BL::ViewLayer& b_view_layer);
+       array<Pass> sync_render_passes(BL::RenderLayer& b_render_layer,
+                                      BL::ViewLayer& b_view_layer,
                                       const SessionParams &session_params);
        void sync_integrator();
        void sync_camera(BL::RenderSettings& b_render,
@@ -77,8 +78,8 @@ public:
        void sync_view(BL::SpaceView3D& b_v3d,
                       BL::RegionView3D& b_rv3d,
                       int width, int height);
-       inline int get_layer_samples() { return render_layer.samples; }
-       inline int get_layer_bound_samples() { return render_layer.bound_samples; }
+       inline int get_layer_samples() { return view_layer.samples; }
+       inline int get_layer_bound_samples() { return view_layer.bound_samples; }
 
        /* get parameters */
        static SceneParams get_scene_params(BL::Scene& b_scene,
@@ -99,30 +100,34 @@ public:
 
 private:
        /* sync */
-       void sync_lamps(bool update_all);
-       void sync_materials(bool update_all);
-       void sync_objects(float motion_time = 0.0f);
+       void sync_lamps(BL::Depsgraph& b_depsgraph, bool update_all);
+       void sync_materials(BL::Depsgraph& b_depsgraph, bool update_all);
+       void sync_objects(BL::Depsgraph& b_depsgraph, float motion_time = 0.0f);
        void sync_motion(BL::RenderSettings& b_render,
+                     BL::Depsgraph& b_depsgraph,
                         BL::Object& b_override,
                         int width, int height,
                         void **python_thread_state);
        void sync_film();
        void sync_view();
-       void sync_world(bool update_all);
-       void sync_shaders();
+       void sync_world(BL::Depsgraph& b_depsgraph, bool update_all);
+       void sync_shaders(BL::Depsgraph& b_depsgraph);
        void sync_curve_settings();
 
        void sync_nodes(Shader *shader, BL::ShaderNodeTree& b_ntree);
-       Mesh *sync_mesh(BL::Object& b_ob, bool object_updated, bool hide_tris);
-       void sync_curves(Mesh *mesh,
+       Mesh *sync_mesh(BL::Depsgraph& b_depsgrpah,
+                       BL::Object& b_ob,
+                       BL::Object& b_ob_instance,
+                       bool object_updated,
+                       bool hide_tris);
+       void sync_curves(BL::Depsgraph& b_depsgraph,
+                        Mesh *mesh,
                         BL::Mesh& b_mesh,
                         BL::Object& b_ob,
                         bool motion,
                         int motion_step = 0);
-       Object *sync_object(BL::Object& b_parent,
-                           int persistent_id[OBJECT_PERSISTENT_ID_SIZE],
-                           BL::DupliObject& b_dupli_ob,
-                           Transform& tfm,
+       Object *sync_object(BL::Depsgraph& b_depsgraph,
+                           BL::Depsgraph::duplis_iterator& b_dupli_iter,
                            uint layer_flag,
                            float motion_time,
                            bool hide_tris,
@@ -131,11 +136,13 @@ private:
        void sync_light(BL::Object& b_parent,
                        int persistent_id[OBJECT_PERSISTENT_ID_SIZE],
                        BL::Object& b_ob,
-                       BL::DupliObject& b_dupli_ob,
+                       BL::Object& b_ob_instance,
+                       int random_id,
                        Transform& tfm,
                        bool *use_portal);
        void sync_background_light(bool use_portal);
-       void sync_mesh_motion(BL::Object& b_ob,
+       void sync_mesh_motion(BL::Depsgraph& b_depsgraph,
+                             BL::Object& b_ob,
                              Object *object,
                              float motion_time);
        void sync_camera_motion(BL::RenderSettings& b_render,
@@ -182,31 +189,29 @@ private:
 
        struct RenderLayerInfo {
                RenderLayerInfo()
-               : scene_layer(0), layer(0),
+               : view_layer(0), layer(0),
                  holdout_layer(0), exclude_layer(0),
                  material_override(PointerRNA_NULL),
                  use_background_shader(true),
                  use_background_ao(true),
                  use_surfaces(true),
                  use_hair(true),
-                 use_viewport_visibility(false),
                  samples(0), bound_samples(false)
                {}
 
                string name;
-               uint scene_layer;
-               uint layer;
-               uint holdout_layer;
-               uint exclude_layer;
-               BL::Material material_override;
+               uint view_layer;
+               uint layer; /* This can be safely removed from Cycles. */
+               uint holdout_layer; /* This can be safely removed from Cycles. */
+               uint exclude_layer; /* This can be safely removed from Cycles. */
+               BL::Material material_override; /* This can be safely removed from Cycles. */
                bool use_background_shader;
                bool use_background_ao;
                bool use_surfaces;
                bool use_hair;
-               bool use_viewport_visibility;
-               int samples;
-               bool bound_samples;
-       } render_layer;
+               int samples; /* This can be safely removed from Cycles. */
+               bool bound_samples; /* This can be safely removed from Cycles. */
+       } view_layer;
 
        Progress &progress;
 };