Jump to content
TheConceptBoy

Import ONLY Updated animations for a model?

Recommended Posts

Greetings. I'm currently experimenting with 3D model rig of an FPS gun. Is there a way to update only the animations of a rig without having to re-import the entire model? I've got a hand model with about 3 materials on it. Some models will be more complex with more materials. every time I import an updated FBX file, all my materials get cleared. Is it possible to only import animations without breaking the mode?

There  IS an option to "load animations" but it only accepts an .mdl file, which is a file that Leadwerks generated after an FBX model has been imported.

Share this post


Link to post

The editor will automatically reconvert that FBX too. Why not keep the FBX in the same folder, name it mymodelname_anim, and reload the animations every time you modify that?

Share this post


Link to post

Right, I mean store them in separate files, if possible. As long as the hierarchy is the same it will work.

This also allows you to store animations once and use them in many different models.

Share this post


Link to post

When you use "Load Animations", can you supply an FBX file?

image.png.b2b014ef9ff8d92fd8f47896a268f44a.png

Or do you mean I should import the animation as a separate file with a different name, so that leadwerks converts it to MDL and then I use "load animation" and chose that mdl file?

Share this post


Link to post

Been testing the 2nd method. Seems to be working like a charm. But it has a chance of crashing the engine and when I  reload LW, it loses connection to the project folder. I have to re-import the project in that startup window.

 

EDIT: 

Although to add to that crash comment I'm note deleting the old animation and just letting Leadwerks prompt me about the new import overwriting the existing one. So that could possibly point to where the bug lies - During the OverWriting process.

 

A Couple of suggestions for this, I'd love to be able to:

1) Select multiple Animation Loops to delete all selected Shift or Ctrl.

2) Supply a .csv file with all animation loop times outlines there and have LW automatically pull animations for me. from that one long animation that contains ALL animations. Heck, if you can already do that, I'd love to know. 

 

EDIT2:

seems like it doesn't matter if I remove the existing mode prior to importing it again. Still causes a crash of the level editor.

Share this post


Link to post

I think the text import actually does something like that. I have not used it in a long time, I will have to check...

Share this post


Link to post

On another note. I noticed that there is an option to call up a hook / AnimationEnd function when a single shot animation finishes playing. Does it ONLY work if that model has an actor assigned to it? I have a set of First Person Shooter hands and my player already is an Actor  derived from the LW actor class.

Share this post


Link to post

There is a method in the Actor class that will be called automatically. This works in either C++ or Lua.

Share this post


Link to post
Just now, Josh said:

There is a method in the Actor class that will be called automatically. This works in either C++ or Lua.

So that's a Yes then? The Model has to have an actor class attached to it? My player Actor was attached to an empty model with a CharacterController physics that acts as a dummy and the pair of animated hands is parented to dummy. That's all. I don't suppose parenting a Model of the hands to that dummy will make the end animation function of the dummy's actor fire upon animation end?

Share this post


Link to post

I believe we've already had a conversation about this actually. I kinda wish we had some options of checking which animation is playing or whether or on an animation IS playing at all. Right now it's just Play Animation, Stop Animation and a call back that only works if an actor is attached to that model. 

 

Now is it logical to create and attach an entire new actor class to the pair of animated hands just to get that callback working?

Share this post


Link to post

I think so. People requested the C++ class stuff rather than raw pointers.

The problem with having a "current" animation and frame is that there isn't really one. The animation system may have a dozen different animations it is blending in between. It may have multiple copies of the same sequence it is blending in between.

In the future I think adding an animation event feature to call a class method when a specific frame is crossed would be a good idea. That is basically what the EndAnimation() method does, but it only occurs at one position.

Share this post


Link to post
14 minutes ago, Josh said:

In the future I think adding an animation event feature to call a class method when a specific frame is crossed would be a good idea. That is basically what the EndAnimation() method does, but it only occurs at one position.

THAT would also work just as fine to be honest. 

PS: and a MouseRelease please haha. You've got Mouse Hit which is a Press Down single event, Mouse Release would be nice too. Otherwise I'm creating booleans to keep track of releases atm

Oh and looking through the engine files, there does appear to be something called: GetAnimationFrame. Any relevancy here?

  • Like 1

Share this post


Link to post

This conversation right here shows something important. In my quest to make things easy I am trying to simplify complicated things, but this is actually making things harder. Sometimes complicated things are complicated and just have to be explained. Little Timmy may not understand the explanation, but @TheConceptBoy will, even if he has to read it a few times before it makes sense. It would be better to expose the animation stack system even though some people won't understand it, than to say "no, it is too hard for you".

I think my experience with Vulkan is affecting my thinking. It was a harsh mistress, but it's such an absolutely zero-bullshit API and eliminates so much ambiguity that OpenGL had. Maybe "well-defined complexity" is something I should give more consideration to.

  • Like 2

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...