mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-05 06:05:31 +02:00
Make MyAvatar.get/setAnimGraphUrl take a url(!), and make setting it
actually do something.
This commit is contained in:
parent
e0ca1c0f4c
commit
1b42c5a172
3 changed files with 19 additions and 7 deletions
|
@ -1283,6 +1283,15 @@ void MyAvatar::initHeadBones() {
|
|||
}
|
||||
}
|
||||
|
||||
void MyAvatar::setAnimGraphUrl(const QUrl& url) {
|
||||
if (_animGraphUrl == url) {
|
||||
return;
|
||||
}
|
||||
destroyAnimGraph();
|
||||
_animGraphUrl = url;
|
||||
initAnimGraph();
|
||||
}
|
||||
|
||||
void MyAvatar::initAnimGraph() {
|
||||
// avatar.json
|
||||
// https://gist.github.com/hyperlogic/7d6a0892a7319c69e2b9
|
||||
|
@ -1299,16 +1308,19 @@ void MyAvatar::initAnimGraph() {
|
|||
// or run a local web-server
|
||||
// python -m SimpleHTTPServer&
|
||||
//auto graphUrl = QUrl("http://localhost:8000/avatar.json");
|
||||
auto graphUrl = QUrl(_animGraphUrl.isEmpty() ?
|
||||
QUrl::fromLocalFile(PathUtils::resourcesPath() + "meshes/defaultAvatar_full/avatar-animation.json") :
|
||||
_animGraphUrl);
|
||||
auto graphUrl =_animGraphUrl.isEmpty() ?
|
||||
QUrl::fromLocalFile(PathUtils::resourcesPath() + "meshes/defaultAvatar_full/avatar-animation.json") :
|
||||
QUrl(_animGraphUrl);
|
||||
qCDebug(interfaceapp) << "*** FIXME initAnimGraph" << graphUrl.toString();
|
||||
_rig->initAnimGraph(graphUrl);
|
||||
|
||||
_bodySensorMatrix = deriveBodyFromHMDSensor(); // Based on current cached HMD position/rotation..
|
||||
updateSensorToWorldMatrix(); // Uses updated position/orientation and _bodySensorMatrix changes
|
||||
qCDebug(interfaceapp) << "*** FIXME initAnimGraph ready" << graphUrl.toString();
|
||||
}
|
||||
|
||||
void MyAvatar::destroyAnimGraph() {
|
||||
qCDebug(interfaceapp) << "*** FIXME destroyAnimGraph" << _animGraphUrl.toString();
|
||||
_rig->destroyAnimGraph();
|
||||
}
|
||||
|
||||
|
|
|
@ -253,13 +253,13 @@ public slots:
|
|||
|
||||
virtual void rebuildSkeletonBody() override;
|
||||
|
||||
const QString& getAnimGraphUrl() const { return _animGraphUrl; }
|
||||
Q_INVOKABLE QUrl getAnimGraphUrl() const { return _animGraphUrl; }
|
||||
|
||||
void setEnableDebugDrawDefaultPose(bool isEnabled);
|
||||
void setEnableDebugDrawAnimPose(bool isEnabled);
|
||||
void setEnableDebugDrawPosition(bool isEnabled);
|
||||
void setEnableMeshVisible(bool isEnabled);
|
||||
void setAnimGraphUrl(const QString& url) { _animGraphUrl = url; }
|
||||
Q_INVOKABLE void setAnimGraphUrl(const QUrl& url);
|
||||
|
||||
glm::vec3 getPositionForAudio();
|
||||
glm::quat getOrientationForAudio();
|
||||
|
@ -360,7 +360,7 @@ private:
|
|||
// Avatar Preferences
|
||||
QUrl _fullAvatarURLFromPreferences;
|
||||
QString _fullAvatarModelName;
|
||||
QString _animGraphUrl {""};
|
||||
QUrl _animGraphUrl {""};
|
||||
|
||||
// cache of the current HMD sensor position and orientation
|
||||
// in sensor space.
|
||||
|
|
|
@ -190,7 +190,7 @@ void PreferencesDialog::loadPreferences() {
|
|||
ui.leanScaleSpin->setValue(myAvatar->getLeanScale());
|
||||
|
||||
ui.avatarScaleSpin->setValue(myAvatar->getScale());
|
||||
ui.avatarAnimationEdit->setText(myAvatar->getAnimGraphUrl());
|
||||
ui.avatarAnimationEdit->setText(myAvatar->getAnimGraphUrl().toString());
|
||||
|
||||
ui.maxOctreePPSSpin->setValue(qApp->getMaxOctreePacketsPerSecond());
|
||||
|
||||
|
|
Loading…
Reference in a new issue