First few frames of animation are jittery


#1

I have been writing animations for a horse but the first six or so frames of the 50 frame animation show up in hifi really jittery then everything smooths down until the loop start whereupon the model jitters, quakes and stutters again for a few frames then smooths out. Any ideas as to why this is occurring, I’m open to suggestions.


#2

There’s AnimationCache.prefetch(“animurl”); Unsure if you’re talking about a loop or one-off, you can try calling that before firing the animation, it might fix it.


#3

Thanks XXX!

That’s another thing that I’m going to have to learn about. Scripting is not something I’m used to but then, HiFi has been teaching me loads of stuff. It’s a great forum for me to learn and it’s constantly throwing things at me which require further learning on my part and keeping my retirement a busy one.

I’ll investigate the function and it appears I may need to learn something of java script since several things I want to accomplish will require coding. I want some NPC’s at Equus and incidental sounds and control of day/night and this list is growing steadily!

I appreciate any leads I can get and that one goes to the top of the list.

I also have to investigate the functions MyAvatar.setAnimGraphUrl() / MyAvatar.getAnimGraphUrl() since I am keen on being a quadruped in HiFi for various reasons and presently I’m creating all the default animations called within HiFi for my quadruped as at some point, I will need to intercept the various avatar animations and impose my own.


#4

The setAnimGraphUrl is quite simple to use, you just point it towards the avatar-animation.json you have made hosted somewhere, or locally on your drive, which is just a list of states and animations, and the frames used for those animations.

Unfortunately its so far quite undocumented, so needs a bit of pathfinding to go through it :slight_smile:


#5

@Menithal that sounds simple enough however, I know nothing about scripting. Is there a command line into which we can type arguments? That is, do I need to create a use_anims.js which is simply a single line of code to the effect
{
MyAvatar.setAnimGraphUrl()
}
That is the sum total of my java scripting skills. I know I must bracket an expression! I once knew Benton Harbor Basic though. I do not know how to cause interface to start using my animation sets.

There is plenty of time as I am having a dilly of a time getting what I make in Maya to show up as intended within HiFi. I should have started by using a root bone because swaying of the hips (my scene’s root) is throwing my model into convulsions and he looks like he’s skating and thrashing about as he leans back and forth during the walk cycle. Without restarting the whole mess, Maya does not want me to append a root bone to my animations, doing so results in no animations when exported.

I am new to Maya and intend to make it my tool of choice.  I support Blender and am one of it's contributors but I had the opportunity of having a licensed Maya 2016 so have forsaken Blender and am studying instead on the use of Maya. In the past I have animated in Blender, in 3dsm, with  DAZ and Poser and I'm facing a steep learning curve trying to get Maya under my belt.  I'm in a fevered pitch since I will need to re-up Maya sometime in August.

Thank you all for your suggestions and comments, they are most welcome and I’m taking notes as I try to digest it all.


#6

So you have few ways of doing it :slight_smile:

Simplest way is to do it through the Avatar Settings (1) without even touching a script:


This is same as the avatar animation graph url, but simplified in terms.

Scripting wise, you can add the following line to a script (2) or to the scripting console .

If you want to do it with the scripting wise, just

MyAvatar.setAnimGraphUrl(“path to anim”)

is sufficient :). Both of these do nearly the same thing, the other just allows you to have ui that can set multiple ones.

As a side note, You do not need the curly braces, unless you are making a function.

Now about the Maya animations, I think @Ozan would be the person to talk about that as my Maya knowledge is limited to when it was still owned by Alias.


#7

@Menithal Thanks loads! Things begin to make sense and I’m grateful for the help. I think I have found some of my ‘thrashing’ problems and last night I dreamed about idle animations. I suspect that I won’t see the thrashing unless I move the hips. It’s possible that if I make the walk cycle less dynamic that issue will be resolved (I like to exaggerate animation nuances) and I shall find out today during another experiment. Maya is darn peculiar and like 3dsm tends to remember everything which often times leads to some surprising results.


#8

To be sure, do I need these quotation marks? Should this be MyAvatar.setAnimGraphUrl(“http://blackbear.dnsalias.com/public/animations”)

or should this be without the quotes as in (http://blacbkear.dnsalias.com/public/animations) ?

I did, delightfully, turn into a horse today and prematurely since I do not have all of my animations sets written yet. I was anxious since I don’t like appearing as Mathew and zap I was in but upon trying to set the animation json I can successfully crash interface.

That is likely my fault for it calls for the avatar-animation.json and asks for the json location and I wasn’t entirely sure if I should include the extension. Doing so crashes me and not providing the extension likewise does.


#9

Yes. In most programming languages, to define a word into a variable you have to wrap a word or a sentence in single or double quotation marks.

Specifically, the path you define here, or as I mentioned in my earlier posts, should be to the avatar-animation.json it self, not the directory of the animations. The avatar-animation.json will referer to the animations with absolute paths.

Forexample, in your case,
MyAvatar.setAnimGraphUrl("http://blackbear.dnsalias.com/public/avatar-animation.json");
Just note that it might seem abit disjointed as you have animation reference that do not exist, but you can fix those later.


Do note however, I quickly tried an avatar on, saw it for a split second, and crashed like you mentioned. I sent in a crashlog to the devs.

I suspected this may have been due to it trying to find your avatars hands and feet, so I attempted to make a fixed version of the avatar-animator without the IK handlers.. Sadly no dice.

For now, to fix the constantly crashing client because of the set avatar and avatar animation, just reset the settings when It prompts you.

Maybe one of the devs could help with this puzzle @Caitlyn? Perhaps @Ozan as this is avatar / maya related?


Quick notes:

To compact the model size and simplify the fst: When exporting the skeleton with the mesh, avoid exporting the IK helpers and controllers . The base skeleton that is animated is all you need on export. Just make sure that this is saved separately from the original file. This also may be causing the jitter confusion.


#10

While it may seem counter-intuitive the bone references in my model are in accord with the avatar standard so there does exist hands and feet. I found the jittery existed because I both translate and rotate the hip, removing those keys solved most of the jittery except for the first 16 frames in each instance. Including those frames but not referencing them solves the jitter. I did include IK handlers and will correct that and may be able to play those skipped frames. The model successfully appears but naturally is a contorted horse (which i still prefer!) but an immediate crash occurs when I correctly point to the avatar-animation.json which I also reported.

I was surprised that the textures did not appear so shall look into the fst file and see what path is being sought for textures, they do exist in a ‘texture’ sub-folder. Thank you so much for your input, I wish I could scrub up more time to devote to the project. This has been one of the funnest projects I have worked on in years and I can hardly wait for those times I have to sit down and fiddle with it.


#11

About the textures, make sure to put them all in the texture folder, without any extra directories. All the textures are pulled from that folder depending on the name, not the path.

Forexample, if you have a model named horse, and it has a textures diffuse, and normal placed relatively, and the fst file would be something like

name = horse
type = body+head
scale = 1
filename = horse/horse.fbx
texdir = horse/textures
[... and so on ...]

It would mean that all the textures would just placed into the horse/texture without any other relative folders.

horse.fst
horse/horse.fbx
horse/textures/diffuse.png
horse/textures/normal.png

And So forth. Hopefully that helps with it. This is unless you refer to the fbx directly, which is when the relative paths do apply.