mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
Remove all .fst downloads from AvatarData and its derived classes
This commit is contained in:
parent
9315c546d3
commit
eb097af796
5 changed files with 0 additions and 100 deletions
|
@ -77,10 +77,6 @@ static AnimPose composeAnimPose(const HFMJoint& joint, const glm::quat rotation,
|
|||
}
|
||||
|
||||
void ScriptableAvatar::update(float deltatime) {
|
||||
if (_bind.isNull() && !_skeletonFBXURL.isEmpty()) { // AvatarData will parse the .fst, but not get the .fbx skeleton.
|
||||
_bind = DependencyManager::get<AnimationCache>()->getAnimation(_skeletonFBXURL);
|
||||
}
|
||||
|
||||
// Run animation
|
||||
if (_animation && _animation->isLoaded() && _animation->getFrames().size() > 0 && !_bind.isNull() && _bind->isLoaded()) {
|
||||
if (!_animSkeleton) {
|
||||
|
|
|
@ -1894,34 +1894,6 @@ QList<QVariant> Avatar::getSkeleton() {
|
|||
return QList<QVariant>();
|
||||
}
|
||||
|
||||
void Avatar::updateJointMappings() {
|
||||
{
|
||||
QWriteLocker writeLock(&_jointDataLock);
|
||||
_fstJointIndices.clear();
|
||||
_fstJointNames.clear();
|
||||
_jointData.clear();
|
||||
}
|
||||
|
||||
//if (_skeletonModelURL.fileName().toLower().endsWith(".fst")) {
|
||||
// ////
|
||||
// // TODO: Should we rely upon HTTPResourceRequest for ResourceRequestObserver instead?
|
||||
// // HTTPResourceRequest::doSend() covers all of the following and
|
||||
// // then some. It doesn't cover the connect() call, so we may
|
||||
// // want to add a HTTPResourceRequest::doSend() method that does
|
||||
// // connects.
|
||||
// QNetworkAccessManager& networkAccessManager = NetworkAccessManager::getInstance();
|
||||
// QNetworkRequest networkRequest = QNetworkRequest(_skeletonModelURL);
|
||||
// networkRequest.setAttribute(QNetworkRequest::FollowRedirectsAttribute, true);
|
||||
// networkRequest.setHeader(QNetworkRequest::UserAgentHeader, HIGH_FIDELITY_USER_AGENT);
|
||||
// DependencyManager::get<ResourceRequestObserver>()->update(
|
||||
// _skeletonModelURL, -1, "AvatarData::updateJointMappings");
|
||||
// QNetworkReply* networkReply = networkAccessManager.get(networkRequest);
|
||||
// //
|
||||
// ////
|
||||
// connect(networkReply, &QNetworkReply::finished, this, &AvatarData::setJointMappingsFromNetworkReply);
|
||||
//}
|
||||
}
|
||||
|
||||
void Avatar::addToScene(AvatarSharedPointer myHandle, const render::ScenePointer& scene) {
|
||||
if (scene) {
|
||||
auto nodelist = DependencyManager::get<NodeList>();
|
||||
|
|
|
@ -516,9 +516,6 @@ protected:
|
|||
mutable QReadWriteLock _modelJointIndicesCacheLock;
|
||||
mutable bool _modelJointsCached { false };
|
||||
|
||||
/// Loads the joint indices, names from the FST file (if any)
|
||||
virtual void updateJointMappings() override;
|
||||
|
||||
glm::vec3 _skeletonOffset;
|
||||
std::vector<std::shared_ptr<Model>> _attachmentModels;
|
||||
std::vector<bool> _attachmentModelsTexturesLoaded;
|
||||
|
|
|
@ -2000,8 +2000,6 @@ void AvatarData::setSkeletonModelURL(const QUrl& skeletonModelURL) {
|
|||
|
||||
_skeletonModelURL = expanded;
|
||||
|
||||
updateJointMappings();
|
||||
|
||||
if (_clientTraitsHandler) {
|
||||
_clientTraitsHandler->markTraitUpdated(AvatarTraits::SkeletonModelURL);
|
||||
}
|
||||
|
@ -2097,57 +2095,6 @@ void AvatarData::detachAll(const QString& modelURL, const QString& jointName) {
|
|||
setAttachmentData(attachmentData);
|
||||
}
|
||||
|
||||
void AvatarData::setJointMappingsFromNetworkReply() {
|
||||
|
||||
QNetworkReply* networkReply = static_cast<QNetworkReply*>(sender());
|
||||
|
||||
// before we process this update, make sure that the skeleton model URL hasn't changed
|
||||
// since we made the FST request
|
||||
if (networkReply->url() != _skeletonModelURL) {
|
||||
qCDebug(avatars) << "Refusing to set joint mappings for FST URL that does not match the current URL";
|
||||
return;
|
||||
}
|
||||
|
||||
{
|
||||
QWriteLocker writeLock(&_jointDataLock);
|
||||
QByteArray line;
|
||||
while (!(line = networkReply->readLine()).isEmpty()) {
|
||||
line = line.trimmed();
|
||||
if (line.startsWith("filename")) {
|
||||
int filenameIndex = line.indexOf('=') + 1;
|
||||
if (filenameIndex > 0) {
|
||||
_skeletonFBXURL = _skeletonModelURL.resolved(QString(line.mid(filenameIndex).trimmed()));
|
||||
}
|
||||
}
|
||||
if (!line.startsWith("jointIndex")) {
|
||||
continue;
|
||||
}
|
||||
int jointNameIndex = line.indexOf('=') + 1;
|
||||
if (jointNameIndex == 0) {
|
||||
continue;
|
||||
}
|
||||
int secondSeparatorIndex = line.indexOf('=', jointNameIndex);
|
||||
if (secondSeparatorIndex == -1) {
|
||||
continue;
|
||||
}
|
||||
QString jointName = line.mid(jointNameIndex, secondSeparatorIndex - jointNameIndex).trimmed();
|
||||
bool ok;
|
||||
int jointIndex = line.mid(secondSeparatorIndex + 1).trimmed().toInt(&ok);
|
||||
if (ok) {
|
||||
while (_fstJointNames.size() < jointIndex + 1) {
|
||||
_fstJointNames.append(QString());
|
||||
}
|
||||
_fstJointNames[jointIndex] = jointName;
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < _fstJointNames.size(); i++) {
|
||||
_fstJointIndices.insert(_fstJointNames.at(i), i + 1);
|
||||
}
|
||||
}
|
||||
|
||||
networkReply->deleteLater();
|
||||
}
|
||||
|
||||
void AvatarData::sendAvatarDataPacket(bool sendAll) {
|
||||
auto nodeList = DependencyManager::get<NodeList>();
|
||||
|
||||
|
@ -2209,9 +2156,6 @@ void AvatarData::sendIdentityPacket() {
|
|||
_identityDataChanged = false;
|
||||
}
|
||||
|
||||
void AvatarData::updateJointMappings()
|
||||
{ }
|
||||
|
||||
static const QString JSON_ATTACHMENT_URL = QStringLiteral("modelUrl");
|
||||
static const QString JSON_ATTACHMENT_JOINT_NAME = QStringLiteral("jointName");
|
||||
static const QString JSON_ATTACHMENT_TRANSFORM = QStringLiteral("transform");
|
||||
|
|
|
@ -1269,11 +1269,6 @@ public slots:
|
|||
*/
|
||||
void sendIdentityPacket();
|
||||
|
||||
/**jsdoc
|
||||
* @function MyAvatar.setJointMappingsFromNetworkReply
|
||||
*/
|
||||
void setJointMappingsFromNetworkReply();
|
||||
|
||||
/**jsdoc
|
||||
* @function MyAvatar.setSessionUUID
|
||||
* @param {Uuid} sessionUUID
|
||||
|
@ -1376,7 +1371,6 @@ protected:
|
|||
mutable HeadData* _headData { nullptr };
|
||||
|
||||
QUrl _skeletonModelURL;
|
||||
QUrl _skeletonFBXURL;
|
||||
QVector<AttachmentData> _attachmentData;
|
||||
QVector<AttachmentData> _oldAttachmentData;
|
||||
QString _displayName;
|
||||
|
@ -1390,9 +1384,6 @@ protected:
|
|||
|
||||
QWeakPointer<Node> _owningAvatarMixer;
|
||||
|
||||
/// Loads the joint indices, names from the FST file (if any)
|
||||
virtual void updateJointMappings();
|
||||
|
||||
glm::vec3 _targetVelocity;
|
||||
|
||||
SimpleMovingAverage _averageBytesReceived;
|
||||
|
|
Loading…
Reference in a new issue