BadDogSkyrim / PyNifly

Export/Import tools between Blender and the Nif format, using Bodyslide/Outfit Studio's Nifly layer. Supports Skyrim LE, Skyrim SE, Fallout 4, Fallout New Vegas, Fallout 76, and Fallout 3.
GNU General Public License v3.0
179 stars 16 forks source link

After any weapon import/export blood mesh is always on #192

Open HeinrichGuil opened 11 months ago

HeinrichGuil commented 11 months ago

Looks like importer is dropping some extra data

BadDogSkyrim commented 11 months ago

Game?

Example of specific weapon?

HeinrichGuil commented 11 months ago

Skyrim Special Edition. Any weapon with blood mesh, like steel dagger

BadDogSkyrim commented 11 months ago

Nope, not seeing it. What do you think is missing?

BadDogSkyrim commented 11 months ago

Wait, I found it. Your error reporting is lousy.

BadDogSkyrim commented 11 months ago

Nope. I take back taking it back. All the string data I can find is being written correctly.

HeinrichGuil commented 11 months ago

Well, then I'm doing something extremely wrong. My way of replicating the issue: I import vanilla weapon, paste mine, remove every attribute from my except UV and meshnormals data, then join my geometry into vanilla objects, then proceed to remove vanilla weapons verts from the object. I move edge blood around to closely match my blade, but leave any attributes intact. Upon export I get always enabled blood mesh.

HeinrichGuil commented 11 months ago

Btw, is the addon supposed to handle SMP meshes? Yesterday I've tried setting up SMP for my armor mod and it turned pretty well, but if I import-export physics-enabled parts of the mesh are stretched and offsetted. Still simulating though

BadDogSkyrim commented 11 months ago

Sounds like you're doing more work than you need to. I'd say something like--Import vanilla weapon into the blender file where you have yours. If you're replacing the blade, not the scabbard, then position your blade correctly with respect to the other parts. Hide the vanilla blade. (Huh. I don't actually know how a dagger attaches itself to the hand.) Put the material that came in on the vanilla blade on your blade. Change texture paths and any other attributes. Fix the UV.

You can either refit the EdgeBlood shapes to your blade or create new EdgeBlood meshes from your blade, then copy the material to your new EdgeBlood. Also copy the NiStringExtraData objects from vanilla to your new EdgeBlood by re-parenting them.

Then select all the shapes you want to export, including BSX flags, INV marker if any, collision, and top-level NiStringExtraData, then export.

If all this isn't clear, get your Blender file to the state where you're about to export, save it, and send it to me. I'll have a look.

HeinrichGuil commented 11 months ago

https://drive.google.com/file/d/1QZJi_iSkoOxmJPTfxPiwBFMqrd-OCW9p/view?usp=sharing here, take a look

BadDogSkyrim commented 11 months ago

So I'll look some more tomorrow, but at first glance I don't see a problem, except maybe that you have two extra NiStringExtraData objects in the blend file. NiStringExtraData.001 and .002 are unnecessary. I hid those, selected 1stPersonSteelSword:ROOT and it seems to have exported just fine.

HeinrichGuil commented 11 months ago

Yes, the export is just fine. My problem is that after all that procedures this edge blood mesh is always fully enabled.

BadDogSkyrim commented 11 months ago

Truth is I know less about skyrim weapons than I thought I did, and that isn't much. I assume that stringextradata tells the engine when to enable the mesh but I don't really know how it works. The only thing I can suggest is put the vanilla weapon side by side with yours and start walking through looking for differences.

HeinrichGuil commented 11 months ago

In case you're wondering changing flags on BSTriShape of both edge blood meshes from 524303 (which surprisingly working on some vanilla meshes) to 15 fixed the problem

HeinrichGuil commented 11 months ago

Still need some info on SMP meshes. Can I extrude additional bones and skin them in blender without all the tedium of outfit studio? Why does SMP meshes are not working when import/export with NyFFI?

BadDogSkyrim commented 11 months ago

You can but bones need some other mechanism to move them so you can't just create random bones. Best approach is to import something that is animated the way you want your part to be animated and use the skeleton that comes with.

Not sure what NyFFI is. If you mean pyFFI, I've kept away from it.

HeinrichGuil commented 11 months ago

You see, i've created auxiliary bones for combined mesh physics (conformal+simulated), my bones are animated via Faster SMP which is a low level CUDA/AVX solution for such physics added to Skyrim. I've created said bones in Outfit Studio, with hierarchic descendancy from bones of original mesh, then I've created XML-manifesto, which tells the sub-engine introduced by FSMP how my constrains look, how collisions are handled and how those auxiliary bones are operating. The point is I don't really like using Outfit Studio for that, because it can be much easier done in blender, but after import and export meshes with those bones I'm losing all the hierarchic dependencies and bones placement. In my latest issue I provided you with my latest outfit NIF, that should be enough to notice that no combination of export checkboxes is allowing to preserve bone positions and hierarchy upon export. Hope that's will clarify the issue Here is my armor with cloth physics enabled, as you can see it reacts to forcefields and wind. So you can add random bones, as long as you have a system to control them and skinned mesh to conform to them.

BadDogSkyrim commented 11 months ago

Okay, if you know what you're doing we're in a different conversation.

Yes, you can create bones and have them be exported. If you're exporting a mesh only bones weighted to that mesh will be exported. There's a setting on the export dialog to preserve the bone hierarchy on export for exactly this reason, HOWEVER when I tried it with your mesh it was not working right. So let's move the SMP conversation over to the other bug report. I'll see what I can do with it.