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:
authorSergey Sharybin <sergey.vfx@gmail.com>2018-01-30 16:32:27 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2018-01-30 16:32:27 +0300
commit0d64857c3f2364349475728958fac211b0bad5a2 (patch)
treefe73096f14f2fef92aba25b4ad77e63e1c079465
parentb5cbc8bb606654a21e25cb616d60c89ac61c65a9 (diff)
parentb3c4a2a8da7f1a243628da852d1b8fdc986cbc25 (diff)
Merge branch 'master' into blender2.8
-rw-r--r--intern/cycles/blender/blender_mesh.cpp2
-rw-r--r--intern/cycles/device/device_memory.h2
-rw-r--r--intern/cycles/graph/node.cpp20
-rw-r--r--intern/cycles/graph/node.h4
-rw-r--r--intern/cycles/kernel/kernel_path_state.h8
-rw-r--r--intern/cycles/render/film.cpp2
-rw-r--r--intern/cycles/render/graph.cpp29
-rw-r--r--intern/cycles/render/graph.h3
-rw-r--r--intern/cycles/render/mesh.cpp4
-rw-r--r--intern/cycles/render/shader.cpp23
-rw-r--r--intern/cycles/render/shader.h2
-rw-r--r--intern/cycles/util/util_md5.cpp7
-rw-r--r--intern/cycles/util/util_md5.h1
-rw-r--r--intern/elbeem/CMakeLists.txt8
-rw-r--r--intern/elbeem/intern/ntl_blenderdumper.cpp12
-rw-r--r--source/blender/blenkernel/BKE_paint.h1
-rw-r--r--source/blender/blenkernel/intern/paint.c36
-rw-r--r--source/blender/bmesh/tools/bmesh_bevel.c7
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc4
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_relations.cc52
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_relations.h9
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc37
-rw-r--r--source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc2
-rw-r--r--source/blender/editors/include/ED_view3d.h2
-rw-r--r--source/blender/editors/object/object_edit.c5
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex.c3
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c31
-rw-r--r--source/blender/editors/space_view3d/space_view3d.c6
-rw-r--r--source/blender/editors/space_view3d/view3d_edit.c2
-rw-r--r--source/blender/makesrna/intern/rna_space.c4
-rw-r--r--source/creator/creator_args.c2
31 files changed, 243 insertions, 87 deletions
diff --git a/intern/cycles/blender/blender_mesh.cpp b/intern/cycles/blender/blender_mesh.cpp
index c0f89fcfbd1..adffb4ea004 100644
--- a/intern/cycles/blender/blender_mesh.cpp
+++ b/intern/cycles/blender/blender_mesh.cpp
@@ -1124,7 +1124,7 @@ Mesh *BlenderSync::sync_mesh(BL::Object& b_ob,
bool attribute_recalc = false;
foreach(Shader *shader, mesh->used_shaders)
- if(shader->need_update_attributes)
+ if(shader->need_update_mesh)
attribute_recalc = true;
if(!attribute_recalc)
diff --git a/intern/cycles/device/device_memory.h b/intern/cycles/device/device_memory.h
index 0f2015ee27c..d8fe41e78bb 100644
--- a/intern/cycles/device/device_memory.h
+++ b/intern/cycles/device/device_memory.h
@@ -247,7 +247,7 @@ public:
void alloc_to_device(size_t num, bool shrink_to_fit = true)
{
- size_t new_size = num*sizeof(T);
+ size_t new_size = num;
bool reallocate;
if(shrink_to_fit) {
diff --git a/intern/cycles/graph/node.cpp b/intern/cycles/graph/node.cpp
index 10d91a1e4ef..c71221746ad 100644
--- a/intern/cycles/graph/node.cpp
+++ b/intern/cycles/graph/node.cpp
@@ -18,6 +18,7 @@
#include "graph/node_type.h"
#include "util/util_foreach.h"
+#include "util/util_md5.h"
#include "util/util_param.h"
#include "util/util_transform.h"
@@ -403,5 +404,24 @@ bool Node::equals(const Node& other) const
return true;
}
+/* Hash */
+
+void Node::hash(MD5Hash& md5)
+{
+ md5.append(type->name.string());
+
+ foreach(const SocketType& socket, type->inputs) {
+ md5.append(socket.name.string());
+
+ if(socket.is_array()) {
+ const array<bool>* a = (const array<bool>*)(((char*)this) + socket.struct_offset);
+ md5.append((uint8_t*)a->data(), socket.size() * a->size());
+ }
+ else {
+ md5.append(((uint8_t*)this) + socket.struct_offset, socket.size());
+ }
+ }
+}
+
CCL_NAMESPACE_END
diff --git a/intern/cycles/graph/node.h b/intern/cycles/graph/node.h
index 53425f5faf1..d198c38be32 100644
--- a/intern/cycles/graph/node.h
+++ b/intern/cycles/graph/node.h
@@ -24,6 +24,7 @@
CCL_NAMESPACE_BEGIN
+class MD5Hash;
struct Node;
struct NodeType;
struct Transform;
@@ -88,6 +89,9 @@ struct Node
/* equals */
bool equals(const Node& other) const;
+ /* compute hash of node and its socket values */
+ void hash(MD5Hash& md5);
+
ustring name;
const NodeType *type;
};
diff --git a/intern/cycles/kernel/kernel_path_state.h b/intern/cycles/kernel/kernel_path_state.h
index e5e915791cb..2ae866bb051 100644
--- a/intern/cycles/kernel/kernel_path_state.h
+++ b/intern/cycles/kernel/kernel_path_state.h
@@ -179,13 +179,13 @@ ccl_device_inline float path_state_continuation_probability(KernelGlobals *kg,
#endif
}
else {
- /* Test max bounces for various ray types.
- The check for max_volume_bounce doesn't happen here but inside volume_shader_sample().
- See T53914.
- */
+ /* Test max bounces for various ray types. */
if((state->bounce >= kernel_data.integrator.max_bounce) ||
(state->diffuse_bounce >= kernel_data.integrator.max_diffuse_bounce) ||
(state->glossy_bounce >= kernel_data.integrator.max_glossy_bounce) ||
+#ifdef __VOLUME__
+ (state->volume_bounce >= kernel_data.integrator.max_volume_bounce) ||
+#endif
(state->transmission_bounce >= kernel_data.integrator.max_transmission_bounce))
{
return 0.0f;
diff --git a/intern/cycles/render/film.cpp b/intern/cycles/render/film.cpp
index b305f01095f..69828cc78da 100644
--- a/intern/cycles/render/film.cpp
+++ b/intern/cycles/render/film.cpp
@@ -496,7 +496,7 @@ void Film::tag_passes_update(Scene *scene, const array<Pass>& passes_)
scene->mesh_manager->tag_update(scene);
foreach(Shader *shader, scene->shaders)
- shader->need_update_attributes = true;
+ shader->need_update_mesh = true;
}
else if(Pass::contains(passes, PASS_MOTION) != Pass::contains(passes_, PASS_MOTION))
scene->mesh_manager->tag_update(scene);
diff --git a/intern/cycles/render/graph.cpp b/intern/cycles/render/graph.cpp
index fb2e34c2fc7..096de878e51 100644
--- a/intern/cycles/render/graph.cpp
+++ b/intern/cycles/render/graph.cpp
@@ -23,8 +23,9 @@
#include "util/util_algorithm.h"
#include "util/util_foreach.h"
-#include "util/util_queue.h"
#include "util/util_logging.h"
+#include "util/util_md5.h"
+#include "util/util_queue.h"
CCL_NAMESPACE_BEGIN
@@ -683,6 +684,32 @@ void ShaderGraph::break_cycles(ShaderNode *node, vector<bool>& visited, vector<b
on_stack[node->id] = false;
}
+void ShaderGraph::compute_displacement_hash()
+{
+ /* Compute hash of all nodes linked to displacement, to detect if we need
+ * to recompute displacement when shader nodes change. */
+ ShaderInput *displacement_in = output()->input("Displacement");
+
+ if(!displacement_in->link) {
+ displacement_hash = "";
+ return;
+ }
+
+ ShaderNodeSet nodes_displace;
+ find_dependencies(nodes_displace, displacement_in);
+
+ MD5Hash md5;
+ foreach(ShaderNode *node, nodes_displace) {
+ node->hash(md5);
+ foreach(ShaderInput *input, node->inputs) {
+ int link_id = (input->link) ? input->link->parent->id : 0;
+ md5.append((uint8_t*)&link_id, sizeof(link_id));
+ }
+ }
+
+ displacement_hash = md5.get_hex();
+}
+
void ShaderGraph::clean(Scene *scene)
{
/* Graph simplification */
diff --git a/intern/cycles/render/graph.h b/intern/cycles/render/graph.h
index 1d1701b30a2..7ed292b5b96 100644
--- a/intern/cycles/render/graph.h
+++ b/intern/cycles/render/graph.h
@@ -42,6 +42,7 @@ class SVMCompiler;
class OSLCompiler;
class OutputNode;
class ConstantFolder;
+class MD5Hash;
/* Bump
*
@@ -243,6 +244,7 @@ public:
size_t num_node_ids;
bool finalized;
bool simplified;
+ string displacement_hash;
ShaderGraph();
~ShaderGraph();
@@ -256,6 +258,7 @@ public:
void relink(ShaderNode *node, ShaderOutput *from, ShaderOutput *to);
void remove_proxy_nodes();
+ void compute_displacement_hash();
void simplify(Scene *scene);
void finalize(Scene *scene,
bool do_bump = false,
diff --git a/intern/cycles/render/mesh.cpp b/intern/cycles/render/mesh.cpp
index 4bf5b60a737..5bcb47deb65 100644
--- a/intern/cycles/render/mesh.cpp
+++ b/intern/cycles/render/mesh.cpp
@@ -1964,7 +1964,7 @@ void MeshManager::device_update(Device *device, DeviceScene *dscene, Scene *scen
/* Update normals. */
foreach(Mesh *mesh, scene->meshes) {
foreach(Shader *shader, mesh->used_shaders) {
- if(shader->need_update_attributes)
+ if(shader->need_update_mesh)
mesh->need_update = true;
}
@@ -2104,7 +2104,7 @@ void MeshManager::device_update(Device *device, DeviceScene *dscene, Scene *scen
<< summary.full_report();
foreach(Shader *shader, scene->shaders) {
- shader->need_update_attributes = false;
+ shader->need_update_mesh = false;
}
Scene::MotionType need_motion = scene->need_motion();
diff --git a/intern/cycles/render/shader.cpp b/intern/cycles/render/shader.cpp
index abb9e19a074..51b7f76b9d5 100644
--- a/intern/cycles/render/shader.cpp
+++ b/intern/cycles/render/shader.cpp
@@ -200,7 +200,7 @@ Shader::Shader()
used = false;
need_update = true;
- need_update_attributes = true;
+ need_update_mesh = true;
}
Shader::~Shader()
@@ -235,9 +235,24 @@ void Shader::set_graph(ShaderGraph *graph_)
/* do this here already so that we can detect if mesh or object attributes
* are needed, since the node attribute callbacks check if their sockets
* are connected but proxy nodes should not count */
- if(graph_)
+ if(graph_) {
graph_->remove_proxy_nodes();
+ if(displacement_method != DISPLACE_BUMP) {
+ graph_->compute_displacement_hash();
+ }
+ }
+
+ /* update geometry if displacement changed */
+ if(displacement_method != DISPLACE_BUMP) {
+ const char *old_hash = (graph)? graph->displacement_hash.c_str() : "";
+ const char *new_hash = (graph_)? graph_->displacement_hash.c_str() : "";
+
+ if(strcmp(old_hash, new_hash) != 0) {
+ need_update_mesh = true;
+ }
+ }
+
/* assign graph */
delete graph;
graph = graph_;
@@ -294,9 +309,9 @@ void Shader::tag_update(Scene *scene)
}
/* compare if the attributes changed, mesh manager will check
- * need_update_attributes, update the relevant meshes and clear it. */
+ * need_update_mesh, update the relevant meshes and clear it. */
if(attributes.modified(prev_attributes)) {
- need_update_attributes = true;
+ need_update_mesh = true;
scene->mesh_manager->need_update = true;
}
diff --git a/intern/cycles/render/shader.h b/intern/cycles/render/shader.h
index 3fdcd3c0c5b..4a48c1347da 100644
--- a/intern/cycles/render/shader.h
+++ b/intern/cycles/render/shader.h
@@ -98,7 +98,7 @@ public:
/* synchronization */
bool need_update;
- bool need_update_attributes;
+ bool need_update_mesh;
/* If the shader has only volume components, the surface is assumed to
* be transparent.
diff --git a/intern/cycles/util/util_md5.cpp b/intern/cycles/util/util_md5.cpp
index 19168135f01..749760d84f0 100644
--- a/intern/cycles/util/util_md5.cpp
+++ b/intern/cycles/util/util_md5.cpp
@@ -310,6 +310,13 @@ void MD5Hash::append(const uint8_t *data, int nbytes)
memcpy(buf, p, left);
}
+void MD5Hash::append(const string& str)
+{
+ if(str.size()) {
+ append((const uint8_t*)str.c_str(), str.size());
+ }
+}
+
bool MD5Hash::append_file(const string& filepath)
{
FILE *f = path_fopen(filepath, "rb");
diff --git a/intern/cycles/util/util_md5.h b/intern/cycles/util/util_md5.h
index e4cd66c85b0..b043b591e67 100644
--- a/intern/cycles/util/util_md5.h
+++ b/intern/cycles/util/util_md5.h
@@ -41,6 +41,7 @@ public:
~MD5Hash();
void append(const uint8_t *data, int size);
+ void append(const string& str);
bool append_file(const string& filepath);
string get_hex();
diff --git a/intern/elbeem/CMakeLists.txt b/intern/elbeem/CMakeLists.txt
index 30c5615f1d2..1534219a052 100644
--- a/intern/elbeem/CMakeLists.txt
+++ b/intern/elbeem/CMakeLists.txt
@@ -107,6 +107,14 @@ add_definitions(
-DNEWDIRVELMOTEST=0
)
+if(WIN32)
+ # We need BLI_gzopen on win32 for unicode paths
+ add_definitions(
+ -DLBM_GZIP_OVERRIDE_H="${CMAKE_SOURCE_DIR}/source/blender/blenlib/BLI_fileops.h"
+ -D LBM_GZIP_OPEN_FN="\(gzFile\)BLI_gzopen"
+ )
+endif()
+
if(WITH_OPENMP)
add_definitions(-DPARALLEL=1)
else()
diff --git a/intern/elbeem/intern/ntl_blenderdumper.cpp b/intern/elbeem/intern/ntl_blenderdumper.cpp
index ec05c25004d..af99dc03add 100644
--- a/intern/elbeem/intern/ntl_blenderdumper.cpp
+++ b/intern/elbeem/intern/ntl_blenderdumper.cpp
@@ -22,7 +22,11 @@
#include <zlib.h>
-
+#ifdef LBM_GZIP_OVERRIDE_H
+# include LBM_GZIP_OVERRIDE_H
+#else
+# define LBM_GZIP_OPEN_FN(a, b) gzopen(a, b)
+#endif
/******************************************************************************
* Constructor
@@ -141,7 +145,8 @@ int ntlBlenderDumper::renderScene( void )
std::ostringstream bvelfilename;
bvelfilename << boutfilename.str();
bvelfilename << ".bvel.gz";
- gzf = gzopen(bvelfilename.str().c_str(), "wb9");
+ /* wraps gzopen */
+ gzf = LBM_GZIP_OPEN_FN(bvelfilename.str().c_str(), "wb9");
if(gzf) {
int numVerts;
if(sizeof(numVerts)!=4) { errMsg("ntlBlenderDumper::renderScene","Invalid int size"); return 1; }
@@ -162,7 +167,8 @@ int ntlBlenderDumper::renderScene( void )
// compress all bobj's
boutfilename << ".bobj.gz";
- gzf = gzopen(boutfilename.str().c_str(), "wb1"); // wb9 is slow for large meshes!
+ /* wraps gzopen */
+ gzf = LBM_GZIP_OPEN_FN(boutfilename.str().c_str(), "wb1"); // wb9 is slow for large meshes!
if (!gzf) {
errMsg("ntlBlenderDumper::renderScene","Unable to open output '" + boutfilename.str() + "' ");
return 1; }
diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h
index b952859e508..0d55b65fe65 100644
--- a/source/blender/blenkernel/BKE_paint.h
+++ b/source/blender/blenkernel/BKE_paint.h
@@ -256,6 +256,7 @@ void BKE_sculpt_update_mesh_elements(
struct MultiresModifierData *BKE_sculpt_multires_active(struct Scene *scene, struct Object *ob);
int BKE_sculpt_mask_layers_ensure(struct Object *ob,
struct MultiresModifierData *mmd);
+void BKE_sculpt_toolsettings_data_ensure(struct Scene *scene);
enum {
SCULPT_MASK_LAYER_CALC_VERT = (1 << 0),
diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c
index 152a882de97..2bf5d12e50e 100644
--- a/source/blender/blenkernel/intern/paint.c
+++ b/source/blender/blenkernel/intern/paint.c
@@ -1064,3 +1064,39 @@ int BKE_sculpt_mask_layers_ensure(Object *ob, MultiresModifierData *mmd)
return ret;
}
+
+void BKE_sculpt_toolsettings_data_ensure(struct Scene *scene)
+{
+ Sculpt *sd = scene->toolsettings->sculpt;
+ if (sd == NULL) {
+ sd = scene->toolsettings->sculpt = MEM_callocN(sizeof(Sculpt), __func__);
+
+ /* Turn on X plane mirror symmetry by default */
+ sd->paint.symmetry_flags |= PAINT_SYMM_X;
+ sd->paint.flags |= PAINT_SHOW_BRUSH;
+
+ /* Make sure at least dyntopo subdivision is enabled */
+ sd->flags |= SCULPT_DYNTOPO_SUBDIVIDE | SCULPT_DYNTOPO_COLLAPSE;
+ }
+
+ if (!sd->detail_size) {
+ sd->detail_size = 12;
+ }
+ if (!sd->detail_percent) {
+ sd->detail_percent = 25;
+ }
+ if (sd->constant_detail == 0.0f) {
+ sd->constant_detail = 3.0f;
+ }
+
+ /* Set sane default tiling offsets */
+ if (!sd->paint.tile_offset[0]) {
+ sd->paint.tile_offset[0] = 1.0f;
+ }
+ if (!sd->paint.tile_offset[1]) {
+ sd->paint.tile_offset[1] = 1.0f;
+ }
+ if (!sd->paint.tile_offset[2]) {
+ sd->paint.tile_offset[2] = 1.0f;
+ }
+}
diff --git a/source/blender/bmesh/tools/bmesh_bevel.c b/source/blender/bmesh/tools/bmesh_bevel.c
index 35167835646..a18c4405a31 100644
--- a/source/blender/bmesh/tools/bmesh_bevel.c
+++ b/source/blender/bmesh/tools/bmesh_bevel.c
@@ -1985,6 +1985,7 @@ static bool adjust_the_cycle_or_chain_fast(BoundVert *vstart, int np, bool iscyc
g_prod[i] = gprod;
gprod_sum += gprod;
}
+ g_prod[0] = 1.0f;
if (iscycle) {
gprod *= g[0];
if (fabs(gprod - 1.0f) > BEVEL_EPSILON) {
@@ -1993,8 +1994,6 @@ static bool adjust_the_cycle_or_chain_fast(BoundVert *vstart, int np, bool iscyc
MEM_freeN(g_prod);
return false;
}
- else
- g_prod[0] = 1.0f;
}
if (gprod_sum == 0.0f) {
MEM_freeN(g);
@@ -2163,7 +2162,7 @@ static void adjust_offsets(BevelParams *bp)
/* first follow paired edges in left->right direction */
v = vchainstart = vanchor;
iscycle = false;
- while(v->eon && !v->visited && !iscycle) {
+ while (v->eon && !v->visited && !iscycle) {
enext = find_other_end_edge_half(bp, v->efirst, &bvcur);
BLI_assert(enext != NULL);
vnext = enext->leftv;
@@ -2191,7 +2190,7 @@ static void adjust_offsets(BevelParams *bp)
vchainstart = vnext;
v->visited = true;
v = vnext;
- } while(!v->visited && v->eon);
+ } while (!v->visited && v->eon);
adjust_the_cycle_or_chain(vchainstart, false);
}
} while ((vanchor = vanchor->next) != bv->vmesh->boundstart);
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc
index 2fc42efa440..8be974aae39 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc
@@ -347,8 +347,8 @@ void DepsgraphNodeBuilder::build_proxy_rig(Object *object)
object_cow),
DEG_OPCODE_POSE_INIT);
op_node->set_as_entry();
- BLI_LISTBASE_FOREACH (bPoseChannel *, pchan, &object_cow->pose->chanbase) {
- /* Local bone transform. */
+
+ BLI_LISTBASE_FOREACH (bPoseChannel *, pchan, &object->pose->chanbase) {
op_node = add_operation_node(&object->id,
DEG_NODE_TYPE_BONE,
pchan->name,
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
index cfb73ecc2ad..281e58cf38a 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc
@@ -939,18 +939,7 @@ void DepsgraphRelationBuilder::build_animdata_curves(ID *id)
ComponentKey adt_key(id, DEG_NODE_TYPE_ANIMATION);
TimeSourceKey time_src_key;
add_relation(time_src_key, adt_key, "TimeSrc -> Animation");
- /* Build relations from animation operation to properties it changes. */
- build_animdata_curves_targets(id);
-}
-
-void DepsgraphRelationBuilder::build_animdata_curves_targets(ID *id)
-{
- AnimData *adt = BKE_animdata_from_id(id);
- if (adt == NULL || adt->action == NULL) {
- return;
- }
- /* Get source operation. */
- ComponentKey adt_key(id, DEG_NODE_TYPE_ANIMATION);
+ /* Get source operations. */
DepsNode *node_from = get_node(adt_key);
BLI_assert(node_from != NULL);
if (node_from == NULL) {
@@ -958,10 +947,28 @@ void DepsgraphRelationBuilder::build_animdata_curves_targets(ID *id)
}
OperationDepsNode *operation_from = node_from->get_exit_operation();
BLI_assert(operation_from != NULL);
+ /* Build relations from animation operation to properties it changes. */
+ if (adt->action != NULL) {
+ build_animdata_curves_targets(id, adt_key,
+ operation_from,
+ &adt->action->curves);
+ }
+ BLI_LISTBASE_FOREACH(NlaTrack *, nlt, &adt->nla_tracks) {
+ build_animdata_nlastrip_targets(id, adt_key,
+ operation_from,
+ &nlt->strips);
+ }
+}
+
+void DepsgraphRelationBuilder::build_animdata_curves_targets(
+ ID *id, ComponentKey &adt_key,
+ OperationDepsNode *operation_from,
+ ListBase *curves)
+{
/* Iterate over all curves and build relations. */
PointerRNA id_ptr;
RNA_id_pointer_create(id, &id_ptr);
- BLI_LISTBASE_FOREACH (FCurve *, fcu, &adt->action->curves) {
+ BLI_LISTBASE_FOREACH(FCurve *, fcu, curves) {
PointerRNA ptr;
PropertyRNA *prop;
int index;
@@ -1004,6 +1011,25 @@ void DepsgraphRelationBuilder::build_animdata_curves_targets(ID *id)
}
}
+void DepsgraphRelationBuilder::build_animdata_nlastrip_targets(
+ ID *id, ComponentKey &adt_key,
+ OperationDepsNode *operation_from,
+ ListBase *strips)
+{
+ BLI_LISTBASE_FOREACH(NlaStrip *, strip, strips) {
+ if (strip->act != NULL) {
+ build_animdata_curves_targets(id, adt_key,
+ operation_from,
+ &strip->act->curves);
+ }
+ else if (strip->strips.first != NULL) {
+ build_animdata_nlastrip_targets(id, adt_key,
+ operation_from,
+ &strip->strips);
+ }
+ }
+}
+
void DepsgraphRelationBuilder::build_animdata_drivers(ID *id)
{
AnimData *adt = BKE_animdata_from_id(id);
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.h b/source/blender/depsgraph/intern/builder/deg_builder_relations.h
index 30b3219f989..4fcb2acc5f3 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations.h
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.h
@@ -205,7 +205,14 @@ struct DepsgraphRelationBuilder
RootPChanMap *root_map);
void build_animdata(ID *id);
void build_animdata_curves(ID *id);
- void build_animdata_curves_targets(ID *id);
+ void build_animdata_curves_targets(ID *id,
+ ComponentKey &adt_key,
+ OperationDepsNode *operation_from,
+ ListBase *curves);
+ void build_animdata_nlastrip_targets(ID *id,
+ ComponentKey &adt_key,
+ OperationDepsNode *operation_from,
+ ListBase *strips);
void build_animdata_drivers(ID *id);
void build_driver(ID *id, FCurve *fcurve);
void build_driver_data(ID *id, FCurve *fcurve);
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc
index ad812a4b505..563acd01bf2 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc
@@ -443,16 +443,43 @@ void DepsgraphRelationBuilder::build_rig(Object *object)
void DepsgraphRelationBuilder::build_proxy_rig(Object *object)
{
- OperationKey pose_init_key(&object->id, DEG_NODE_TYPE_EVAL_POSE, DEG_OPCODE_POSE_INIT);
- OperationKey pose_done_key(&object->id, DEG_NODE_TYPE_EVAL_POSE, DEG_OPCODE_POSE_DONE);
+ Object *proxy_from = object->proxy_from;
+ OperationKey pose_init_key(&object->id,
+ DEG_NODE_TYPE_EVAL_POSE,
+ DEG_OPCODE_POSE_INIT);
+ OperationKey pose_done_key(&object->id,
+ DEG_NODE_TYPE_EVAL_POSE,
+ DEG_OPCODE_POSE_DONE);
BLI_LISTBASE_FOREACH (bPoseChannel *, pchan, &object->pose->chanbase) {
- OperationKey bone_local_key(&object->id, DEG_NODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_LOCAL);
- OperationKey bone_ready_key(&object->id, DEG_NODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_READY);
- OperationKey bone_done_key(&object->id, DEG_NODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_DONE);
+ OperationKey bone_local_key(&object->id,
+ DEG_NODE_TYPE_BONE, pchan->name,
+ DEG_OPCODE_BONE_LOCAL);
+ OperationKey bone_ready_key(&object->id,
+ DEG_NODE_TYPE_BONE,
+ pchan->name,
+ DEG_OPCODE_BONE_READY);
+ OperationKey bone_done_key(&object->id,
+ DEG_NODE_TYPE_BONE,
+ pchan->name,
+ DEG_OPCODE_BONE_DONE);
add_relation(pose_init_key, bone_local_key, "Pose Init -> Bone Local");
add_relation(bone_local_key, bone_ready_key, "Local -> Ready");
add_relation(bone_ready_key, bone_done_key, "Ready -> Done");
add_relation(bone_done_key, pose_done_key, "Bone Done -> Pose Done");
+
+ if (pchan->prop != NULL) {
+ OperationKey bone_parameters(&object->id,
+ DEG_NODE_TYPE_PARAMETERS,
+ DEG_OPCODE_PARAMETERS_EVAL,
+ pchan->name);
+ OperationKey from_bone_parameters(&proxy_from->id,
+ DEG_NODE_TYPE_PARAMETERS,
+ DEG_OPCODE_PARAMETERS_EVAL,
+ pchan->name);
+ add_relation(from_bone_parameters,
+ bone_parameters,
+ "Proxy Bone Parameters");
+ }
}
}
diff --git a/source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc b/source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc
index 8fc4c0bcec1..a717448df4a 100644
--- a/source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc
+++ b/source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc
@@ -467,7 +467,7 @@ static void deg_debug_graphviz_node_relations(const DebugContext &ctx,
deg_debug_fprintf(ctx, "[");
/* Note: without label an id seem necessary to avoid bugs in graphviz/dot */
deg_debug_fprintf(ctx, "id=\"%s\"", rel->name);
- deg_debug_fprintf(ctx, "label=\"%s\"", rel->name);
+ // deg_debug_fprintf(ctx, "label=\"%s\"", rel->name);
deg_debug_fprintf(ctx, ",color="); deg_debug_graphviz_relation_color(ctx, rel);
deg_debug_fprintf(ctx, ",penwidth=\"%f\"", penwidth);
/* NOTE: edge from node to own cluster is not possible and gives graphviz
diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h
index 7eee053061e..e3eb4c7ac97 100644
--- a/source/blender/editors/include/ED_view3d.h
+++ b/source/blender/editors/include/ED_view3d.h
@@ -476,7 +476,7 @@ void ED_view3d_operator_properties_viewmat_get(struct wmOperator *op, int *winx,
/* render */
void ED_view3d_stop_render_preview(struct wmWindowManager *wm, struct ARegion *ar);
-void ED_view3d_shade_update(struct Main *bmain, struct Scene *scene, struct View3D *v3d, struct ScrArea *sa);
+void ED_view3d_shade_update(struct Main *bmain, struct View3D *v3d, struct ScrArea *sa);
#define V3D_IS_ZBUF(v3d) \
(((v3d)->flag & V3D_ZBUF_SELECT) && ((v3d)->drawtype > OB_WIRE))
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c
index 5697c48d381..1dc3f21afef 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -216,11 +216,6 @@ static bool ED_object_editmode_load_ex(Main *bmain, Object *obedit, const bool f
if (freedata) ED_mball_editmball_free(obedit);
}
- /* Tag update so no access to freed data referenced from
- * derived cache will happen.
- */
- DEG_id_tag_update((ID *)obedit->data, 0);
-
return true;
}
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index 0c1df71b1aa..b536f42a54e 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -940,6 +940,9 @@ static void do_weight_paint_vertex(
/* Toggle operator for turning vertex paint mode on or off (copied from sculpt.c) */
static void vertex_paint_init_session(const EvaluationContext *eval_ctx, Scene *scene, Object *ob)
{
+ /* Create persistent sculpt mode data */
+ BKE_sculpt_toolsettings_data_ensure(scene);
+
if (ob->sculpt == NULL) {
ob->sculpt = MEM_callocN(sizeof(SculptSession), "sculpt session");
BKE_sculpt_update_mesh_elements(eval_ctx, scene, scene->toolsettings->sculpt, ob, 0, false);
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index c9d550aa4bd..2d71cc17a19 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -5602,11 +5602,12 @@ static void SCULPT_OT_symmetrize(wmOperatorType *ot)
static void sculpt_init_session(const bContext *C, Scene *scene, Object *ob)
{
EvaluationContext eval_ctx;
-
CTX_data_eval_ctx(C, &eval_ctx);
- ob->sculpt = MEM_callocN(sizeof(SculptSession), "sculpt session");
+ /* Create persistent sculpt mode data */
+ BKE_sculpt_toolsettings_data_ensure(scene);
+ ob->sculpt = MEM_callocN(sizeof(SculptSession), "sculpt session");
BKE_sculpt_update_mesh_elements(&eval_ctx, scene, scene->toolsettings->sculpt, ob, 0, false);
}
@@ -5614,7 +5615,6 @@ static void sculpt_init_session(const bContext *C, Scene *scene, Object *ob)
static int sculpt_mode_toggle_exec(bContext *C, wmOperator *op)
{
Scene *scene = CTX_data_scene(C);
- ToolSettings *ts = CTX_data_tool_settings(C);
Object *ob = CTX_data_active_object(C);
const int mode_flag = OB_MODE_SCULPT;
const bool is_mode_set = (ob->mode & mode_flag) != 0;
@@ -5670,31 +5670,6 @@ static int sculpt_mode_toggle_exec(bContext *C, wmOperator *op)
if (flush_recalc)
DEG_id_tag_update(&ob->id, OB_RECALC_DATA);
- /* Create persistent sculpt mode data */
- if (!ts->sculpt) {
- ts->sculpt = MEM_callocN(sizeof(Sculpt), "sculpt mode data");
-
- /* Turn on X plane mirror symmetry by default */
- ts->sculpt->paint.symmetry_flags |= PAINT_SYMM_X;
- ts->sculpt->paint.flags |= PAINT_SHOW_BRUSH;
-
- /* Make sure at least dyntopo subdivision is enabled */
- ts->sculpt->flags |= SCULPT_DYNTOPO_SUBDIVIDE | SCULPT_DYNTOPO_COLLAPSE;
- }
-
- if (!ts->sculpt->detail_size)
- ts->sculpt->detail_size = 12;
- if (!ts->sculpt->detail_percent)
- ts->sculpt->detail_percent = 25;
- if (ts->sculpt->constant_detail == 0.0f)
- ts->sculpt->constant_detail = 3.0f;
-
- /* Set sane default tiling offsets */
- if (!ts->sculpt->paint.tile_offset[0]) ts->sculpt->paint.tile_offset[0] = 1.0f;
- if (!ts->sculpt->paint.tile_offset[1]) ts->sculpt->paint.tile_offset[1] = 1.0f;
- if (!ts->sculpt->paint.tile_offset[2]) ts->sculpt->paint.tile_offset[2] = 1.0f;
-
-
/* Create sculpt mode session data */
if (ob->sculpt)
BKE_sculptsession_free(ob);
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
index 1c46e42a9f5..24b3a9b9547 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -296,7 +296,7 @@ void ED_view3d_stop_render_preview(wmWindowManager *wm, ARegion *ar)
}
}
-void ED_view3d_shade_update(Main *bmain, Scene *scene, View3D *v3d, ScrArea *sa)
+void ED_view3d_shade_update(Main *bmain, View3D *v3d, ScrArea *sa)
{
wmWindowManager *wm = bmain->wm.first;
@@ -308,10 +308,6 @@ void ED_view3d_shade_update(Main *bmain, Scene *scene, View3D *v3d, ScrArea *sa)
ED_view3d_stop_render_preview(wm, ar);
}
}
- else if (scene->obedit != NULL && scene->obedit->type == OB_MESH) {
- /* Tag mesh to load edit data. */
- DEG_id_tag_update(scene->obedit->data, 0);
- }
}
/* ******************** default callbacks for view3d space ***************** */
diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c
index 2457a890f71..ba9432b932d 100644
--- a/source/blender/editors/space_view3d/view3d_edit.c
+++ b/source/blender/editors/space_view3d/view3d_edit.c
@@ -4696,7 +4696,7 @@ static int toggle_render_exec(bContext *C, wmOperator *UNUSED(op))
v3d->prev_drawtype = v3d->drawtype;
v3d->drawtype = OB_RENDER;
}
- ED_view3d_shade_update(CTX_data_main(C), CTX_data_scene(C), v3d, CTX_wm_area(C));
+ ED_view3d_shade_update(CTX_data_main(C), v3d, CTX_wm_area(C));
WM_event_add_notifier(C, NC_SPACE | ND_SPACE_VIEW3D, v3d);
return OPERATOR_FINISHED;
}
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 4ff8444cd71..f6019747b45 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -573,12 +573,12 @@ static void rna_SpaceView3D_layer_update(Main *bmain, Scene *UNUSED(scene), Poin
DEG_on_visible_update(bmain, false);
}
-static void rna_SpaceView3D_viewport_shade_update(Main *bmain, Scene *scene, PointerRNA *ptr)
+static void rna_SpaceView3D_viewport_shade_update(Main *bmain, Scene *UNUSED(scene), PointerRNA *ptr)
{
View3D *v3d = (View3D *)(ptr->data);
ScrArea *sa = rna_area_from_space(ptr);
- ED_view3d_shade_update(bmain, scene, v3d, sa);
+ ED_view3d_shade_update(bmain, v3d, sa);
}
static void rna_SpaceView3D_matcap_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *ptr)
diff --git a/source/creator/creator_args.c b/source/creator/creator_args.c
index 6b47d7c3474..b96991413ff 100644
--- a/source/creator/creator_args.c
+++ b/source/creator/creator_args.c
@@ -1348,7 +1348,7 @@ static const char arg_handle_render_frame_doc[] =
"\n"
"\t* +<frame> start frame relative, -<frame> end frame relative.\n"
"\t* A comma separated list of frames can also be used (no spaces).\n"
-"\t* A range of frames can be expressed using '..' seperator between the first and last frames (inclusive).\n"
+"\t* A range of frames can be expressed using '..' separator between the first and last frames (inclusive).\n"
;
static int arg_handle_render_frame(int argc, const char **argv, void *data)
{