fix stats + waitForWearables

This commit is contained in:
HifiExperiments 2024-08-19 14:17:20 -07:00
parent e9831d9f22
commit 3d97f7845b
4 changed files with 15 additions and 11 deletions

View file

@ -243,7 +243,7 @@ Item {
visible: root.expanded;
text: (modelData.length > 30
? modelData.substring(0, 5) + "..." + modelData.substring(modelData.length - 22)
: modelData) + "\n\t" + "Priority: " + root.downloadPriorities[index] + ", Progress: " + root.downloadProgresses[index] + "%"
: modelData) + "\n\t" + (!isNaN(root.downloadPriorities[index]) ? ("Priority: " + root.downloadPriorities[index] + ", ") : "") + "Progress: " + root.downloadProgresses[index] + "%"
}
}
}

View file

@ -313,7 +313,7 @@ Item {
visible: root.expanded;
text: (modelData.length > 30
? modelData.substring(0, 5) + "..." + modelData.substring(modelData.length - 22)
: modelData) + "\n\t" + "Priority: " + root.downloadPriorities[index] + ", Progress: " + root.downloadProgresses[index] + "%"
: modelData) + "\n\t" + (!isNaN(root.downloadPriorities[index]) ? ("Priority: " + root.downloadPriorities[index] + ", ") : "") + "Progress: " + root.downloadProgresses[index] + "%"
}
}
}

View file

@ -58,7 +58,7 @@ namespace render {
template <> const ItemKey payloadGetKey(const AvatarSharedPointer& avatar) {
ItemKey::Builder keyBuilder = ItemKey::Builder::opaqueShape().withTypeMeta().withTagBits(render::hifi::TAG_ALL_VIEWS).withMetaCullGroup();
auto avatarPtr = static_pointer_cast<Avatar>(avatar);
if (!avatarPtr->getEnableMeshVisible()) {
if (!avatarPtr->shouldRender()) {
keyBuilder.withInvisible();
}
return keyBuilder.build();
@ -648,7 +648,7 @@ void Avatar::addToScene(AvatarSharedPointer self, const render::ScenePointer& sc
_skeletonModel->setTagMask(render::hifi::TAG_ALL_VIEWS);
_skeletonModel->setGroupCulled(true);
_skeletonModel->setCanCastShadow(true);
_skeletonModel->setVisibleInScene(_isMeshVisible, scene);
_skeletonModel->setVisibleInScene(shouldRender(), scene);
processMaterials();
@ -855,7 +855,10 @@ void Avatar::fixupModelsInScene(const render::ScenePointer& scene) {
}
}
});
setEnableMeshVisible(_isMeshVisible || wearablesAreLoaded);
_isReadyToDraw = wearablesAreLoaded;
if (_isReadyToDraw) {
_needMeshVisibleSwitch = true;
}
_needsWearablesLoadedCheck = !wearablesAreLoaded;
}
@ -871,7 +874,7 @@ void Avatar::fixupModelsInScene(const render::ScenePointer& scene) {
_skeletonModel->setTagMask(render::hifi::TAG_ALL_VIEWS);
_skeletonModel->setGroupCulled(true);
_skeletonModel->setCanCastShadow(true);
_skeletonModel->setVisibleInScene(_isMeshVisible, scene);
_skeletonModel->setVisibleInScene(shouldRender(), scene);
processMaterials();
canTryFade = true;
@ -879,7 +882,7 @@ void Avatar::fixupModelsInScene(const render::ScenePointer& scene) {
}
if (_needMeshVisibleSwitch) {
_skeletonModel->setVisibleInScene(_isMeshVisible, scene);
_skeletonModel->setVisibleInScene(shouldRender(), scene);
updateRenderItem(transaction);
_needMeshVisibleSwitch = false;
}
@ -1502,11 +1505,9 @@ void Avatar::rigReady() {
setSkeletonData(getSkeletonDefaultData());
sendSkeletonData();
const bool prevNeedsWearablesLoadedCheck = _needsWearablesLoadedCheck;
_needsWearablesLoadedCheck = _skeletonModel && _skeletonModel->isLoaded() && _skeletonModel->getGeometry()->shouldWaitForWearables();
if (prevNeedsWearablesLoadedCheck != _needsWearablesLoadedCheck) {
setEnableMeshVisible(!_needsWearablesLoadedCheck);
}
_needMeshVisibleSwitch = (_isReadyToDraw != !_needsWearablesLoadedCheck);
_isReadyToDraw = !_needsWearablesLoadedCheck;
}
// rig has been reset.

View file

@ -554,6 +554,8 @@ public:
uint32_t appendSubMetaItems(render::ItemIDs& subItems);
virtual bool shouldRender() const { return _isMeshVisible && _isReadyToDraw; }
static const float MYAVATAR_ENTITY_LOADING_PRIORITY;
static const float OTHERAVATAR_ENTITY_LOADING_PRIORITY;
@ -747,6 +749,7 @@ protected:
AABox _renderBound;
bool _isMeshVisible { true };
bool _needMeshVisibleSwitch { true };
bool _isReadyToDraw { false };
bool _needsWearablesLoadedCheck { false };
bool _hasCheckedForAvatarEntities { false };