content/hifi-content/wadewatts/animations/crawl/app-crawl.js
2022-02-14 02:04:11 +01:00

24 lines
No EOL
856 B
JavaScript

// 2017.09.09 Hand Wave Animation Button by Wade and HT
var ANIMATION_URL = Script.resolvePath('crawl.fbx');
var tablet = Tablet.getTablet('com.highfidelity.interface.tablet.system'),
button = tablet.addButton({
text: 'CRAWL',
icon: Script.resolvePath('power-button-icon-off.svg'),
activeIcon: Script.resolvePath('power-button-icon-on.svg'),
});
Script.scriptEnding.connect(function() { tablet.removeButton(button); });
var HelpingHand = Script.require('../HelpingHand.js');
var handJob = new HelpingHand({
url: ANIMATION_URL,
raise: { fps: 30, loop: true, firstFrame: 1, lastFrame: 70, },
//hover: { fps: 30, loop: true, firstFrame: 129, lastFrame: 129, },
});
Script.scriptEnding.connect(handJob, 'lower');
button.clicked.connect(function() {
button.editProperties({ isActive: handJob.toggle() });
});