Merge branch 'master' into blender2.8
authorSergey Sharybin <sergey.vfx@gmail.com>
Fri, 15 Sep 2017 07:30:58 +0000 (12:30 +0500)
committerSergey Sharybin <sergey.vfx@gmail.com>
Fri, 15 Sep 2017 07:35:20 +0000 (12:35 +0500)
21 files changed:
1  2 
intern/cycles/blender/blender_mesh.cpp
source/blender/blenkernel/intern/image.c
source/blender/blenkernel/intern/scene.c
source/blender/blenkernel/intern/sequencer.c
source/blender/depsgraph/DEG_depsgraph.h
source/blender/depsgraph/intern/depsgraph_tag.cc
source/blender/editors/object/object_bake_api.c
source/blender/editors/render/render_internal.c
source/blender/editors/render/render_opengl.c
source/blender/editors/sculpt_paint/sculpt.c
source/blender/editors/space_image/image_draw.c
source/blender/editors/space_image/image_ops.c
source/blender/editors/space_node/node_edit.c
source/blender/editors/transform/transform_conversions.c
source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp
source/blender/makesrna/intern/rna_main_api.c
source/blender/makesrna/intern/rna_object.c
source/blender/render/extern/include/RE_pipeline.h
source/blender/render/intern/source/pipeline.c
source/blenderplayer/bad_level_call_stubs/stubs.c
source/creator/creator_args.c

index 151d47b031674aab21c3690ba55071e45ccd2238,e8613d9ab9c62ab29998b4f2b77a8e6fad27141c..d94b4c5ad6d1b281aef015652f89f6ad16401c3a
@@@ -1642,7 -1917,7 +1642,7 @@@ void BKE_scene_update_tagged(Evaluation
        prepare_mesh_for_viewport_render(bmain, scene);
  
        /* flush recalc flags to dependencies */
-       DEG_ids_flush_tagged(bmain, scene);
 -      DAG_ids_flush_tagged(bmain);
++      DEG_scene_flush_update(bmain, scene);
  
        /* removed calls to quick_cache, see pointcache.c */
        
index 4818c7a021786b000b2b1264dedcc039a17f6e1c,9b0db300e6d326e2df8be31431c56336d3784905..c6b6f97b0bc205eeaed9a642e33610d7a81946f3
@@@ -3339,9 -3337,9 +3339,9 @@@ static ImBuf *seq_render_scene_strip(co
                 */
                if (!is_thread_main || is_rendering == false || is_background || context->eval_ctx->mode == DAG_EVAL_RENDER) {
                        if (re == NULL)
-                               re = RE_NewRender(scene->id.name);
+                               re = RE_NewSceneRender(scene);
  
 -                      BKE_scene_update_for_newframe(context->eval_ctx, context->bmain, scene, scene->lay);
 +                      BKE_scene_update_for_newframe(context->eval_ctx, context->bmain, scene);
                        RE_BlenderFrame(re, context->bmain, scene, NULL, camera, scene->lay, frame, false);
  
                        /* restore previous state after it was toggled on & off by RE_BlenderFrame */
index 7bea24d9fd8d875dfa082d386481b8a4c5ed6413,5adcb3a11b302c24931d8c8ccb4f07bd5695d2a3..41724100b51e2c424159dd1331acc3f821187519
@@@ -432,14 -271,24 +432,24 @@@ void DEG_id_type_tag(Main *bmain, shor
  /* Recursively push updates out to all nodes dependent on this,
   * until all affected are tagged and/or scheduled up for eval
   */
- void DEG_ids_flush_tagged(Main *bmain, Scene *scene)
+ void DEG_ids_flush_tagged(Main *bmain)
  {
-       /* TODO(sergey): Only visible scenes? */
-       if (scene->depsgraph_legacy != NULL) {
-               DEG::deg_graph_flush_updates(
-                       bmain,
-                       reinterpret_cast<DEG::Depsgraph *>(scene->depsgraph_legacy));
+       for (Scene *scene = (Scene *)bmain->scene.first;
+            scene != NULL;
+            scene = (Scene *)scene->id.next)
+       {
+               DEG_scene_flush_update(bmain, scene);
+       }
+ }
+ void DEG_scene_flush_update(Main *bmain, Scene *scene)
+ {
 -      if (scene->depsgraph == NULL) {
++      if (scene->depsgraph_legacy == NULL) {
+               return;
        }
 -              reinterpret_cast<DEG::Depsgraph *>(scene->depsgraph));
+       DEG::deg_graph_flush_updates(
+               bmain,
++              reinterpret_cast<DEG::Depsgraph *>(scene->depsgraph_legacy));
  }
  
  /* Update dependency graph when visible scenes/layers changes. */
index f915fd5ec64b492e336169cabc8d5ec226b4a437,26c863d8514cfb6fb3d241562b5ba03602f8afbf..212d6128a9ee400464e2d57289c4b59e7dfb4365
@@@ -307,8 -305,7 +307,8 @@@ static int screen_render_exec(bContext 
                return OPERATOR_CANCELLED;
        }
  
-       re = RE_NewRender(scene->id.name);
+       re = RE_NewSceneRender(scene);
 +      RE_SetDepsgraph(re, CTX_data_depsgraph(C));
        lay_override = (v3d && v3d->lay != scene->lay) ? v3d->lay : 0;
  
        G.is_break = false;
index fed1d3ce38ce1bb62483c6687f1d1ca41199b7f7,8cb23c9e021ff592fa2e2f765227b5c8d2b0ed09..8ef9e24c6d467a3d1042674da527a52122ada1b6
@@@ -90,7 -87,8 +90,7 @@@ static void draw_render_info(const bCon
                               float zoomx,
                               float zoomy)
  {
-       Render *re = RE_GetRender(scene->id.name);
 -      RenderResult *rr;
+       Render *re = RE_GetSceneRender(scene);
        RenderData *rd = RE_engine_get_render_data(re);
        Scene *stats_scene = ED_render_job_get_scene(C);
        if (stats_scene == NULL) {
index 9f682a5be9a7caebfa4033d83e8a18c6e90cf97b,ca49cde4b7a7e93211bbbbea9530993c9ebcb81d..53ce794366939c8fefa7f6e42966afbb8e6c5382
@@@ -5602,13 -5605,16 +5602,16 @@@ static void set_trans_object_base_flags
                }
        }
  
 -      DAG_scene_flush_update(G.main, t->scene, -1, 0);
+       /* all recalc flags get flushed to all layers, so a layer flip later on works fine */
++      DEG_scene_flush_update(G.main, t->scene);
        /* and we store them temporal in base (only used for transform code) */
        /* this because after doing updates, the object->recalc is cleared */
 -      for (base = scene->base.first; base; base = base->next) {
 +      for (base = sl->object_bases.first; base; base = base->next) {
                if (base->object->recalc & OB_RECALC_OB)
 -                      base->flag |= BA_HAS_RECALC_OB;
 +                      base->flag_legacy |= BA_HAS_RECALC_OB;
                if (base->object->recalc & OB_RECALC_DATA)
 -                      base->flag |= BA_HAS_RECALC_DATA;
 +                      base->flag_legacy |= BA_HAS_RECALC_DATA;
        }
  }
  
@@@ -5679,7 -5684,8 +5682,8 @@@ static int count_proportional_objects(T
        
  
        /* all recalc flags get flushed to all layers, so a layer flip later on works fine */
 -      DAG_scene_relations_update(G.main, t->scene);
 -      DAG_scene_flush_update(G.main, t->scene, -1, 0);
 +      DEG_scene_relations_update(G.main, t->scene);
++      DEG_scene_flush_update(G.main, t->scene);
  
        /* and we store them temporal in base (only used for transform code) */
        /* this because after doing updates, the object->recalc is cleared */
index 50fe2162bda578702c8b617a5a65b34141aa5518,9c478c203e745b956416d61740e0bed9299a2a62..322acd9966cf7d8b7771226f350ed1c8095310f1
@@@ -951,9 -957,7 +951,9 @@@ Render *BlenderStrokeRenderer::RenderSc
        }
  #endif
  
-       Render *freestyle_render = RE_NewRender(freestyle_scene->id.name);
+       Render *freestyle_render = RE_NewSceneRender(freestyle_scene);
 +      DEG_scene_relations_update(freestyle_bmain, freestyle_scene);
 +      freestyle_render->depsgraph = freestyle_scene->depsgraph_legacy;
  
        RE_RenderFreestyleStrokes(freestyle_render, freestyle_bmain, freestyle_scene,
                                  render && get_stroke_count() > 0);
index d980916aeecf95477f68dbf94c5b1d6f2ea03e4a,871f50e992ebd2c60cab146ec797b4be4418fa26..c8c1c7be280fa43bd63d540313b6d63cd942f785
@@@ -1846,64 -1923,4 +1951,68 @@@ void RNA_def_main_linestyles(BlenderRN
        RNA_def_property_boolean_funcs(prop, "rna_Main_linestyle_is_updated_get", NULL);
  }
  
 +void RNA_def_main_workspaces(BlenderRNA *brna, PropertyRNA *cprop)
 +{
 +      StructRNA *srna;
 +      FunctionRNA *func;
 +      PropertyRNA *parm;
 +      PropertyRNA *prop;
 +
 +      RNA_def_property_srna(cprop, "BlendDataWorkSpaces");
 +      srna = RNA_def_struct(brna, "BlendDataWorkSpaces", NULL);
 +      RNA_def_struct_sdna(srna, "Main");
 +      RNA_def_struct_ui_text(srna, "Main Workspaces", "Collection of workspaces");
 +
 +      func = RNA_def_function(srna, "tag", "rna_Main_workspaces_tag");
 +      parm = RNA_def_boolean(func, "value", 0, "Value", "");
 +      RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
 +
 +      prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_clear_flag(prop, PROP_EDITABLE);
 +      RNA_def_property_boolean_funcs(prop, "rna_Main_workspaces_is_updated_get", NULL);
 +}
 +
 +void RNA_def_main_lightprobes(BlenderRNA *brna, PropertyRNA *cprop)
 +{
 +      StructRNA *srna;
 +      FunctionRNA *func;
 +      PropertyRNA *parm;
 +      PropertyRNA *prop;
 +
 +      RNA_def_property_srna(cprop, "BlendDataProbes");
 +      srna = RNA_def_struct(brna, "BlendDataProbes", NULL);
 +      RNA_def_struct_sdna(srna, "Main");
 +      RNA_def_struct_ui_text(srna, "Main Light Probes", "Collection of light probes");
 +
 +      func = RNA_def_function(srna, "new", "rna_Main_lightprobe_new");
 +      RNA_def_function_ui_description(func, "Add a new probe to the main database");
 +      parm = RNA_def_string(func, "name", "Probe", 0, "", "New name for the data-block");
 +      RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
 +      /* return type */
 +      parm = RNA_def_pointer(func, "lightprobe", "LightProbe", "", "New light probe data-block");
 +      RNA_def_function_return(func, parm);
 +
 +      func = RNA_def_function(srna, "remove", "rna_Main_ID_remove");
 +      RNA_def_function_flag(func, FUNC_USE_REPORTS);
 +      RNA_def_function_ui_description(func, "Remove a probe from the current blendfile");
 +      parm = RNA_def_pointer(func, "lightprobe", "LightProbe", "", "Probe to remove");
 +      RNA_def_parameter_flags(parm, PROP_NEVER_NULL, PARM_REQUIRED | PARM_RNAPTR);
 +      RNA_def_parameter_clear_flags(parm, PROP_THICK_WRAP, 0);
 +      RNA_def_boolean(func, "do_unlink", true, "",
 +                      "Unlink all usages of this probe before deleting it "
 +                      "(WARNING: will also delete objects instancing that light probe data)");
++      RNA_def_boolean(func, "do_id_user", true, "",
++                      "Decrement user counter of all datablocks used by this light probe");
++      RNA_def_boolean(func, "do_ui_user", true, "",
++                      "Make sure interface does not reference this light probe");
 +
 +      func = RNA_def_function(srna, "tag", "rna_Main_lightprobes_tag");
 +      parm = RNA_def_boolean(func, "value", 0, "Value", "");
 +      RNA_def_parameter_flags(parm, 0, PARM_REQUIRED);
 +
 +      prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_clear_flag(prop, PROP_EDITABLE);
 +      RNA_def_property_boolean_funcs(prop, "rna_Main_lightprobes_is_updated_get", NULL);
 +}
 +
  #endif
Simple merge