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

26 lines
1 KiB
JavaScript

// 2017.09.09 Hand Raise Animation Button by Wade and HT
//var ANIMATION_URL = Script.resolvePath('M_SpaMar_hand_raise.fbx');
var ANIMATION_URL = 'https://hifi-content.s3.amazonaws.com/wadewatts/Button%20Hand%20Raise/M_SpaMar_hand_raise.fbx';
var tablet = Tablet.getTablet('com.highfidelity.interface.tablet.system'),
button = tablet.addButton({
text: 'Raise',
icon: Script.resolvePath('raise-icon-off.svg'),
activeIcon: Script.resolvePath('raise-icon-on.svg'),
});
Script.scriptEnding.connect(function() { tablet.removeButton(button); });
var HelpingHand = Script.require('../HelpingHand.js');
var handJob = new HelpingHand({
url: ANIMATION_URL,
// NOTE: these animation values are specific to "M_SpaMar_hand_raise.fbx"
raise: { fps: 30, loop: false, firstFrame: 1, lastFrame: 84, },
hover: { fps: 5, loop: true, firstFrame: 32, lastFrame: 42, },
});
Script.scriptEnding.connect(handJob, 'lower');
button.clicked.connect(function() {
button.editProperties({ isActive: handJob.toggle() });
});