Merge branch 'blender-v2.91-release' into master
Conflicts: source/blender/blenkernel/intern/armature.c
This commit is contained in:
commit
a207fb7ea7
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue