mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-19 10:18:43 +02:00
Merge pull request #10474 from ctrlaltdavid/21346
Fix recording playback not clearing attachments and nametags
This commit is contained in:
commit
12aa354ddd
1 changed files with 9 additions and 5 deletions
|
@ -2052,11 +2052,13 @@ void AvatarData::fromJson(const QJsonObject& json, bool useFrameSkeleton) {
|
|||
setSkeletonModelURL(bodyModelURL);
|
||||
}
|
||||
}
|
||||
|
||||
QString newDisplayName = "";
|
||||
if (json.contains(JSON_AVATAR_DISPLAY_NAME)) {
|
||||
auto newDisplayName = json[JSON_AVATAR_DISPLAY_NAME].toString();
|
||||
if (newDisplayName != getDisplayName()) {
|
||||
setDisplayName(newDisplayName);
|
||||
}
|
||||
newDisplayName = json[JSON_AVATAR_DISPLAY_NAME].toString();
|
||||
}
|
||||
if (newDisplayName != getDisplayName()) {
|
||||
setDisplayName(newDisplayName);
|
||||
}
|
||||
|
||||
auto currentBasis = getRecordingBasis();
|
||||
|
@ -2086,14 +2088,16 @@ void AvatarData::fromJson(const QJsonObject& json, bool useFrameSkeleton) {
|
|||
setTargetScale((float)json[JSON_AVATAR_SCALE].toDouble());
|
||||
}
|
||||
|
||||
QVector<AttachmentData> attachments;
|
||||
if (json.contains(JSON_AVATAR_ATTACHMENTS) && json[JSON_AVATAR_ATTACHMENTS].isArray()) {
|
||||
QJsonArray attachmentsJson = json[JSON_AVATAR_ATTACHMENTS].toArray();
|
||||
QVector<AttachmentData> attachments;
|
||||
for (auto attachmentJson : attachmentsJson) {
|
||||
AttachmentData attachment;
|
||||
attachment.fromJson(attachmentJson.toObject());
|
||||
attachments.push_back(attachment);
|
||||
}
|
||||
}
|
||||
if (attachments != getAttachmentData()) {
|
||||
setAttachmentData(attachments);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue