Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Vazquez <blendergit@gmail.com>2020-08-18 17:13:08 +0300
committerAntonio Vazquez <blendergit@gmail.com>2020-08-18 17:13:08 +0300
commit77efb597cee8efafd9584fcd511e6111651c6512 (patch)
tree08b3ea14968cf06c06039170bce24f44d4f63706 /source/blender/blenkernel
parentde7470645a30e7bc6db67eff64d11778fb5ee3f2 (diff)
parent872efd8d73a3820680379230d83a0aadf5fc29ca (diff)
Merge branch 'master' into greasepencil-edit-curve
Conflicts: source/blender/editors/gpencil/gpencil_edit.c
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/BKE_blender_version.h3
-rw-r--r--source/blender/blenkernel/BKE_mesh_runtime.h7
-rw-r--r--source/blender/blenkernel/BKE_scene.h2
-rw-r--r--source/blender/blenkernel/intern/DerivedMesh.c25
-rw-r--r--source/blender/blenkernel/intern/blender.c6
-rw-r--r--source/blender/blenkernel/intern/mesh_convert.c10
-rw-r--r--source/blender/blenkernel/intern/paint.c10
-rw-r--r--source/blender/blenkernel/intern/pointcache.c5
-rw-r--r--source/blender/blenkernel/intern/scene.c11
-rw-r--r--source/blender/blenkernel/intern/seqprefetch.c2
-rw-r--r--source/blender/blenkernel/intern/sequencer.c4
11 files changed, 31 insertions, 54 deletions
diff --git a/source/blender/blenkernel/BKE_blender_version.h b/source/blender/blenkernel/BKE_blender_version.h
index 6ea113d8828..231cd0e53c5 100644
--- a/source/blender/blenkernel/BKE_blender_version.h
+++ b/source/blender/blenkernel/BKE_blender_version.h
@@ -50,6 +50,9 @@ extern "C" {
/** User readable version string. */
const char *BKE_blender_version_string(void);
+/* Returns true when version cycle is alpha, otherwise (beta, rc) returns false. */
+bool BKE_blender_version_is_alpha(void);
+
#ifdef __cplusplus
}
#endif
diff --git a/source/blender/blenkernel/BKE_mesh_runtime.h b/source/blender/blenkernel/BKE_mesh_runtime.h
index adb7c357049..267be4f44fd 100644
--- a/source/blender/blenkernel/BKE_mesh_runtime.h
+++ b/source/blender/blenkernel/BKE_mesh_runtime.h
@@ -71,7 +71,7 @@ struct Mesh *mesh_get_eval_deform(struct Depsgraph *depsgraph,
struct Object *ob,
const struct CustomData_MeshMasks *dataMask);
-struct Mesh *mesh_create_eval_final_render(struct Depsgraph *depsgraph,
+struct Mesh *mesh_create_eval_final(struct Depsgraph *depsgraph,
struct Scene *scene,
struct Object *ob,
const struct CustomData_MeshMasks *dataMask);
@@ -82,11 +82,6 @@ struct Mesh *mesh_create_eval_final_index_render(struct Depsgraph *depsgraph,
const struct CustomData_MeshMasks *dataMask,
int index);
-struct Mesh *mesh_create_eval_final_view(struct Depsgraph *depsgraph,
- struct Scene *scene,
- struct Object *ob,
- const struct CustomData_MeshMasks *dataMask);
-
struct Mesh *mesh_create_eval_no_deform(struct Depsgraph *depsgraph,
struct Scene *scene,
struct Object *ob,
diff --git a/source/blender/blenkernel/BKE_scene.h b/source/blender/blenkernel/BKE_scene.h
index 8cd86593873..e3bd57e75e3 100644
--- a/source/blender/blenkernel/BKE_scene.h
+++ b/source/blender/blenkernel/BKE_scene.h
@@ -145,7 +145,7 @@ void BKE_scene_update_tag_audio_volume(struct Depsgraph *, struct Scene *scene);
void BKE_scene_graph_update_tagged(struct Depsgraph *depsgraph, struct Main *bmain);
void BKE_scene_graph_evaluated_ensure(struct Depsgraph *depsgraph, struct Main *bmain);
-void BKE_scene_graph_update_for_newframe(struct Depsgraph *depsgraph, struct Main *bmain);
+void BKE_scene_graph_update_for_newframe(struct Depsgraph *depsgraph);
void BKE_scene_view_layer_graph_evaluated_ensure(struct Main *bmain,
struct Scene *scene,
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c
index 0dc85dfaa18..4f587abd9f0 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@ -909,8 +909,7 @@ static void mesh_calc_modifiers(struct Depsgraph *depsgraph,
const int required_mode = use_render ? eModifierMode_Render : eModifierMode_Realtime;
/* Sculpt can skip certain modifiers. */
- MultiresModifierData *mmd = get_multires_modifier(scene, ob, 0);
- const bool has_multires = (mmd && mmd->sculptlvl != 0);
+ const bool has_multires = BKE_sculpt_multires_active(scene, ob) != NULL;
bool multires_applied = false;
const bool sculpt_mode = ob->mode & OB_MODE_SCULPT && ob->sculpt && !use_render;
const bool sculpt_dyntopo = (sculpt_mode && ob->sculpt->bm) && !use_render;
@@ -1991,7 +1990,7 @@ Mesh *mesh_get_eval_deform(struct Depsgraph *depsgraph,
return ob->runtime.mesh_deform_eval;
}
-Mesh *mesh_create_eval_final_render(Depsgraph *depsgraph,
+Mesh *mesh_create_eval_final(Depsgraph *depsgraph,
Scene *scene,
Object *ob,
const CustomData_MeshMasks *dataMask)
@@ -2016,26 +2015,6 @@ Mesh *mesh_create_eval_final_index_render(Depsgraph *depsgraph,
return final;
}
-Mesh *mesh_create_eval_final_view(Depsgraph *depsgraph,
- Scene *scene,
- Object *ob,
- const CustomData_MeshMasks *dataMask)
-{
- Mesh *final;
-
- /* XXX hack
- * psys modifier updates particle state when called during dupli-list generation,
- * which can lead to wrong transforms. This disables particle system modifier execution.
- */
- ob->transflag |= OB_NO_PSYS_UPDATE;
-
- mesh_calc_modifiers(depsgraph, scene, ob, 1, false, dataMask, -1, false, false, NULL, &final);
-
- ob->transflag &= ~OB_NO_PSYS_UPDATE;
-
- return final;
-}
-
Mesh *mesh_create_eval_no_deform(Depsgraph *depsgraph,
Scene *scene,
Object *ob,
diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c
index e8aa13a8beb..1d5c8f76cc5 100644
--- a/source/blender/blenkernel/intern/blender.c
+++ b/source/blender/blenkernel/intern/blender.c
@@ -135,6 +135,12 @@ const char *BKE_blender_version_string(void)
return blender_version_string;
}
+bool BKE_blender_version_is_alpha(void)
+{
+ bool is_alpha = STREQ(STRINGIFY(BLENDER_VERSION_CYCLE), "alpha");
+ return is_alpha;
+}
+
void BKE_blender_globals_init(void)
{
blender_version_init();
diff --git a/source/blender/blenkernel/intern/mesh_convert.c b/source/blender/blenkernel/intern/mesh_convert.c
index 76a6d23bc8f..9426d09885e 100644
--- a/source/blender/blenkernel/intern/mesh_convert.c
+++ b/source/blender/blenkernel/intern/mesh_convert.c
@@ -1111,15 +1111,7 @@ static Mesh *mesh_new_from_mesh_object_with_layers(Depsgraph *depsgraph, Object
Scene *scene = DEG_get_evaluated_scene(depsgraph);
CustomData_MeshMasks mask = CD_MASK_MESH;
- Mesh *result;
-
- if (DEG_get_mode(depsgraph) == DAG_EVAL_RENDER) {
- result = mesh_create_eval_final_render(depsgraph, scene, &object_for_eval, &mask);
- }
- else {
- result = mesh_create_eval_final_view(depsgraph, scene, &object_for_eval, &mask);
- }
-
+ Mesh *result = mesh_create_eval_final(depsgraph, scene, &object_for_eval, &mask);
return result;
}
diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c
index 19d5c34ad73..e3c209b60e6 100644
--- a/source/blender/blenkernel/intern/paint.c
+++ b/source/blender/blenkernel/intern/paint.c
@@ -1421,7 +1421,7 @@ MultiresModifierData *BKE_sculpt_multires_active(Scene *scene, Object *ob)
continue;
}
- if (mmd->sculptlvl > 0) {
+ if (mmd->sculptlvl > 0 && !(mmd->flags & eMultiresModifierFlag_UseSculptBaseMesh)) {
return mmd;
}
@@ -1437,10 +1437,9 @@ static bool sculpt_modifiers_active(Scene *scene, Sculpt *sd, Object *ob)
{
ModifierData *md;
Mesh *me = (Mesh *)ob->data;
- MultiresModifierData *mmd = BKE_sculpt_multires_active(scene, ob);
VirtualModifierData virtualModifierData;
- if (mmd || ob->sculpt->bm) {
+ if (ob->sculpt->bm || BKE_sculpt_multires_active(scene, ob)) {
return false;
}
@@ -1458,7 +1457,10 @@ static bool sculpt_modifiers_active(Scene *scene, Sculpt *sd, Object *ob)
continue;
}
if (md->type == eModifierType_Multires && (ob->mode & OB_MODE_SCULPT)) {
- continue;
+ MultiresModifierData *mmd = (MultiresModifierData *)md;
+ if (!(mmd->flags & eMultiresModifierFlag_UseSculptBaseMesh)) {
+ continue;
+ }
}
if (md->type == eModifierType_ShapeKey) {
continue;
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c
index 64e642462af..8c5915d3768 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -4025,7 +4025,6 @@ static void ptcache_dt_to_str(char *str, double dtime)
/* if bake is not given run simulations to current frame */
void BKE_ptcache_bake(PTCacheBaker *baker)
{
- Main *bmain = baker->bmain;
Scene *scene = baker->scene;
ViewLayer *view_layer = baker->view_layer;
struct Depsgraph *depsgraph = baker->depsgraph;
@@ -4156,7 +4155,7 @@ void BKE_ptcache_bake(PTCacheBaker *baker)
stime = ptime = PIL_check_seconds_timer();
for (int fr = CFRA; fr <= endframe; fr += baker->quick_step, CFRA = fr) {
- BKE_scene_graph_update_for_newframe(depsgraph, bmain);
+ BKE_scene_graph_update_for_newframe(depsgraph);
if (baker->update_progress) {
float progress = ((float)(CFRA - startframe) / (float)(endframe - startframe));
@@ -4255,7 +4254,7 @@ void BKE_ptcache_bake(PTCacheBaker *baker)
CFRA = cfrao;
if (bake) { /* already on cfra unless baking */
- BKE_scene_graph_update_for_newframe(depsgraph, bmain);
+ BKE_scene_graph_update_for_newframe(depsgraph);
}
/* TODO: call redraw all windows somehow */
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index 7e25e8c96ae..631c5ed330d 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -1485,7 +1485,7 @@ static void scene_graph_update_tagged(Depsgraph *depsgraph, Main *bmain, bool on
for (int pass = 0; pass < 2; pass++) {
/* (Re-)build dependency graph if needed. */
- DEG_graph_relations_update(depsgraph, bmain, scene, view_layer);
+ DEG_graph_relations_update(depsgraph);
/* Uncomment this to check if graph was properly tagged for update. */
// DEG_debug_graph_relations_validate(depsgraph, bmain, scene);
/* Flush editing data if needed. */
@@ -1512,7 +1512,7 @@ static void scene_graph_update_tagged(Depsgraph *depsgraph, Main *bmain, bool on
* be tagged for an update anyway.
*
* If there are no relations changed by the callback this call will do nothing. */
- DEG_graph_relations_update(depsgraph, bmain, scene, view_layer);
+ DEG_graph_relations_update(depsgraph);
}
/* Inform editors about possible changes. */
DEG_ids_check_recalc(bmain, depsgraph, scene, view_layer, false);
@@ -1541,10 +1541,11 @@ void BKE_scene_graph_evaluated_ensure(Depsgraph *depsgraph, Main *bmain)
}
/* applies changes right away, does all sets too */
-void BKE_scene_graph_update_for_newframe(Depsgraph *depsgraph, Main *bmain)
+void BKE_scene_graph_update_for_newframe(Depsgraph *depsgraph)
{
Scene *scene = DEG_get_input_scene(depsgraph);
ViewLayer *view_layer = DEG_get_input_view_layer(depsgraph);
+ Main *bmain = DEG_get_bmain(depsgraph);
/* Keep this first. */
BKE_callback_exec_id(bmain, &scene->id, BKE_CB_EVT_FRAME_CHANGE_PRE);
@@ -1555,7 +1556,7 @@ void BKE_scene_graph_update_for_newframe(Depsgraph *depsgraph, Main *bmain)
*/
BKE_image_editors_update_frame(bmain, scene->r.cfra);
BKE_sound_set_cfra(scene->r.cfra);
- DEG_graph_relations_update(depsgraph, bmain, scene, view_layer);
+ DEG_graph_relations_update(depsgraph);
/* Update all objects: drivers, matrices, displists, etc. flags set
* by depgraph or manual, no layer check here, gets correct flushed.
*
@@ -1578,7 +1579,7 @@ void BKE_scene_graph_update_for_newframe(Depsgraph *depsgraph, Main *bmain)
/* NOTE: Similar to this case in scene_graph_update_tagged(). Need to ensure that
* DEG_ids_clear_recalc() doesn't access freed memory of possibly removed ID. */
- DEG_graph_relations_update(depsgraph, bmain, scene, view_layer);
+ DEG_graph_relations_update(depsgraph);
}
/* Inform editors about possible changes. */
diff --git a/source/blender/blenkernel/intern/seqprefetch.c b/source/blender/blenkernel/intern/seqprefetch.c
index 795086fffa4..c442b7ca780 100644
--- a/source/blender/blenkernel/intern/seqprefetch.c
+++ b/source/blender/blenkernel/intern/seqprefetch.c
@@ -220,7 +220,7 @@ static void seq_prefetch_init_depsgraph(PrefetchJob *pfjob)
DEG_debug_name_set(pfjob->depsgraph, "SEQUENCER PREFETCH");
/* Make sure there is a correct evaluated scene pointer. */
- DEG_graph_build_for_render_pipeline(pfjob->depsgraph, bmain, scene, view_layer);
+ DEG_graph_build_for_render_pipeline(pfjob->depsgraph);
/* Update immediately so we have proper evaluated scene. */
seq_prefetch_update_depsgraph(pfjob);
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c
index a2a45ae56b3..b4da0c5bd33 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -3593,7 +3593,7 @@ static ImBuf *seq_render_scene_strip(const SeqRenderData *context,
/* opengl offscreen render */
depsgraph = BKE_scene_get_depsgraph(context->bmain, scene, view_layer, true);
- BKE_scene_graph_update_for_newframe(depsgraph, context->bmain);
+ BKE_scene_graph_update_for_newframe(depsgraph);
ibuf = sequencer_view3d_fn(
/* set for OpenGL render (NULL when scrubbing) */
depsgraph,
@@ -3695,7 +3695,7 @@ finally:
scene->r.subframe = orig_data.subframe;
if (is_frame_update && (depsgraph != NULL)) {
- BKE_scene_graph_update_for_newframe(depsgraph, context->bmain);
+ BKE_scene_graph_update_for_newframe(depsgraph);
}
#ifdef DURIAN_CAMERA_SWITCH