From 45fdea48c152b0e632a911139c7173f1e44f9310 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Mon, 29 Jan 2018 19:01:44 +1300 Subject: Fix T53614: New Depsgraph ignores NLA strips The new depsgraph was only considering the active action when attaching relations from the AnimData component/operation to the properties that are affected by the animation data. As a result, only properties animated by the active action were working, while those animated by NLA strips did not change when playing back/scrubbing the timeline. This commit fixes this introducing a recursive method to properly visit all NLA strips, and calling DepsRelBuilder::build_animdata_curves_targets() on each of those strips. --- .../intern/builder/deg_builder_relations.cc | 52 ++++++++++++++++------ .../intern/builder/deg_builder_relations.h | 9 +++- 2 files changed, 47 insertions(+), 14 deletions(-) (limited to 'source') diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index 81daa8cfb8c..85ea2c0a8e4 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -916,18 +916,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) { @@ -935,10 +924,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; @@ -969,6 +976,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 de13ee19122..aa55b9f66ae 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.h +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.h @@ -201,7 +201,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); -- cgit v1.2.3 From 70286a76523a8a9c36858285a080075e4cd313d2 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 29 Jan 2018 14:43:12 +0100 Subject: Depsgraph: Cleanup, line wraps --- .../intern/builder/deg_builder_relations_rig.cc | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'source') 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 b23a6112fce..b0e99799824 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc @@ -444,12 +444,24 @@ 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); + 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"); -- cgit v1.2.3 From 6eb2b57f5a76d3ff91b485801747ba8547ab72d1 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 29 Jan 2018 14:45:45 +0100 Subject: Depsgraph: Disable labels on relations This code was disable a while back and got re-enabled by some previous debug process. Having relation names in dot file helps understanding what's going on in one cases, but makes things spread too far away in others. --- source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source') 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 270202f9f34..b76cd9eaadd 100644 --- a/source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc +++ b/source/blender/depsgraph/intern/debug/deg_debug_relations_graphviz.cc @@ -468,7 +468,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 -- cgit v1.2.3 From 68c1e3c28d60297d736a598bd897e1fff57f47b7 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 29 Jan 2018 14:53:27 +0100 Subject: Depsgraph: Fix missing update when property from proxy rig drives something --- source/blender/depsgraph/intern/builder/deg_builder_relations.cc | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source') diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index 85ea2c0a8e4..107ba8dc9a1 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -535,6 +535,14 @@ void DepsgraphRelationBuilder::build_object(Object *object) ComponentKey ob_pose_key(&object->id, DEG_NODE_TYPE_EVAL_POSE); ComponentKey proxy_pose_key(&object->proxy->id, DEG_NODE_TYPE_EVAL_POSE); add_relation(ob_pose_key, proxy_pose_key, "Proxy"); + + ComponentKey ob_parameters_key(&object->id, + DEG_NODE_TYPE_PARAMETERS); + ComponentKey proxy_parameters_key(&object->proxy->id, + DEG_NODE_TYPE_PARAMETERS); + add_relation(ob_parameters_key, + proxy_parameters_key, + "Proxy Parameters"); } /* Object dupligroup. */ if (object->dup_group != NULL) { -- cgit v1.2.3 From 263efb0b9a736a1529d8c6fce37e56bdb8d7866b Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 29 Jan 2018 15:06:44 +0100 Subject: Depsgraph: Correction for previous fix Original fix only worked when there is one custom property. --- .../depsgraph/intern/builder/deg_builder_nodes_rig.cc | 1 + .../depsgraph/intern/builder/deg_builder_relations.cc | 8 -------- .../depsgraph/intern/builder/deg_builder_relations_rig.cc | 15 +++++++++++++++ 3 files changed, 16 insertions(+), 8 deletions(-) (limited to 'source') 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 177a0ec4358..29cd72c13fd 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc @@ -274,6 +274,7 @@ void DepsgraphNodeBuilder::build_proxy_rig(Object *object) DEG_OPCODE_POSE_INIT); op_node->set_as_entry(); + BLI_LISTBASE_FOREACH (bPoseChannel *, pchan, &object->pose->chanbase) { op_node = add_operation_node(&object->id, DEG_NODE_TYPE_BONE, pchan->name, NULL, DEG_OPCODE_BONE_LOCAL); diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index 107ba8dc9a1..85ea2c0a8e4 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -535,14 +535,6 @@ void DepsgraphRelationBuilder::build_object(Object *object) ComponentKey ob_pose_key(&object->id, DEG_NODE_TYPE_EVAL_POSE); ComponentKey proxy_pose_key(&object->proxy->id, DEG_NODE_TYPE_EVAL_POSE); add_relation(ob_pose_key, proxy_pose_key, "Proxy"); - - ComponentKey ob_parameters_key(&object->id, - DEG_NODE_TYPE_PARAMETERS); - ComponentKey proxy_parameters_key(&object->proxy->id, - DEG_NODE_TYPE_PARAMETERS); - add_relation(ob_parameters_key, - proxy_parameters_key, - "Proxy Parameters"); } /* Object dupligroup. */ if (object->dup_group != NULL) { 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 b0e99799824..4a822fe7477 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc @@ -444,6 +444,7 @@ void DepsgraphRelationBuilder::build_rig(Object *object) void DepsgraphRelationBuilder::build_proxy_rig(Object *object) { + Object *proxy_from = object->proxy_from; OperationKey pose_init_key(&object->id, DEG_NODE_TYPE_EVAL_POSE, DEG_OPCODE_POSE_INIT); @@ -466,6 +467,20 @@ void DepsgraphRelationBuilder::build_proxy_rig(Object *object) 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"); + } } } -- cgit v1.2.3 From cebc7bb1980dcc0864685036188aad4cd79f64c6 Mon Sep 17 00:00:00 2001 From: Howard Trickey Date: Mon, 29 Jan 2018 10:01:19 -0500 Subject: Fix nan problem in previous bevel commit. For chains, access to g_prod[0] was undefined. And two minor style (whitespace) changes. --- source/blender/bmesh/tools/bmesh_bevel.c | 7 +++---- source/tools | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'source') 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/tools b/source/tools index ccf20e08702..7695e14cfc5 160000 --- a/source/tools +++ b/source/tools @@ -1 +1 @@ -Subproject commit ccf20e08702ee6424edbda01544bb9f8bc386de4 +Subproject commit 7695e14cfc5820ac66546e0e515914d85ab81af3 -- cgit v1.2.3 From d0f63d402db5260d57dc60cf52aa029d7f11f161 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 30 Jan 2018 20:33:20 +1100 Subject: Fix T53943: Weight paint crash in new scene --- source/blender/blenkernel/BKE_paint.h | 1 + source/blender/blenkernel/intern/paint.c | 36 ++++++++++++++++++++++ source/blender/editors/sculpt_paint/paint_vertex.c | 3 ++ source/blender/editors/sculpt_paint/sculpt.c | 29 ++--------------- 4 files changed, 43 insertions(+), 26 deletions(-) (limited to 'source') diff --git a/source/blender/blenkernel/BKE_paint.h b/source/blender/blenkernel/BKE_paint.h index cc02d8b547e..8e7e69d22ca 100644 --- a/source/blender/blenkernel/BKE_paint.h +++ b/source/blender/blenkernel/BKE_paint.h @@ -253,6 +253,7 @@ void BKE_sculpt_update_mesh_elements(struct Scene *scene, struct Sculpt *sd, str 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 c6aa9c40fce..dba2bc7287e 100644 --- a/source/blender/blenkernel/intern/paint.c +++ b/source/blender/blenkernel/intern/paint.c @@ -1057,3 +1057,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/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index a5405338ada..490343ab1f2 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -939,6 +939,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(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(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 37af1732045..2468f273a04 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -5585,8 +5585,10 @@ static void SCULPT_OT_symmetrize(wmOperatorType *ot) static void sculpt_init_session(Scene *scene, Object *ob) { - 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(scene, scene->toolsettings->sculpt, ob, 0, false); } @@ -5650,31 +5652,6 @@ static int sculpt_mode_toggle_exec(bContext *C, wmOperator *op) if (flush_recalc) DAG_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); -- cgit v1.2.3 From c80b1f54108b8d3491830b0667db4798fd751728 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 30 Jan 2018 21:02:27 +1100 Subject: Cleanup: warning, spelling --- source/blender/editors/sculpt_paint/sculpt.c | 1 - source/creator/creator_args.c | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) (limited to 'source') diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index 2468f273a04..696267a0e8e 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -5596,7 +5596,6 @@ static void sculpt_init_session(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; diff --git a/source/creator/creator_args.c b/source/creator/creator_args.c index 19f30584f89..a9da1e8c794 100644 --- a/source/creator/creator_args.c +++ b/source/creator/creator_args.c @@ -1351,7 +1351,7 @@ static const char arg_handle_render_frame_doc[] = "\n" "\t* + start frame relative, - 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) { -- cgit v1.2.3 From b3c4a2a8da7f1a243628da852d1b8fdc986cbc25 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Tue, 30 Jan 2018 14:14:26 +0100 Subject: Fix T52520: Metaballs in edit mode causes infinite Cycles viewport reset The issue was introduced by eb016eb as a fix for T41258, which added depsgraph tagging with zero flag. The comment was saying that it's to make derived caches to be updated, however bot sure how that could possibly work: tagging ID for update with 0 flag only sets updated tags in bmain in old dependency graph. In the new depsgraph, where object data is a part of depsgraph, doing such a tag forces object to be updated, which re-triggers viewport rendering, which is causing such an infinite viewport render rest. Can not reproduce any crashes here, so maybe it's fine to move on with this change. --- source/blender/editors/include/ED_view3d.h | 2 +- source/blender/editors/object/object_edit.c | 5 ----- source/blender/editors/space_view3d/space_view3d.c | 6 +----- source/blender/editors/space_view3d/view3d_edit.c | 2 +- source/blender/editors/space_view3d/view3d_view.c | 6 +++--- source/blender/makesrna/intern/rna_space.c | 4 ++-- 6 files changed, 8 insertions(+), 17 deletions(-) (limited to 'source') diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h index 6e01245e6dc..86de619323c 100644 --- a/source/blender/editors/include/ED_view3d.h +++ b/source/blender/editors/include/ED_view3d.h @@ -452,7 +452,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 d7c7976c344..f8210f8a595 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -398,11 +398,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. - */ - DAG_id_tag_update((ID *)obedit->data, 0); - return true; } diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index 996506a9cf7..a36b698a04e 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -290,7 +290,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; @@ -302,10 +302,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. */ - DAG_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 ebd0bbe0129..2d002a38a19 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -4729,7 +4729,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/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index baeee0e89d7..56f0e39aca0 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -1164,7 +1164,7 @@ static bool view3d_localview_init( return ok; } -static void restore_localviewdata(wmWindowManager *wm, wmWindow *win, Main *bmain, Scene *scene, ScrArea *sa, const int smooth_viewtx) +static void restore_localviewdata(wmWindowManager *wm, wmWindow *win, Main *bmain, ScrArea *sa, const int smooth_viewtx) { const bool free = true; ARegion *ar; @@ -1214,7 +1214,7 @@ static void restore_localviewdata(wmWindowManager *wm, wmWindow *win, Main *bmai } } - ED_view3d_shade_update(bmain, scene, v3d, sa); + ED_view3d_shade_update(bmain, v3d, sa); } } } @@ -1231,7 +1231,7 @@ static bool view3d_localview_exit( locallay = v3d->lay & 0xFF000000; - restore_localviewdata(wm, win, bmain, scene, sa, smooth_viewtx); + restore_localviewdata(wm, win, bmain, sa, smooth_viewtx); /* for when in other window the layers have changed */ if (v3d->scenelock) v3d->lay = scene->lay; diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index f3a7cd485d9..ca24cdd27ec 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -535,12 +535,12 @@ static void rna_SpaceView3D_layer_update(Main *bmain, Scene *UNUSED(scene), Poin DAG_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) -- cgit v1.2.3