Replacing Animated Models?

Questions specific to OpenMW-CS can be asked, and content development related topics can be discussed here
josephbburg
Posts: 10
Joined: 04 Jun 2021, 05:15

Re: Replacing Animated Models?

Post by josephbburg »

Lamoot wrote: 05 Jun 2021, 16:44 'm on linux and the path's I'd add would look like:
I'd just like to interject for a moment. What you're referring to as Linux,
is in fact, GNU/Linux, or as I've recently taken to calling it, GNU plus Linux.
Linux is not an operating system unto itself, but rather another free component
of a fully functioning GNU system made useful by the GNU corelibs, shell
utilities and vital system components comprising a full OS as defined by POSIX.

Many computer users run a modified version of the GNU system every day,
without realizing it. Through a peculiar turn of events, the version of GNU
which is widely used today is often called "Linux", and many of its users are
not aware that it is basically the GNU system, developed by the GNU Project.

There really is a Linux, and these people are using it, but it is just a
part of the system they use. Linux is the kernel: the program in the system
that allocates the machine's resources to the other programs that you run.
The kernel is an essential part of an operating system, but useless by itself;
it can only function in the context of a complete operating system. Linux is
normally used in combination with the GNU operating system: the whole system
is basically GNU with Linux added, or GNU/Linux. All the so-called "Linux"
distributions are really distributions of GNU/Linux.


You've given me a lot of things to try. Thanks for confirming all that stuff! I'm gonna try a few things and report what I find. Better Bodies uses one .nif file for the body and one for the first-person hands, so I want to see if I can do that with .dae, or if it will even work with .nif without some mysterious, special properties in the file.
josephbburg
Posts: 10
Joined: 04 Jun 2021, 05:15

Re: Replacing Animated Models?

Post by josephbburg »

OK, so I have confirmed that I can make BodyParts and get them to appear correctly. That is, only if I save it as a .nif file. The textures didn't show up when I tried this, but that's probably my fault. I tried doing the same as a .dae and it didn't work. I suspect that this is because OpenMW looks for names with spaces, and from what I understand, COLLADA doesn't allow spaces in the names and replaces them with underscores. Although, when I looked at the file, the bone names had underscores but not the mesh object:

Code: Select all


			<node id="right_wrist" sid="id-skelbones-2-61" name="Right Wrist" type="JOINT">
				<matrix sid="transform"> -4.371138828673793e-08 1.43423710596835e-06 -1.0 -0.05446026846766472 1.1368683772161603e-13 1.0 1.4342369922815124e-06 4.2269405753359024e-08 1.0 0.0 -4.371138828673793e-08 -7.3586344718933105 0.0 0.0 0.0 1.0  </matrix>
			</node>
			<node id="Tri Groin" name="Tri Groin" type="NODE">
Oh, also! The instructions don't mention that you need to get the `patch11_2020` branch of the Better Collada addon.
I don't know if OpenMW is finding stuff by object name or bone name, or something else. The original bodies didn't seem to use the names that the Better Bodies objects used. For example, the orc female knee model is "B_N_Orc_F_Knee" and it doesn't have any parenting or skinning information. I suppose the BodyPart selects which bone to make it a child of, and so none of that is needed. If there's only one object, maybe the name doesn't matter? Anyways, I couldn't get a .dae file to load as a BodyPart no matter what I tried.
Lamoot
Posts: 176
Joined: 22 Apr 2016, 12:03

Re: Replacing Animated Models?

Post by Lamoot »

josephbburg wrote: 05 Jun 2021, 19:42 Oh, also! The instructions don't mention that you need to get the `patch11_2020` branch of the Better Collada addon.
Good find, will document it properly. Or even better, see whether the COLLADA exporter can be in a repository under OpenMW and just link that. It's something we mentioned some time ago but haven't gotten to yet.
josephbburg wrote: 05 Jun 2021, 19:42 I suspect that this is because OpenMW looks for names with spaces, and from what I understand, COLLADA doesn't allow spaces in the names and replaces them with underscores.
unelsson mentioned an issue he had with .nif and .dae bone names and what sort of characters they allow. This space / underscore thing is exactly the thing he was tackling. I don't know the issue in-depth, but going through the .nif replacement format thread can shed some light on the implementation. COLLADA implementation discussion starts at page 9. viewtopic.php?f=2&t=3724&start=80

Also some relevant discussion we had with unelsson on Discord.
Yeah, bone ids work fine for that purpose, as long as (in collada) they don't have spaces. Inside OpenMW engine spaces are handled fine, so we can export bone ids with underscores to .dae, then convert underscores back to spaces in OpenMW. Or we can have an extra setting file that defines the names of the control bones. It could be that if the config file is missing, default settings are used: bip01-beginning with spaces -> Morrowind will run fine. If the setting file is found, then any name can be used instead (e.g. bip01 with underscores).
OpenMW engine uses osg node names for defining special bones.. And for collada, osg-names are usually pulled from id, but sometimes from name, depending on which OSG-version is used.
On a sidenote, I don't see why there even has to be both ids and names for bones, but they can be the same.. and the safest way now is to have both, but with the same name, e.g. id="bip01" and name="bip01".
josephbburg
Posts: 10
Joined: 04 Jun 2021, 05:15

Re: Replacing Animated Models?

Post by josephbburg »

Oh, thanks for the reply.

Good find, will document it properly. Or even better, see whether the COLLADA exporter can be in a repository under OpenMW and just link that. It's something we mentioned some time ago but haven't gotten to yet.
Yes, it is an OpenMW fork by unelsson. The patch is for the purposes of OpenMW I think. Hmm, and since my test failed either way, I am not sure if you need the patch or not... I assume it was made for good reason, though!

I don't think Collada support is a hugely important feature if it takes too much effort, since .Nif is working fine since Blender's NifTools plugin was updated to 2.80+. The rest is stuff I was writing before you replied, so here it is:

OK! I've done a bit of fiddling and research and here's my conclusion: In order to make it feasible to do replacers for things, I need a way to find out what animations the file has and which frames they are on. Or at the least, the names of the animations the file is expected to have. Without this, knowing how to animate the file is shooting in the dark, so any replacer will have to use the same rig (and thus the same proportions). This wouldn't be so bad if the files imported well, but whether it's due to the proprietary format being hard to interpret, or the awful practices of the early 2000's, the models come into Blender with extremely wonky poses and transformations. This makes any work on the original files a chore.

Moreover, I have noticed that the animations store only the keyframes that are being used, so sometimes they expect the rig to be in a certain state before they begin (idle animations should be playing first), so even importing the animation into Blender will lead to incorrect results. There are files in which a different model is used in the death animation, too, and I don't have a clue how that sort of model-switching works, nor how to replace it. There doesn't seem to be any visibility animation, and I doubt animation in the materials would import or export. There's other little oddities, like shadow-meshes that don't seem to have any special identifiers... how does OpenMW know they're shadow-caster meshes and not the main geometry? There are probably a lot more little things like this.

Finally, the old files seem to use vertex animation (also known as shape keys or blendShapes). I don't know if there's anything important to know about when dealing with vertex animation in OpenMW. I don't know if the exporters support it.

So, here's what I need:
  • Some way to learn about the AI of individual characters -- which animations they play, hardcoded links between files (humanoids, for instance), which animations depend on others... (I expect this is very difficult to do)
  • How do weird features like model-switching and shadow meshes work?
  • Knowlege about how vertex animation is handled by importers/exporters/OpenMW.
I think in order to get OpenMW to work with a more modern pipeline, it's imperative to make it easy to make art for it. Having to make guess about stuff that was hard-coded into the game 20 years ago is as hard for the artist as it is for the OpenMW devs! I hope it doesn't seem like I am complaining, as I am well aware that this entire project started with a huge amount of guessing and extremely difficult tech-detective work. I'm willing to do some of this, but I don't think I have a big enough brain to do it all myself.


In the meantime, I have succeeded in making a .nif body replacer, but because I don't have the ability to replace the rig, it's unlikely that I'll be able to improve on Better Bodies. The longer I fiddle, the more it seems that the flaws in BB are due to the constraints they were working under. Same goes for enemies and such. I want to improve on them, but I doubt I can surpass other artists without the ability to redo the rigs and animations.

Edit: EVEN WORSE! The files that reuse rigs/animation can also change them... so the rest/binding pose of a rig can be different from file to file. Which is yet another complexity to work through!

Edit: I have made a wonderful discovery. While I was unable to find the text keys that identify the start/end of an animation group in the .NIF file itself using NifSkope... it turns out the text-keys are stored as plain text inside the .nif file. It would be fairly easy to figure out the groups being used this way. Unfortunately... the frame numbers are still stored in binary format. The grind continues! It may be easy to find the numbers, since I probably only have to convert them from something. Hexadecimal? I'll keep looking into it.

Edt: I am an idiot. It's easy to find in NifSkope if you know where to look. The node is "NiTextKeyExtraData".
Lamoot
Posts: 176
Joined: 22 Apr 2016, 12:03

Re: Replacing Animated Models?

Post by Lamoot »

josephbburg wrote: 06 Jun 2021, 19:41 I think in order to get OpenMW to work with a more modern pipeline, it's imperative to make it easy to make art for it. Having to make guess about stuff that was hard-coded into the game 20 years ago is as hard for the artist as it is for the OpenMW devs! I hope it doesn't seem like I am complaining, as I am well aware that this entire project started with a huge amount of guessing and extremely difficult tech-detective work. I'm willing to do some of this, but I don't think I have a big enough brain to do it all myself.
I don't see it as complaining but as valid frustration one gets when faced with current OpenMW art pipeline and its lack of documentation :) It's something I've been working to solve. For the past few months my priority was the Template, but now that it's in a working state, the animation pipeline (and documentation!) is presenting itself as the natural next step.

COLLADA does already work with custom rigs, models, and body parts, but I need to prepare example files and document it. It's great you mention all of these things as it helps me determine what information needs to be included.
josephbburg wrote: 06 Jun 2021, 19:41 Yes, it is an OpenMW fork by unelsson. The patch is for the purposes of OpenMW I think. Hmm, and since my test failed either way, I am not sure if you need the patch or not... I assume it was made for good reason, though!
Ah I wasn't clear with this. I'm aware of the exporter as we worked together with unelsson to hack it for OpenMW's needs. What you brought up was that the documentation wasn't clear there's a special branch of the repository that needs to be downloaded. Another one of those small confusing moments for anyone new to OpenMW that needs to be addressed.

For example, the question you had on how to install the Template, I'm already putting together an article on that. You are not the last person with this question and we need it properly documented. https://gitlab.com/OpenMW/openmw/-/blob ... mplate.rst
josephbburg wrote: 06 Jun 2021, 19:41 Some way to learn about the AI of individual characters -- which animations they play, hardcoded links between files (humanoids, for instance), which animations depend on others... (I expect this is very difficult to do)
OpenMW still relies on the structure set by Morrowind so it supports the same set of animations along with their names. Animations need a specific
name and they are used by the engine in the intended place & function. I'll be looking at various sources, including the source code to get a complete and clear list.
https://gitlab.com/OpenMW/openmw/-/blob ... r.cpp#L146
https://gitlab.com/OpenMW/openmw/-/blob ... dt.cpp#L62
User avatar
psi29a
Posts: 5356
Joined: 29 Sep 2011, 10:13
Location: Belgium
Gitlab profile: https://gitlab.com/psi29a/
Contact:

Re: Replacing Animated Models?

Post by psi29a »

Keep in mind that is it OpenMW's intention support later NIF versions, we already support enough to start rendering models from Oblivion Skyrim and Fallout3.

By this, I mean it that we want to enable molders and content creators to also use pre existing tools geared towards newer games as well and not locked into Morrowind's way of doing things.
Lamoot
Posts: 176
Joined: 22 Apr 2016, 12:03

Re: Replacing Animated Models?

Post by Lamoot »

Here's a video back from February showing a player character, animations and interchangeable body parts. Models and animations are using .dae format.
https://www.youtube.com/watch?v=FuQI5TS3NnE
Post Reply