From f48828b64e480b6f16c21f660d3d6212648d56d7 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Mon, 24 Mar 2014 15:10:16 +0600 Subject: Fix T39318: Blender 2.70 crash when I link an asset Issue is a regression since threaded objetc update and caused by the fact that some objects might share the same proxy object. It's all fine but object_handle_update() will call update for a proxy object which screws up threaded update. The thing is, proxy object is marked as depending on a scene object and such a call makes it so the children objetc is being updated. This is really bad and depsgraph is to take all responsibility on updating the proxy objects. So for now used a simple solution (which is safe to backport to 'a') which is skipping proxy update if the scene update is threaded and based on the DAG traversal. There are some still areas which calls object update directly and for that cases proxy object is still being updated from object_handle_update(). --- source/blender/blenkernel/intern/scene.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'source/blender/blenkernel/intern/scene.c') diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 110e91711f0..a00a8c49900 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -1270,7 +1270,7 @@ static void scene_update_all_bases(EvaluationContext *eval_ctx, Scene *scene, Sc for (base = scene->base.first; base; base = base->next) { Object *object = base->object; - BKE_object_handle_update_ex(eval_ctx, scene_parent, object, scene->rigidbody_world); + BKE_object_handle_update_ex(eval_ctx, scene_parent, object, scene->rigidbody_world, true); if (object->dup_group && (object->transflag & OB_DUPLIGROUP)) BKE_group_handle_recalc_and_update(eval_ctx, scene_parent, object, object->dup_group); @@ -1304,9 +1304,11 @@ static void scene_update_object_func(TaskPool *pool, void *taskdata, int threadi double start_time = 0.0; bool add_to_stats = false; - PRINT("Thread %d: update object %s\n", threadid, object->id.name); - if (G.debug & G_DEBUG_DEPSGRAPH) { + if (object->recalc & OB_RECALC_ALL) { + printf("Thread %d: update object %s\n", threadid, object->id.name); + } + start_time = PIL_check_seconds_timer(); if (object->recalc & OB_RECALC_ALL) { @@ -1319,7 +1321,7 @@ static void scene_update_object_func(TaskPool *pool, void *taskdata, int threadi * separately from main thread because of we've got no idea about * dependencies inside the group. */ - BKE_object_handle_update_ex(eval_ctx, scene_parent, object, scene->rigidbody_world); + BKE_object_handle_update_ex(eval_ctx, scene_parent, object, scene->rigidbody_world, false); /* Calculate statistics. */ if (add_to_stats) { -- cgit v1.2.3