TheConceptBoy Posted June 26, 2019 Share Posted June 26, 2019 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. Quote Link to comment Share on other sites More sharing options...
Josh Posted June 26, 2019 Share Posted June 26, 2019 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? Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
TheConceptBoy Posted June 26, 2019 Author Share Posted June 26, 2019 both animations and the model are in the same FBX file. And when you use the "Load Animation" button, It asks for an MDL file. Quote Link to comment Share on other sites More sharing options...
Josh Posted June 26, 2019 Share Posted June 26, 2019 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. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
TheConceptBoy Posted June 26, 2019 Author Share Posted June 26, 2019 When you use "Load Animations", can you supply an FBX file? 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? Quote Link to comment Share on other sites More sharing options...
Josh Posted June 26, 2019 Share Posted June 26, 2019 The second thing you said. ? 1 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
TheConceptBoy Posted June 26, 2019 Author Share Posted June 26, 2019 Ah, very well then. I had a hunch that this might work. Seems a little but more like a workaround but if it works then it works. Quote Link to comment Share on other sites More sharing options...
TheConceptBoy Posted June 26, 2019 Author Share Posted June 26, 2019 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. Quote Link to comment Share on other sites More sharing options...
Josh Posted June 26, 2019 Share Posted June 26, 2019 I think the text import actually does something like that. I have not used it in a long time, I will have to check... Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
TheConceptBoy Posted June 26, 2019 Author Share Posted June 26, 2019 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. Quote Link to comment Share on other sites More sharing options...
Josh Posted June 26, 2019 Share Posted June 26, 2019 There is a method in the Actor class that will be called automatically. This works in either C++ or Lua. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
TheConceptBoy Posted June 26, 2019 Author Share Posted June 26, 2019 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? Quote Link to comment Share on other sites More sharing options...
TheConceptBoy Posted June 26, 2019 Author Share Posted June 26, 2019 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? Quote Link to comment Share on other sites More sharing options...
Josh Posted June 26, 2019 Share Posted June 26, 2019 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. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
TheConceptBoy Posted June 26, 2019 Author Share Posted June 26, 2019 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? 1 Quote Link to comment Share on other sites More sharing options...
Josh Posted July 1, 2019 Share Posted July 1, 2019 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. 2 Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.