About them sit scripts


#1

Right now all of them seem broken and undocumented: Seems some of the resources simply isnt showing
So they do not currently work. They all use entity.setting point property and using the sit.js script. It also seems to be a property with the FBX (SittingPoint). More documentation needed.


#2

Spent some time looking for anything of use in the script library which would help me play a fbx avatar animation animation when i touch a specific object

specifically kneel.js which should play a fbx animation on an avatar, its broken.
then I had a look at away.js which does work but I cant find how it runs an animation…

its all a pile of large steaming sit


Doing the Dance of Electricity
#3

The method how you play animations on an Avatar looks simple, If the MyAvatar.cpp files are to be trusted that is (Which I use for reference),

void MyAvatar.prefetchAnimation(String url) : Preloads Animation. Usually best placed in preload
void MyAvatar.overrideAnimation(String url, float fps, bool loop, float firstFrame, float lastFrame): Defines animation to be played.
void MyAvatar.restoreAnimation(): Releases the Overriden animation.

There are also advanced one which can be used if one doesnt want to override the entire avatar-animation overrider.
List< String > MyAvatar.getAnimationRoles()
void MyAvatar.overrideRoleAnimation(String role,String url, float fps, bool loop, float firstFrame, float lastFrame)
void MyAvatar.restoreRoleAnimation(String role)

Then there is the

void MyAvatar.setAnimGraphUrl(String url)

Which overrides the entire avatar animation overrider.


#4

so what do i need to put in a cube to click it and play the anim on my avatar?


#5

going by theory from my Sit script Ive been working on (not tested), this is a Boiled Down version that only animates on touch:


function AnimateMe(){};
var self;

AnimateMe.prototype = {
    clicked: false,
    animation: "REPLACE ME WITH ANIMATION URL BEFORE PUTTING IT ANYWHERE",
    preload: function(entityID){
        self = this;
        MyAvatar.prefetchAnimation(self.animation);
    },
    clickDownOnEntity: function (entityId, mouseEvent){
      if(mouseEvent.button === "LEFT"){
        if(self.clicked){
           self.clicked = false;    
           // TURNING OFF
           MyAvatar.restoreAnimation();
        }else{
           self.clicked = true;
           // TURNING ON, modify my values
           MyAvatar.overrideAnimation(self.animation, 30, true, 0, 100);
        }
      }
    }
};

AnimateMeObject = function(){ return new AnimateMe()}

Edit: fixed prefetchAnimation


#6

I cant make it do anything which prob means I’m doin’ it wrong, awaits a demo


#7

Wait a bit until some of us get something together. Otherwise working with parts of scripts based on interfaces that used to work is going to be quite frustrating.

[Edit]
Though the level of control and interfaces is and will be extensive, it does make for complex and lengthy scripts to achieve a high level action that people are used to doing in a few lines of LSL. You have to think of the HF interfaces, as working down in the valves and steam pipes pits. You are looking for the high level abstraction controls which do not exist here. It is going to take writing up those things as some form of package.


#8

I only wanna check if my bloody anims work. if they don’t am just wasting my time anyways.

https://dl.dropboxusercontent.com/u/10483952/HFCHAIRSIT1.fbx


#9

The objective with my scripting attempts for the seat is to make it as simple as just adding the script, or inheriting it in another script. See my concept for GenericGrabbableObject Prototype (on hiatus until I get an all clear to start looking at it since they are doing changes on the passes) example for js inheritance.


#10

Fudge me, Just got home and tested the script finally.

you should just look at the logs when trying out my scripts I had a type

Has mistyped prefetch as preload (since I just wrote it on the spot at work lol)

see http://www.norteclabs.com/HF/scripts/animator/AnimateMe.js It folds my Blender avatar though like crazy.


#11

Its perfect it only looks wrong cos its next gen and we’re not use to it :slightly_smiling:

But its playing an animation after clicking on a thing and that’s a forward step.
For it to demonstrate something else along the line being borked is well just par for the course in hf lol

re looking at the logs it may as well be in Finish for all the good it does me

had that problem with the animations with thoys dance thing, but the ones on the atp worked?


#12

Its probably because its played back using animation-overrider instead of the animation through script… Let me check.

Nope I guessed wrong. Wonder if thoys re-exported the anim? or does it have something to do with the file having the mixamo app information in the fbx.


#13

the twist dance was straight from mixamo, i believe its uploaded to the atp and played from theavataranimation. json file thing


#14

yeah, but the json overider didnt do a thing,


#15

it has that in the entity
(function() {
MyAvatar.setAnimGraphUrl(‘https://dl.dropboxusercontent.com/u/10483952/avatar-animation.json’);
});

linking to the file it mentions


#16

Yeah, as is said, didnt work

MyAvatar.setAnimGraphUrl(‘http://www.norteclabs.com/HF/animations/sit-and-drive.json’);


#17

i think the animation shoudl work the same from whereever its played the test would be if the ava folds up your way with the twist dance, then you have a reproducible bug. if the twist animation works then its blender trouble again
https://dl.dropboxusercontent.com/u/10483952/samba_dancing.fbx


#18

I checked the differences between those two files

One of them has 90 degrees, and a binding position that is to spec (dance)
The other one doesnt have either (sit)

It the binding position rotation (rest position) is completely wrong which is the lead cause of the animation being completely off. This means the relative bone angles are also off spec, they are different from any other animation that has worked so far from mixamo. NO avatar would work with this other than the one made in a sitting pose.

Welcome to video game animation problems. There is no one stop gap, other than standardization and using the same bone rotations as binding positions.


#19

This is what I have been saying all along. It is wonderful to have the ability to do all that fancy custom work, but it also means next to nothing is interoperable. That’s fine for Hollywood, terrible for common experience worlds.


#20

The thing about that is that SL already had so many wonderful tools over the long period of time it has been out (avastar, qanimator and already defined skeletons) that one never really encountered such issues (aside from the blender pre/post rotations, which seem to be solved). Last I checked, the moment you try to play back an animation on a mesh avatar (that i played around with) using different binding position in SL, you’d have the same issues in SL.

Thats why some of us are pushing up details and documentations on how to solve these issues. Or why avatar customization via blendshapes is something I’ve really want pushed, along with the ability to switch textures: All of those features would allow avatar creators (the ones creating the mesh) to create bounds for basic avatar editing and basic creation (users). If I only had luck with trying to compile the client so I could try giving it a shot on doing the changes to the source code my self and making a PR on it.