mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
Fix #155723: Pasting pose not working with packed assets
When using a rig, that was imported from the asset browser using the "Packed" method, pasting a pose would fail. In that case copying the pose would store the objects of all custom bone shapes too. That means during pasting `BLI_listbase_is_single` is no longer true. The fix is to iterate all objects and check the `ID_FLAG_CLIPBOARD_MARK` flag. This will only be set on the one object that was actually directly copied, and not on its dependencies. Co-authored-by: blender <blender@MacBook-Pro-von-Thomas.local> Pull Request: https://projects.blender.org/blender/blender/pulls/155752
This commit is contained in:
parent
bcdf4fbde3
commit
dab88d61eb
1 changed files with 14 additions and 5 deletions
|
|
@ -878,13 +878,22 @@ static wmOperatorStatus pose_paste_exec(bContext *C, wmOperator *op)
|
||||||
return OPERATOR_CANCELLED;
|
return OPERATOR_CANCELLED;
|
||||||
}
|
}
|
||||||
/* Make sure data from this file is usable for pose paste. */
|
/* Make sure data from this file is usable for pose paste. */
|
||||||
if (!BLI_listbase_is_single(&temp_bmain->objects)) {
|
Object *object_from = nullptr;
|
||||||
BKE_report(op->reports, RPT_ERROR, "Internal clipboard is not from pose mode");
|
for (Object &obj : temp_bmain->objects) {
|
||||||
BKE_main_free(temp_bmain);
|
if (!(obj.id.flag & ID_FLAG_CLIPBOARD_MARK)) {
|
||||||
return OPERATOR_CANCELLED;
|
continue;
|
||||||
|
}
|
||||||
|
if (object_from != nullptr) {
|
||||||
|
/* There can only be one object in the clipboard to read the pose from. However there may be
|
||||||
|
* more than 1 object in total when dealing with packed assets and library overrides.
|
||||||
|
* See #155723. */
|
||||||
|
BKE_report(op->reports, RPT_ERROR, "Internal clipboard is not from pose mode");
|
||||||
|
BKE_main_free(temp_bmain);
|
||||||
|
return OPERATOR_CANCELLED;
|
||||||
|
}
|
||||||
|
object_from = &obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
Object *object_from = static_cast<Object *>(temp_bmain->objects.first);
|
|
||||||
bPose *pose_from = object_from->pose;
|
bPose *pose_from = object_from->pose;
|
||||||
if (pose_from == nullptr) {
|
if (pose_from == nullptr) {
|
||||||
BKE_report(op->reports, RPT_ERROR, "Internal clipboard has no pose");
|
BKE_report(op->reports, RPT_ERROR, "Internal clipboard has no pose");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue