diff options
author | Bastien Montagne <bastien@blender.org> | 2020-10-26 13:29:20 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2020-10-26 13:29:20 +0300 |
commit | a207fb7ea7860f66308370e887b7ab5a58ae9f01 (patch) | |
tree | 73ba9def28cbbd784f58aafe5167110382b7d5c1 /source | |
parent | 19f74e40228f28fd50b76c4671514f77d76af16c (diff) | |
parent | 25c3a2e42dadc737d076d4b97b7ea778929ecf40 (diff) |
Merge branch 'blender-v2.91-release' into master
Conflicts:
source/blender/blenkernel/intern/armature.c
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/armature.c | 3 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/lib_override.c | 57 |
2 files changed, 38 insertions, 22 deletions
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index 4aa328fcb22..bad2ed53436 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -2581,7 +2581,8 @@ void BKE_pose_rebuild(Main *bmain, Object *ob, bArmature *arm, const bool do_id_ void BKE_pose_ensure(Main *bmain, Object *ob, bArmature *arm, const bool do_id_user) { BLI_assert(!ELEM(NULL, arm, ob)); - if ((ob->pose == NULL) || (ob->pose->flag & POSE_RECALC)) { + if (ob->type == OB_ARMATURE && ((ob->pose == NULL) || (ob->pose->flag & POSE_RECALC))) { + BLI_assert(GS(arm->id.name) == ID_AR); BKE_pose_rebuild(bmain, ob, arm, do_id_user); } } diff --git a/source/blender/blenkernel/intern/lib_override.c b/source/blender/blenkernel/intern/lib_override.c index 6574a15fd59..79e33f768b6 100644 --- a/source/blender/blenkernel/intern/lib_override.c +++ b/source/blender/blenkernel/intern/lib_override.c @@ -1230,13 +1230,16 @@ bool BKE_lib_override_library_status_check_local(Main *bmain, ID *local) BLI_assert(GS(local->name) == GS(reference->name)); if (GS(local->name) == ID_OB) { - /* Our beloved pose's bone cross-data pointers... Usually, depsgraph evaluation would ensure - * this is valid, but in some cases (like hidden collections etc.) this won't be the case, so - * we need to take care of this ourselves. */ + /* Our beloved pose's bone cross-data pointers.. Usually, depsgraph evaluation would + * ensure this is valid, but in some situations (like hidden collections etc.) this won't + * be the case, so we need to take care of this ourselves. */ Object *ob_local = (Object *)local; - if (ob_local->data != NULL && ob_local->type == OB_ARMATURE && ob_local->pose != NULL && - ob_local->pose->flag & POSE_RECALC) { - BKE_pose_rebuild(bmain, ob_local, ob_local->data, true); + if (ob_local->type == OB_ARMATURE) { + Object *ob_reference = (Object *)local->override_library->reference; + BLI_assert(ob_local->data != NULL); + BLI_assert(ob_reference->data != NULL); + BKE_pose_ensure(bmain, ob_local, ob_local->data, true); + BKE_pose_ensure(bmain, ob_reference, ob_reference->data, true); } } @@ -1296,13 +1299,16 @@ bool BKE_lib_override_library_status_check_reference(Main *bmain, ID *local) } if (GS(local->name) == ID_OB) { - /* Our beloved pose's bone cross-data pointers... Usually, depsgraph evaluation would ensure - * this is valid, but in some cases (like hidden collections etc.) this won't be the case, so - * we need to take care of this ourselves. */ + /* Our beloved pose's bone cross-data pointers.. Usually, depsgraph evaluation would + * ensure this is valid, but in some situations (like hidden collections etc.) this won't + * be the case, so we need to take care of this ourselves. */ Object *ob_local = (Object *)local; - if (ob_local->data != NULL && ob_local->type == OB_ARMATURE && ob_local->pose != NULL && - ob_local->pose->flag & POSE_RECALC) { - BKE_pose_rebuild(bmain, ob_local, ob_local->data, true); + if (ob_local->type == OB_ARMATURE) { + Object *ob_reference = (Object *)local->override_library->reference; + BLI_assert(ob_local->data != NULL); + BLI_assert(ob_reference->data != NULL); + BKE_pose_ensure(bmain, ob_local, ob_local->data, true); + BKE_pose_ensure(bmain, ob_reference, ob_reference->data, true); } } @@ -1353,18 +1359,16 @@ bool BKE_lib_override_library_operations_create(Main *bmain, ID *local) } if (GS(local->name) == ID_OB) { - /* Our beloved pose's bone cross-data pointers... Usually, depsgraph evaluation would + /* Our beloved pose's bone cross-data pointers.. Usually, depsgraph evaluation would * ensure this is valid, but in some situations (like hidden collections etc.) this won't * be the case, so we need to take care of this ourselves. */ Object *ob_local = (Object *)local; - Object *ob_reference = (Object *)local->override_library->reference; - if (ob_local->data != NULL && ob_local->type == OB_ARMATURE && ob_local->pose != NULL && - ob_local->pose->flag & POSE_RECALC) { - BKE_pose_rebuild(bmain, ob_local, ob_local->data, true); - } - if (ob_reference->data != NULL && ob_reference->type == OB_ARMATURE && - ob_reference->pose != NULL && ob_reference->pose->flag & POSE_RECALC) { - BKE_pose_rebuild(bmain, ob_reference, ob_reference->data, true); + if (ob_local->type == OB_ARMATURE) { + Object *ob_reference = (Object *)local->override_library->reference; + BLI_assert(ob_local->data != NULL); + BLI_assert(ob_reference->data != NULL); + BKE_pose_ensure(bmain, ob_local, ob_local->data, true); + BKE_pose_ensure(bmain, ob_reference, ob_reference->data, true); } } @@ -1422,6 +1426,17 @@ void BKE_lib_override_library_main_operations_create(Main *bmain, const bool for BKE_lib_override_library_main_tag(bmain, IDOVERRIDE_LIBRARY_TAG_UNUSED, true); } + /* Usual pose bones issue, need to be done outside of the threaded process or we may run into + * concurency issues here. + * Note that calling #BKE_pose_ensure again in thread in + * #BKE_lib_override_library_operations_create is not a problem then.. */ + LISTBASE_FOREACH (Object *, ob, &bmain->objects) { + if (ob->type == OB_ARMATURE) { + BLI_assert(ob->data != NULL); + BKE_pose_ensure(bmain, ob, ob->data, true); + } + } + TaskPool *task_pool = BLI_task_pool_create(bmain, TASK_PRIORITY_HIGH); FOREACH_MAIN_ID_BEGIN (bmain, id) { |