WARNING protocol change: Transmit joint translation


#1

What dos this mean? All my posescripts don’t work more with build mac3138.


#2

Hi @summer4me… in the latest update the engineers moved the default avatar to, “Enable Anim Graph” from “Enable Rig Animations”. They are still working on moving over some of the capabilities. If you switch back to Enable Rig Animations your scripts should work.


#3

Thanks @Chris and well they also with Enable Rig Animations don’t work. The functions MyAvatar.setJointData has changed. I get Debug errors with MyAvatar.setJointData(pose[posejoint].joint, Quat.fromVec3Degrees( rot ));

It seems, that there are now needed more parameters and the translation also must be set in the function - MyAvatar.setJointData(QString,glm::quat,glm::vec3) setJointData(int,glm::quat,glm::vec3)
I have tried with MyAvatar.setJointData(pose[posejoint].joint, Quat.fromVec3Degrees( rot ),trans);

But this until now also has not worked.


#4

The scripts don’t work until now. I could need some information about the new animation system.
Are there working examples?


#5

Hi @summer4me… Do you have a script that you could share with me?


#6

This is one script which all users have gotten, when they are come to MagicGame. It has worked for other users too before the update.
https://dl.dropboxusercontent.com/u/48725104/Pose.js

It dos bring now debug errors.
You get a button at the bottom of the screen. Click at the button and the buttons of the different poses are opened. If you click at one, the pose should be activated.


#7

I see indeed errors too, it worked for me before. You now get teleported to the sit. but that’s all. No animation.

[DEBUG] [10/06 21:16:56] Uncaught exception at ( “https://dl.dropboxusercontent.com/u/48725104/Pose.js” ) line 600 : “SyntaxError: too few arguments in call to setJointData(); candidates are
setJointData(QString,glm::quat,glm::vec3)
setJointData(int,glm::quat,glm::vec3)”


#8

I also have changed the script, how in the candidates in the debug message was written. Then the debug messages were gone, but the animation also has not worked.


#9

@chris, @ozan I don’t know, who is part of the animation team. The functions don’t work until now and I don’t get some response.

What I have seen in MyAvatar.cpp
void MyAvatar::setJointData(int index, const glm::quat& rotation, const glm::vec3& translation) {
if (QThread::currentThread() == thread()) {
// HACK: ATM only JS scripts call setJointData() on MyAvatar so we hardcode the priority
_rig->setJointState(index, true, rotation, translation, SCRIPT_PRIORITY);
}
}

There is a priority set in the function SCRIPT_PRIORITY. It is lower than the RECORDER_PRIORITY, which is used in the functions:

void MyAvatar::setJointRotations(QVectorglm::quat jointRotations) {
int numStates = glm::min(_skeletonModel.getJointStateCount(), jointRotations.size());
for (int i = 0; i < numStates; ++i) {
// HACK: ATM only Recorder calls setJointRotations() so we hardcode its priority here
_skeletonModel.setJointRotation(i, true, jointRotations[i], RECORDER_PRIORITY);
}
}

void MyAvatar::setJointTranslations(QVectorglm::vec3 jointTranslations) {
int numStates = glm::min(_skeletonModel.getJointStateCount(), jointTranslations.size());
for (int i = 0; i < numStates; ++i) {
// HACK: ATM only Recorder calls setJointTranslations() so we hardcode its priority here
_skeletonModel.setJointTranslation(i, true, jointTranslations[i], RECORDER_PRIORITY);
}
}

Could this be the reason, why the script data are not set?