Merge pull request #11829 from sethalves/av-ent-misc-fixes

misc avatar-entity fixes
This commit is contained in:
Brad Hefta-Gaub 2017-11-20 16:05:39 -08:00 committed by GitHub
commit 50ff782ab5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 6 deletions

View file

@ -5503,6 +5503,8 @@ void Application::clearDomainOctreeDetails() {
DependencyManager::get<ModelCache>()->clearUnusedResources();
DependencyManager::get<SoundCache>()->clearUnusedResources();
DependencyManager::get<TextureCache>()->clearUnusedResources();
getMyAvatar()->setAvatarEntityDataChanged(true);
}
void Application::clearDomainAvatars() {

View file

@ -951,11 +951,7 @@ void MyAvatar::saveData() {
}
settings.endArray();
if (_avatarEntityData.size() == 0) {
// HACK: manually remove empty 'avatarEntityData' else deleted avatarEntityData may show up in settings file
settings.remove("avatarEntityData");
}
settings.remove("avatarEntityData");
settings.beginWriteArray("avatarEntityData");
int avatarEntityIndex = 0;
auto hmdInterface = DependencyManager::get<HMDScriptingInterface>();

View file

@ -198,6 +198,11 @@ void Avatar::setTargetScale(float targetScale) {
}
}
void Avatar::setAvatarEntityDataChanged(bool value) {
AvatarData::setAvatarEntityDataChanged(value);
_avatarEntityDataHashes.clear();
}
void Avatar::updateAvatarEntities() {
PerformanceTimer perfTimer("attachments");
// - if queueEditEntityMessage sees clientOnly flag it does _myAvatar->updateAvatarEntity()

View file

@ -265,6 +265,8 @@ public:
virtual float getModelScale() const { return _modelScale; }
virtual void setModelScale(float scale) { _modelScale = scale; }
virtual void setAvatarEntityDataChanged(bool value) override;
public slots:
// FIXME - these should be migrated to use Pose data instead

View file

@ -603,7 +603,7 @@ public:
Q_INVOKABLE AvatarEntityMap getAvatarEntityData() const;
Q_INVOKABLE void setAvatarEntityData(const AvatarEntityMap& avatarEntityData);
void setAvatarEntityDataChanged(bool value) { _avatarEntityDataChanged = value; }
virtual void setAvatarEntityDataChanged(bool value) { _avatarEntityDataChanged = value; }
void insertDetachedEntityID(const QUuid entityID);
AvatarEntityIDs getAndClearRecentlyDetachedIDs();