mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-15 08:57:19 +02:00
load scripts once on rigReady
This commit is contained in:
parent
50ca09b3b4
commit
2ac7fcadd2
2 changed files with 9 additions and 0 deletions
|
@ -124,8 +124,14 @@ MyAvatar::MyAvatar(QThread* thread) :
|
|||
connect(_skeletonModel.get(), &Model::setURLFinished, this, [this](bool success) {
|
||||
if (success) {
|
||||
qApp->unloadAvatarScripts();
|
||||
_shouldLoadScripts = true;
|
||||
}
|
||||
});
|
||||
connect(_skeletonModel.get(), &Model::rigReady, this, [this]() {
|
||||
if (_shouldLoadScripts) {
|
||||
auto geometry = getSkeletonModel()->getFBXGeometry();
|
||||
qApp->loadAvatarScripts(geometry.scripts);
|
||||
_shouldLoadScripts = false;
|
||||
}
|
||||
});
|
||||
connect(_skeletonModel.get(), &Model::rigReady, this, &Avatar::rigReady);
|
||||
|
|
|
@ -904,6 +904,9 @@ private:
|
|||
// max unscaled forward movement speed
|
||||
ThreadSafeValueCache<float> _walkSpeed { DEFAULT_AVATAR_MAX_WALKING_SPEED };
|
||||
float _walkSpeedScalar { AVATAR_WALK_SPEED_SCALAR };
|
||||
|
||||
// load avatar scripts once when rig is ready
|
||||
bool _shouldLoadScripts { false };
|
||||
};
|
||||
|
||||
QScriptValue audioListenModeToScriptValue(QScriptEngine* engine, const AudioListenerMode& audioListenerMode);
|
||||
|
|
Loading…
Reference in a new issue