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

24 lines
841 B
JavaScript

// 2017.09.09 Hand Wave Animation Button by Wade and HT
var ANIMATION_URL = Script.resolvePath('swimming.fbx');
var tablet = Tablet.getTablet('com.highfidelity.interface.tablet.system'),
button = tablet.addButton({
text: 'SWIM',
icon: Script.resolvePath('swim-icon-off.svg'),
activeIcon: Script.resolvePath('swim-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:137, },
//hover: { fps: 30, loop: true, firstFrame: 45, lastFrame: 65, },
});
Script.scriptEnding.connect(handJob, 'lower');
button.clicked.connect(function() {
button.editProperties({ isActive: handJob.toggle() });
});