168 lines
8.1 KiB
HTML
168 lines
8.1 KiB
HTML
<html>
|
|
<head>
|
|
<link rel="stylesheet" type="text/css" href="walkToolsStyle.css">
|
|
<script>
|
|
|
|
function loaded() {
|
|
// assign form elements to vars
|
|
var _loadURLBVHButton = document.getElementById("load-url-bvh");
|
|
var _loadTStanceBVHButton = document.getElementById("load-t-stance-bvh");
|
|
var _loadWalkBVHButton = document.getElementById("load-walk-bvh");
|
|
var _loadDanceBVHButton = document.getElementById("load-dance-bvh");
|
|
var _loadIdleBVHButton = document.getElementById("load-idle-bvh");
|
|
var _exportButton = document.getElementById("export-animation");
|
|
|
|
var _playBVHFasterButton = document.getElementById("play-bvh-faster");
|
|
var _playBVHSlowerButton = document.getElementById("play-bvh-slower");
|
|
var _stopButton = document.getElementById("stop-bvh");
|
|
var _bvhFileURL = document.getElementById("bvh-url");
|
|
var _bvhLoaderInfo = document.getElementById("bvh-loader-info");
|
|
|
|
_playBVHFasterButton.disabled = true;
|
|
_playBVHSlowerButton.disabled = true;
|
|
|
|
// then just a load of event listeners...
|
|
_loadURLBVHButton.addEventListener("click", function() {
|
|
_playBVHFasterButton.disabled = true;
|
|
_playBVHSlowerButton.disabled = true;
|
|
EventBridge.emitWebEvent(JSON.stringify({
|
|
type: "bvhPlayerEvent",
|
|
action: "openBVHFile",
|
|
url: _bvhFileURL.value
|
|
}));
|
|
_bvhLoaderInfo.innerHTML = "Loading from URL";
|
|
});
|
|
|
|
_loadWalkBVHButton.addEventListener("click", function() {
|
|
_playBVHFasterButton.disabled = true;
|
|
_playBVHSlowerButton.disabled = true;
|
|
EventBridge.emitWebEvent(JSON.stringify({
|
|
type: "bvhPlayerEvent",
|
|
action: "openBVHFile",
|
|
url: "https://s3-us-west-2.amazonaws.com/davedub/high-fidelity/bvh/walk_fwd_fbx_2009_70-128.bvh"
|
|
}));
|
|
_bvhLoaderInfo.innerHTML = "Loading male walk";
|
|
});
|
|
|
|
_loadTStanceBVHButton.addEventListener("click", function() {
|
|
_playBVHFasterButton.disabled = true;
|
|
_playBVHSlowerButton.disabled = true;
|
|
EventBridge.emitWebEvent(JSON.stringify({
|
|
type: "bvhPlayerEvent",
|
|
action: "openBVHFile",
|
|
url: "https://s3-us-west-2.amazonaws.com/davedub/high-fidelity/bvh/bind_pose_no_pre_rotations.bvh"
|
|
}));
|
|
_bvhLoaderInfo.innerHTML = "Loading t-stance";
|
|
});
|
|
|
|
_loadDanceBVHButton.addEventListener("click", function() {
|
|
_playBVHFasterButton.disabled = true;
|
|
_playBVHSlowerButton.disabled = true;
|
|
EventBridge.emitWebEvent(JSON.stringify({
|
|
type: "bvhPlayerEvent",
|
|
action: "openBVHFile",
|
|
url: "https://s3-us-west-2.amazonaws.com/davedub/high-fidelity/bvh/standard_walk_backwards_no_pre_rotations.bvh"
|
|
}));
|
|
_bvhLoaderInfo.innerHTML = "Loading dance";
|
|
});
|
|
|
|
_loadIdleBVHButton.addEventListener("click", function() {
|
|
_playBVHFasterButton.disabled = true;
|
|
_playBVHSlowerButton.disabled = true;
|
|
EventBridge.emitWebEvent(JSON.stringify({
|
|
type: "bvhPlayerEvent",
|
|
action: "openBVHFile",
|
|
url: "https://s3-us-west-2.amazonaws.com/davedub/high-fidelity/bvh/idle_fbx_2009_181-256.bvh"
|
|
}));
|
|
_bvhLoaderInfo.innerHTML = "Loading dance";
|
|
});
|
|
|
|
_exportButton.addEventListener("click", function() {
|
|
_playBVHFasterButton.disabled = true;
|
|
_playBVHSlowerButton.disabled = true;
|
|
EventBridge.emitWebEvent(JSON.stringify({
|
|
type: "bvhPlayerEvent",
|
|
action: "export",
|
|
url: _bvhFileURL.value
|
|
}));
|
|
//alert('No exporter available');
|
|
});
|
|
|
|
_playBVHFasterButton.addEventListener("click", function() {
|
|
EventBridge.emitWebEvent(JSON.stringify({
|
|
type: "bvhPlayerEvent",
|
|
action: "playBVHFaster"
|
|
}));
|
|
});
|
|
|
|
_playBVHSlowerButton.addEventListener("click", function() {
|
|
EventBridge.emitWebEvent(JSON.stringify({
|
|
type: "bvhPlayerEvent",
|
|
action: "playBVHSlower"
|
|
}));
|
|
});
|
|
|
|
_stopButton.addEventListener("click", function() {
|
|
_playBVHFasterButton.disabled = true;
|
|
_playBVHSlowerButton.disabled = true;
|
|
EventBridge.emitWebEvent(JSON.stringify({
|
|
type: "bvhPlayerEvent",
|
|
action: "stop"
|
|
}));
|
|
_bvhLoaderInfo.innerHTML = "BVH file stopped";
|
|
});
|
|
|
|
if (window.EventBridge !== undefined) {
|
|
EventBridge.scriptEventReceived.connect(function(data) {
|
|
data = JSON.parse(data);
|
|
|
|
if (data.type === "bvhPlayerEvent") {
|
|
|
|
if (data.action === "bvhFileLoaded") {
|
|
_playBVHFasterButton.disabled = false;
|
|
_playBVHSlowerButton.disabled = false;
|
|
_bvhLoaderInfo.innerHTML = "BVH file loaded";
|
|
}
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
// list of good bvh animations:
|
|
// walk_bwd_fbx_2009_74-128.bvh turn_right_fbx_2009_60-128.bvh turn_left_fbx_2009_56-128.bvh strafe_right_fbx_2009_63-128.bvh strafe_left_fbx_2009_63-128.bvh hifi-breakdance.bvh
|
|
// run_fbx_2009_44-64 thaila_party_girl_standing_06_pt2_looped_679-1024.bvh
|
|
// https://s3-us-west-2.amazonaws.com/davedub/high-fidelity/bvh/hifi-breakdance.bvh
|
|
//
|
|
// 2016:
|
|
// t-pose-sans-pre-rotations.bvh arms-by-sides-pose-sans-pre-rotations.bvh hifi-walk-1.bvh legs-apart-13-degrees-t-pose idle_to_walk.bvh side_step_right.bvh side_step_left.bvh
|
|
// turn_right.bvh
|
|
// http://localhost/downloads/hf/scripts/walk-2.0-beta/bvh/walk_fwd.bvh
|
|
|
|
|
|
|
|
</script>
|
|
</head>
|
|
<body onload='loaded();'>
|
|
|
|
<div class="bvh-player-content">
|
|
<input class="bvh-player-text" type="text" id="bvh-url" value="http://localhost/downloads/hf/scripts/walk-2.0-beta/bvh/turn_left.bvh">
|
|
<div class="bvh-button-group" style='width: 605px'>
|
|
<input type="button" class="bvh-player-button" id="load-url-bvh" value="URL"></button>
|
|
<input type="button" class="bvh-player-button" id="load-t-stance-bvh" value="T-Stance"></button>
|
|
<input type="button" class="bvh-player-button" id="load-walk-bvh" value="Walk"></button>
|
|
<input type="button" class="bvh-player-button" id="load-dance-bvh" value="Backwards"></button>
|
|
<input type="button" class="bvh-player-button" id="load-idle-bvh" value="Idle"></button>
|
|
<input type="button" class="bvh-player-button" id="stop-bvh" value="None"></button>
|
|
<input type="button" class="bvh-player-button" id="export-animation" value="Export"></button>
|
|
</div>
|
|
<div class="bvh-button-group">
|
|
<input type="button" class="bvh-player-button" id="play-bvh-faster" value="Faster"></button>
|
|
<input type="button" class="bvh-player-button" id="play-bvh-slower" value="Slower"></button>
|
|
</div>
|
|
|
|
<div id="bvh-loader-info">Ready to load...</div>
|
|
</div>
|
|
|
|
</div>
|
|
</body>
|
|
</html>
|