mirror of
https://github.com/overte-org/overte.git
synced 2025-08-05 23:39:26 +02:00
Merge pull request #1465 from daleglass/fix-meshstates-assertion
Fix for _meshStates.empty() assertion.
This commit is contained in:
commit
57167cdfef
1 changed files with 18 additions and 5 deletions
|
@ -295,7 +295,20 @@ bool Model::updateGeometry() {
|
||||||
// TODO: should all Models have a valid _rig?
|
// TODO: should all Models have a valid _rig?
|
||||||
if (_rig.jointStatesEmpty() && getHFMModel().joints.size() > 0) {
|
if (_rig.jointStatesEmpty() && getHFMModel().joints.size() > 0) {
|
||||||
initJointStates();
|
initJointStates();
|
||||||
assert(_meshStates.empty());
|
|
||||||
|
if (!_meshStates.empty()) {
|
||||||
|
// See https://github.com/vircadia/vircadia/issues/958 for a discussion of the issues found here with
|
||||||
|
// a previously existing assert, and the likely reasons for things going wrong here.
|
||||||
|
//
|
||||||
|
// TL;DR: There may be a threading issue, or it could be due to something lacking joints, which would cause
|
||||||
|
// initJointStates() to fail to make _rig.jointStatesEmpty() false, causing things to end up here twice.
|
||||||
|
//
|
||||||
|
// In any case it appears to be safe to simply clear _meshStates here, even though this shouldn't happen.
|
||||||
|
_meshStates.clear();
|
||||||
|
qCWarning(renderutils) << "_meshStates has" << _meshStates.size() << "items when it should have none. Model with URL "
|
||||||
|
<< _url.toString() << "; translation" << _translation << "; rotation" << _rotation << "; scale" << _scale
|
||||||
|
<< "; joint state count" << _rig.getJointStateCount() << "; type" << (modelProviderType == NestableType::Avatar ? "Avatar" : "Entity");
|
||||||
|
}
|
||||||
|
|
||||||
const HFMModel& hfmModel = getHFMModel();
|
const HFMModel& hfmModel = getHFMModel();
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
Loading…
Reference in a new issue