Merge pull request #7714 from hyperlogic/tony/default-anims-are-local

Avatar animations are now stored locally
This commit is contained in:
Brad Hefta-Gaub 2016-04-22 13:44:30 -07:00
commit 79a1e6264e
28 changed files with 38 additions and 49 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -145,7 +145,7 @@
"id": "rightHandGraspOpen", "id": "rightHandGraspOpen",
"type": "clip", "type": "clip",
"data": { "data": {
"url": "http://hifi-content.s3.amazonaws.com/ozan/dev/anim/standard_anims_160127/hydra_pose_open_right.fbx", "url": "animations/hydra_pose_open_right.fbx",
"startFrame": 0.0, "startFrame": 0.0,
"endFrame": 0.0, "endFrame": 0.0,
"timeScale": 1.0, "timeScale": 1.0,
@ -157,7 +157,7 @@
"id": "rightHandGraspClosed", "id": "rightHandGraspClosed",
"type": "clip", "type": "clip",
"data": { "data": {
"url": "http://hifi-content.s3.amazonaws.com/ozan/dev/anim/standard_anims_160127/hydra_pose_closed_right.fbx", "url": "animations/hydra_pose_closed_right.fbx",
"startFrame": 0.0, "startFrame": 0.0,
"endFrame": 0.0, "endFrame": 0.0,
"timeScale": 1.0, "timeScale": 1.0,
@ -205,7 +205,7 @@
"id": "leftHandGraspOpen", "id": "leftHandGraspOpen",
"type": "clip", "type": "clip",
"data": { "data": {
"url": "http://hifi-content.s3.amazonaws.com/ozan/dev/anim/standard_anims_160127/hydra_pose_open_left.fbx", "url": "animations/hydra_pose_open_left.fbx",
"startFrame": 0.0, "startFrame": 0.0,
"endFrame": 0.0, "endFrame": 0.0,
"timeScale": 1.0, "timeScale": 1.0,
@ -217,7 +217,7 @@
"id": "leftHandGraspClosed", "id": "leftHandGraspClosed",
"type": "clip", "type": "clip",
"data": { "data": {
"url": "http://hifi-content.s3.amazonaws.com/ozan/dev/anim/standard_anims_160127/hydra_pose_closed_left.fbx", "url": "animations/hydra_pose_closed_left.fbx",
"startFrame": 10.0, "startFrame": 10.0,
"endFrame": 10.0, "endFrame": 10.0,
"timeScale": 1.0, "timeScale": 1.0,
@ -495,7 +495,7 @@
"id": "idleStand", "id": "idleStand",
"type": "clip", "type": "clip",
"data": { "data": {
"url": "http://hifi-content.s3.amazonaws.com/ozan/dev/anim/standard_anims_160127/idle.fbx", "url": "animations/idle.fbx",
"startFrame": 0.0, "startFrame": 0.0,
"endFrame": 90.0, "endFrame": 90.0,
"timeScale": 1.0, "timeScale": 1.0,
@ -507,7 +507,7 @@
"id": "idleTalk", "id": "idleTalk",
"type": "clip", "type": "clip",
"data": { "data": {
"url": "http://hifi-content.s3.amazonaws.com/ozan/dev/anim/standard_anims_160127/talk.fbx", "url": "animations/talk.fbx",
"startFrame": 0.0, "startFrame": 0.0,
"endFrame": 801.0, "endFrame": 801.0,
"timeScale": 1.0, "timeScale": 1.0,
@ -532,7 +532,7 @@
"id": "walkFwdShort", "id": "walkFwdShort",
"type": "clip", "type": "clip",
"data": { "data": {
"url": "http://hifi-content.s3.amazonaws.com/ozan/dev/anim/standard_anims_160127/walk_short_fwd.fbx", "url": "animations/walk_short_fwd.fbx",
"startFrame": 0.0, "startFrame": 0.0,
"endFrame": 39.0, "endFrame": 39.0,
"timeScale": 1.0, "timeScale": 1.0,
@ -544,7 +544,7 @@
"id": "walkFwdNormal", "id": "walkFwdNormal",
"type": "clip", "type": "clip",
"data": { "data": {
"url": "http://hifi-content.s3.amazonaws.com/ozan/dev/anim/standard_anims_160127/walk_fwd.fbx", "url": "animations/walk_fwd.fbx",
"startFrame": 0.0, "startFrame": 0.0,
"endFrame": 35.0, "endFrame": 35.0,
"timeScale": 1.0, "timeScale": 1.0,
@ -556,7 +556,7 @@
"id": "walkFwdRun", "id": "walkFwdRun",
"type": "clip", "type": "clip",
"data": { "data": {
"url": "http://hifi-content.s3.amazonaws.com/ozan/dev/anim/standard_anims_160127/run_fwd.fbx", "url": "animations/run_fwd.fbx",
"startFrame": 0.0, "startFrame": 0.0,
"endFrame": 21.0, "endFrame": 21.0,
"timeScale": 1.0, "timeScale": 1.0,
@ -570,7 +570,7 @@
"id": "idleToWalkFwd", "id": "idleToWalkFwd",
"type": "clip", "type": "clip",
"data": { "data": {
"url": "http://hifi-content.s3.amazonaws.com/ozan/dev/anim/standard_anims_160127/idle_to_walk.fbx", "url": "animations/idle_to_walk.fbx",
"startFrame": 1.0, "startFrame": 1.0,
"endFrame": 19.0, "endFrame": 19.0,
"timeScale": 1.0, "timeScale": 1.0,
@ -593,7 +593,7 @@
"id": "walkBwdShort", "id": "walkBwdShort",
"type": "clip", "type": "clip",
"data": { "data": {
"url": "http://hifi-content.s3.amazonaws.com/ozan/dev/anim/standard_anims_160127/walk_short_bwd.fbx", "url": "animations/walk_short_bwd.fbx",
"startFrame": 0.0, "startFrame": 0.0,
"endFrame": 38.0, "endFrame": 38.0,
"timeScale": 1.0, "timeScale": 1.0,
@ -605,7 +605,7 @@
"id": "walkBwdNormal", "id": "walkBwdNormal",
"type": "clip", "type": "clip",
"data": { "data": {
"url": "http://hifi-content.s3.amazonaws.com/ozan/dev/anim/standard_anims_160127/walk_bwd.fbx", "url": "animations/walk_bwd.fbx",
"startFrame": 0.0, "startFrame": 0.0,
"endFrame": 36.0, "endFrame": 36.0,
"timeScale": 1.0, "timeScale": 1.0,
@ -619,7 +619,7 @@
"id": "turnLeft", "id": "turnLeft",
"type": "clip", "type": "clip",
"data": { "data": {
"url": "http://hifi-content.s3.amazonaws.com/ozan/dev/anim/standard_anims_160127/turn_left.fbx", "url": "animations/turn_left.fbx",
"startFrame": 0.0, "startFrame": 0.0,
"endFrame": 28.0, "endFrame": 28.0,
"timeScale": 1.0, "timeScale": 1.0,
@ -631,7 +631,7 @@
"id": "turnRight", "id": "turnRight",
"type": "clip", "type": "clip",
"data": { "data": {
"url": "http://hifi-content.s3.amazonaws.com/ozan/dev/anim/standard_anims_160127/turn_right.fbx", "url": "animations/turn_right.fbx",
"startFrame": 0.0, "startFrame": 0.0,
"endFrame": 30.0, "endFrame": 30.0,
"timeScale": 1.0, "timeScale": 1.0,
@ -654,7 +654,7 @@
"id": "strafeLeftShort", "id": "strafeLeftShort",
"type": "clip", "type": "clip",
"data": { "data": {
"url": "http://hifi-content.s3.amazonaws.com/ozan/dev/anim/standard_anims_160127/side_step_short_left.fbx", "url": "animations/side_step_short_left.fbx",
"startFrame": 0.0, "startFrame": 0.0,
"endFrame": 28.0, "endFrame": 28.0,
"timeScale": 1.0, "timeScale": 1.0,
@ -666,7 +666,7 @@
"id": "strafeLeftNormal", "id": "strafeLeftNormal",
"type": "clip", "type": "clip",
"data": { "data": {
"url": "http://hifi-content.s3.amazonaws.com/ozan/dev/anim/standard_anims_160127/side_step_left.fbx", "url": "animations/side_step_left.fbx",
"startFrame": 0.0, "startFrame": 0.0,
"endFrame": 30.0, "endFrame": 30.0,
"timeScale": 1.0, "timeScale": 1.0,
@ -691,7 +691,7 @@
"id": "strafeRightShort", "id": "strafeRightShort",
"type": "clip", "type": "clip",
"data": { "data": {
"url": "http://hifi-content.s3.amazonaws.com/ozan/dev/anim/standard_anims_160127/side_step_short_right.fbx", "url": "animations/side_step_short_right.fbx",
"startFrame": 0.0, "startFrame": 0.0,
"endFrame": 28.0, "endFrame": 28.0,
"timeScale": 1.0, "timeScale": 1.0,
@ -703,7 +703,7 @@
"id": "strafeRightNormal", "id": "strafeRightNormal",
"type": "clip", "type": "clip",
"data": { "data": {
"url": "http://hifi-content.s3.amazonaws.com/ozan/dev/anim/standard_anims_160127/side_step_right.fbx", "url": "animations/side_step_right.fbx",
"startFrame": 0.0, "startFrame": 0.0,
"endFrame": 30.0, "endFrame": 30.0,
"timeScale": 1.0, "timeScale": 1.0,
@ -717,7 +717,7 @@
"id": "fly", "id": "fly",
"type": "clip", "type": "clip",
"data": { "data": {
"url": "http://hifi-content.s3.amazonaws.com/ozan/dev/anim/standard_anims_160127/fly.fbx", "url": "animations/fly.fbx",
"startFrame": 1.0, "startFrame": 1.0,
"endFrame": 80.0, "endFrame": 80.0,
"timeScale": 1.0, "timeScale": 1.0,
@ -729,7 +729,7 @@
"id": "takeoffStand", "id": "takeoffStand",
"type": "clip", "type": "clip",
"data": { "data": {
"url": "http://hifi-content.s3.amazonaws.com/ozan/dev/anim/standard_anims_160127/jump_standing_takeoff.fbx", "url": "animations/jump_standing_takeoff.fbx",
"startFrame": 17.0, "startFrame": 17.0,
"endFrame": 25.0, "endFrame": 25.0,
"timeScale": 1.0, "timeScale": 1.0,
@ -741,7 +741,7 @@
"id": "takeoffRun", "id": "takeoffRun",
"type": "clip", "type": "clip",
"data": { "data": {
"url": "http://hifi-content.s3.amazonaws.com/ozan/dev/anim/standard_anims_160127/jump_takeoff.fbx", "url": "animations/jump_takeoff.fbx",
"startFrame": 1.0, "startFrame": 1.0,
"endFrame": 2.5, "endFrame": 2.5,
"timeScale": 0.01, "timeScale": 0.01,
@ -761,7 +761,7 @@
"id": "inAirStandPreApex", "id": "inAirStandPreApex",
"type": "clip", "type": "clip",
"data": { "data": {
"url": "http://hifi-content.s3.amazonaws.com/ozan/dev/anim/standard_anims_160127/jump_standing_apex.fbx", "url": "animations/jump_standing_apex.fbx",
"startFrame": 0.0, "startFrame": 0.0,
"endFrame": 0.0, "endFrame": 0.0,
"timeScale": 0.0, "timeScale": 0.0,
@ -773,7 +773,7 @@
"id": "inAirStandApex", "id": "inAirStandApex",
"type": "clip", "type": "clip",
"data": { "data": {
"url": "http://hifi-content.s3.amazonaws.com/ozan/dev/anim/standard_anims_160127/jump_standing_apex.fbx", "url": "animations/jump_standing_apex.fbx",
"startFrame": 1.0, "startFrame": 1.0,
"endFrame": 1.0, "endFrame": 1.0,
"timeScale": 1.0, "timeScale": 1.0,
@ -785,7 +785,7 @@
"id": "inAirStandPostApex", "id": "inAirStandPostApex",
"type": "clip", "type": "clip",
"data": { "data": {
"url": "http://hifi-content.s3.amazonaws.com/ozan/dev/anim/standard_anims_160127/jump_standing_apex.fbx", "url": "animations/jump_standing_apex.fbx",
"startFrame": 2.0, "startFrame": 2.0,
"endFrame": 2.0, "endFrame": 2.0,
"timeScale": 1.0, "timeScale": 1.0,
@ -807,7 +807,7 @@
"id": "inAirRunPreApex", "id": "inAirRunPreApex",
"type": "clip", "type": "clip",
"data": { "data": {
"url": "http://hifi-content.s3.amazonaws.com/ozan/dev/anim/standard_anims_160127/jump_in_air.fbx", "url": "animations/jump_in_air.fbx",
"startFrame": 0.0, "startFrame": 0.0,
"endFrame": 0.0, "endFrame": 0.0,
"timeScale": 0.0, "timeScale": 0.0,
@ -819,7 +819,7 @@
"id": "inAirRunApex", "id": "inAirRunApex",
"type": "clip", "type": "clip",
"data": { "data": {
"url": "http://hifi-content.s3.amazonaws.com/ozan/dev/anim/standard_anims_160127/jump_in_air.fbx", "url": "animations/jump_in_air.fbx",
"startFrame": 6.0, "startFrame": 6.0,
"endFrame": 6.0, "endFrame": 6.0,
"timeScale": 1.0, "timeScale": 1.0,
@ -831,7 +831,7 @@
"id": "inAirRunPostApex", "id": "inAirRunPostApex",
"type": "clip", "type": "clip",
"data": { "data": {
"url": "http://hifi-content.s3.amazonaws.com/ozan/dev/anim/standard_anims_160127/jump_in_air.fbx", "url": "animations/jump_in_air.fbx",
"startFrame": 11.0, "startFrame": 11.0,
"endFrame": 11.0, "endFrame": 11.0,
"timeScale": 1.0, "timeScale": 1.0,
@ -845,7 +845,7 @@
"id": "landStandImpact", "id": "landStandImpact",
"type": "clip", "type": "clip",
"data": { "data": {
"url": "https://hifi-content.s3.amazonaws.com/ozan/dev/anim/standard_anims_160127/jump_standing_land.fbx", "url": "animations/jump_standing_land.fbx",
"startFrame": 1.0, "startFrame": 1.0,
"endFrame": 6.0, "endFrame": 6.0,
"timeScale": 1.0, "timeScale": 1.0,
@ -857,7 +857,7 @@
"id": "landStand", "id": "landStand",
"type": "clip", "type": "clip",
"data": { "data": {
"url": "https://hifi-content.s3.amazonaws.com/ozan/dev/anim/standard_anims_160127/jump_standing_land.fbx", "url": "animations/jump_standing_land.fbx",
"startFrame": 6.0, "startFrame": 6.0,
"endFrame": 28.0, "endFrame": 28.0,
"timeScale": 1.0, "timeScale": 1.0,
@ -869,7 +869,7 @@
"id": "landRun", "id": "landRun",
"type": "clip", "type": "clip",
"data": { "data": {
"url": "https://hifi-content.s3.amazonaws.com/ozan/dev/anim/standard_anims_160127/jump_land.fbx", "url": "animations/jump_land.fbx",
"startFrame": 1.0, "startFrame": 1.0,
"endFrame": 6.0, "endFrame": 6.0,
"timeScale": 0.65, "timeScale": 0.65,
@ -891,7 +891,7 @@
"id": "userAnimA", "id": "userAnimA",
"type": "clip", "type": "clip",
"data": { "data": {
"url": "http://hifi-content.s3.amazonaws.com/ozan/dev/anim/standard_anims_160127/idle.fbx", "url": "animations/idle.fbx",
"startFrame": 0.0, "startFrame": 0.0,
"endFrame": 90.0, "endFrame": 90.0,
"timeScale": 1.0, "timeScale": 1.0,
@ -903,7 +903,7 @@
"id": "userAnimB", "id": "userAnimB",
"type": "clip", "type": "clip",
"data": { "data": {
"url": "http://hifi-content.s3.amazonaws.com/ozan/dev/anim/standard_anims_160127/idle.fbx", "url": "animations/idle.fbx",
"startFrame": 0.0, "startFrame": 0.0,
"endFrame": 90.0, "endFrame": 90.0,
"timeScale": 1.0, "timeScale": 1.0,

View file

@ -1323,23 +1323,8 @@ void MyAvatar::setAnimGraphUrl(const QUrl& url) {
} }
void MyAvatar::initAnimGraph() { void MyAvatar::initAnimGraph() {
// avatar.json
// https://gist.github.com/hyperlogic/7d6a0892a7319c69e2b9
//
// ik-avatar.json
// https://gist.github.com/hyperlogic/e58e0a24cc341ad5d060
//
// ik-avatar-hands.json
// https://gist.githubusercontent.com/hyperlogic/04a02c47eb56d8bfaebb
//
// ik-avatar-hands-idle.json
// https://gist.githubusercontent.com/hyperlogic/d951c78532e7a20557ad
//
// or run a local web-server
// python -m SimpleHTTPServer&
//auto graphUrl = QUrl("http://localhost:8000/avatar.json");
auto graphUrl =_animGraphUrl.isEmpty() ? auto graphUrl =_animGraphUrl.isEmpty() ?
QUrl::fromLocalFile(PathUtils::resourcesPath() + "meshes/defaultAvatar_full/avatar-animation.json") : QUrl::fromLocalFile(PathUtils::resourcesPath() + "avatar/avatar-animation.json") :
QUrl(_animGraphUrl); QUrl(_animGraphUrl);
_rig->initAnimGraph(graphUrl); _rig->initAnimGraph(graphUrl);

View file

@ -248,7 +248,11 @@ static AnimNode::Pointer loadClipNode(const QJsonObject& jsonObj, const QString&
READ_OPTIONAL_STRING(loopFlagVar, jsonObj); READ_OPTIONAL_STRING(loopFlagVar, jsonObj);
READ_OPTIONAL_STRING(mirrorFlagVar, jsonObj); READ_OPTIONAL_STRING(mirrorFlagVar, jsonObj);
auto node = std::make_shared<AnimClip>(id, url, startFrame, endFrame, timeScale, loopFlag, mirrorFlag); // animation urls can be relative to the containing url document.
auto tempUrl = QUrl(url);
tempUrl = jsonUrl.resolved(tempUrl);
auto node = std::make_shared<AnimClip>(id, tempUrl.toString(), startFrame, endFrame, timeScale, loopFlag, mirrorFlag);
if (!startFrameVar.isEmpty()) { if (!startFrameVar.isEmpty()) {
node->setStartFrameVar(startFrameVar); node->setStartFrameVar(startFrameVar);