Jump to content

Modders: Import/Export FO4 and Skyrim LE & SE meshes directly from Blender


Recommended Posts

I've just finished V1 of a Blender Import/Export tool that supports Skyrim LE & SE and Fallout 4. Yes, you can import from SE and export to LE and it just works.

 

https://github.com/B...yNifly/releases

 

Features
 
  • Supports FO4, Skyrim LE, Skyrim SE. Import from one game and export to another with minimal twiddling (bone weights, partitions, shape keys).
  • Handles tris and base mesh in one step. No need to separate UV seams or triangulate before exporting
  • Handles expression and chargen tri files for Skyrim and FO4
  • Import tris into an existing mesh or on their own
  • Supports Bodyslide tri files on import and export for body morphs
  • Handles multiple bodyweights in one step. Export _0 and _1 armor weights for Skyrim from a single mesh.
  • Handles Skyrim and FO4 partitions and also FO4 segments
  • Handles skinned and unskinned meshes correctly. Exports head parts to SE correctly.
  • Handles shaders correctly. Set them up in Blender and export.
  • Import-and-forget. What you import will behave correctly on export without fiddling.
Edited by Bad Dog
Link to comment
  • 1 month later...
On 8/27/2021 at 2:55 AM, Bad Dog said:

I've just finished V1 of a Blender Import/Export tool that supports Skyrim LE & SE and Fallout 4. Yes, you can import from SE and export to LE and it just works.

 

https://github.com/B...yNifly/releases

 

Features
 
  • Supports FO4, Skyrim LE, Skyrim SE. Import from one game and export to another with minimal twiddling (bone weights, partitions, shape keys).
  • Handles tris and base mesh in one step. No need to separate UV seams or triangulate before exporting
  • Handles expression and chargen tri files for Skyrim and FO4
  • Import tris into an existing mesh or on their own
  • Supports Bodyslide tri files on import and export for body morphs
  • Handles multiple bodyweights in one step. Export _0 and _1 armor weights for Skyrim from a single mesh.
  • Handles Skyrim and FO4 partitions and also FO4 segments
  • Handles skinned and unskinned meshes correctly. Exports head parts to SE correctly.
  • Handles shaders correctly. Set them up in Blender and export.
  • Import-and-forget. What you import will behave correctly on export without fiddling.

 

Hey BadDog, Great work! This is a game changer! Like some famous dude said: It just works!.

 

Sofar i tested the version 1.3. I changed my workflow from exporting from an to Blender as .obj to SSE .nif. worked great. Only inconveniences were the scaling and rotation not adjustable, when exporting from blender. I guess it is not needed, when are used from the beginning (i imported .obj in the beginning).

 

Shaders now should be exported properly? Great! I have sofar not had any thing done with shaders in blender for Skyrim SE. Is there a tutorial on shaders for Skyrim in Blender? Maybe a template setup?

 

Weights can be exported now! Does it mean i can import a skeleton from Skyrim SE to Blender and modify/finetune the weights in Blender?

 

Do you plan to make the same thing for import/export of animations? If you have not thought about it, please consider it as a request.

 

Thanks.

 

cheers

 

 

Link to comment
  1. Yes, your mesh exports with whatever scaling and rotation you gave it in blender, unless it's skinned in which case the skeleton governs anyway.
  2. Best thing to do is import a nif similar to what you're trying to create. The shader will be converted to a material with shader nodes. You can copy it and go from there. I do mostly skinned nifs, so if you're doing objects you may stumble across setups I haven't had to handle.
  3. Yep weight editing works as you'd expect.
  4. No animations. The niftools exporter is now in active development again and they do handle animations. If I have a reason to I can add them, but I expect it to be a lot of work and I'm not sure what value I'd be adding.
Link to comment
21 hours ago, Bad Dog said:
  1. Yes, your mesh exports with whatever scaling and rotation you gave it in blender, unless it's skinned in which case the skeleton governs anyway.
  2. Best thing to do is import a nif similar to what you're trying to create. The shader will be converted to a material with shader nodes. You can copy it and go from there. I do mostly skinned nifs, so if you're doing objects you may stumble across setups I haven't had to handle.
  3. Yep weight editing works as you'd expect.
  4. No animations. The niftools exporter is now in active development again and they do handle animations. If I have a reason to I can add them, but I expect it to be a lot of work and I'm not sure what value I'd be adding.

Is it possible to export collision objects with the shape object? If not, is maybe inside of your scope for the addon?

 

thanks

Link to comment

Thanks you make topic here !! ?

you really nice add on author ..  Though I already report about facegen.nif in git-hub, but I can talk more frankly and easy thanks... I think this mod is game changer for anyone who use blender as main then try to make mod easy.

 

1 hour ago, monty359 said:

Is it possible to export collision objects with the shape object? If not, is maybe inside of your scope for the addon?

 

thanks

At current, you can not directly export collision + shape mesh from blender . (it simply generate nif as shape , but not generate as collision)

 

I need to edit SE mesh collision, then   What I did is, first convert nif which you will modify collision as LE nif   (nif optimizor),  then import mesh in blender with this add on. then make collision >> export collison mesh only , as LE nif  >> use chunk merge then merge collision to target mesh.  >>  convert as SE again.  I edit noble bed collisions in blender , then it work without problem.. though still not try complex things... and I hope some day, this add on offer more auto-matic way.. (export collision mesh as collision node)

 

 

Edited by greenmango12
Link to comment
4 hours ago, Bad Dog said:

I *think* collisions are possible, just work, at least on the Skyrim nifs. I do plan to look at that. FO4 collisions are all compiled up into a blob, so it may be hard to deal with them at all.

 

Well, at least for me Skyrim would be plenty, i mod only Skyrim SE. I hope it works, as you think, it could.

 

5 hours ago, greenmango12 said:

At current, you can not directly export collision + shape mesh from blender . (it simply generate nif as shape , but not generate as collision)

 

I need to edit SE mesh collision, then   What I did is, first convert nif which you will modify collision as LE nif   (nif optimizor),  then import mesh in blender with this add on. then make collision >> export collison mesh only , as LE nif  >> use chunk merge then merge collision to target mesh.  >>  convert as SE again.  I edit noble bed collisions in blender , then it work without problem.. though still not try complex things... and I hope some day, this add on offer more auto-matic way.. (export collision mesh as collision node)

 

 

 

At the moment it is a complicated procedure, SE to LE, copy paste, use another tool and then back SE.

Link to comment
3 hours ago, monty359 said:

Well, at least for me Skyrim would be plenty, i mod only Skyrim SE. I hope it works, as you think, it could.

 

 

At the moment it is a complicated procedure, SE to LE, copy paste, use another tool and then back SE.

At current  we need to use chunk merge, but it not up-date long time.. and it is difficult to serch the newest version too.. (I google, and found version which called as nif-utils. but most of them lost link... git hub version not compiled...

 

Then I download this (happend to find)  link version. it work well though(thanks Hana) ,, after all, we need to convert as LE mesh, and return for SE.. these step often miss overwrite etc.. then I hope if this add on will work to convert and add mesh as collision (may set vertex group as collision etc)  for skyrim SE too.

https://www.afkmods.com/index.php?/files/file/2398-nifutilssuite/

Link to comment
1 hour ago, greenmango12 said:

At current  we need to use chunk merge, but it not up-date long time.. and it is difficult to serch the newest version too.. (I google, and found version which called as nif-utils. but most of them lost link... git hub version not compiled...

 

Then I download this (happend to find)  link version. it work well though(thanks Hana) ,, after all, we need to convert as LE mesh, and return for SE.. these step often miss overwrite etc.. then I hope if this add on will work to convert and add mesh as collision (may set vertex group as collision etc)  for skyrim SE too.

https://www.afkmods.com/index.php?/files/file/2398-nifutilssuite/

that is what i meant. at the moment it is a complicated process. i hope baddog will be able to implement his solution.

Link to comment

Is it possible to do something  like this for a mesh: Import a ring mesh and move its position so it will be on the left hand and in CK create a new left hand ring version and use the mesh exported from blender and then ingame it will work as a left hand ring?

Link to comment

Of course. Load up the hands nif. It will come in with a skeleton/armature. Select the armature and load the ring. It will load with the armature as parent. In edit mode, move it to the other hand. Pick one of the verts on the hand that's under the ring and copy the weights from that vert to the entire ring. In object mode, export. Done.

Link to comment
  • 3 weeks later...

@Bad Dog, thanks so much for your hard work. If only you knew what a godsend this is.

 

Imma definitely contribute to your patreon just for this.

 

One question though if I may. I've imported a facegen NIF using your add-on and it worked great! - for the most part. However, the improrter discards all tints, the facegen tint mask .DDS/tex file as well as tint colors on the hair. Is there any way to preserve the tints on import? Or any way I can plug them into the shader to preview the tint result in blender? 

 

Thanks for any input you may have!

Link to comment

I've been using it myself heavily, so believe me, I know. Thanks tho.

 

I should deal with the extra texture slots. They should be preserved on import and exported correctly, but I'm not sure I have an actual test for that. You can definitely plug them into the shader--add an image texture node for the tint mask and a mix node to combine it with the base texture. 

 

Edit: Nope, looks like they aren't preserved. But you can add them as above.

Edited by Bad Dog
Link to comment
7 minutes ago, Bad Dog said:

I should deal with the extra texture slots. They should be preserved on import and exported correctly, but I'm not sure I have an actual test for that. You can definitely plug them into the shader--add an image texture node for the tint mask and a mix node to combine it with the base texture. 

Thanks for getting back to me on this.

 

I've actually already tried using a mix node and plugging  both texmaps into that, but none of the blending modes yields the right result. Like, you'd think they'd either use a simple opacity mix (e.g.50:50) or a multiply blend, but no.

 

There's something funky going on that they do, but it's not really googleable what blending mode the game engine uses for the tints. I believe I've tried them all (it looks like an overlay or soft light - dark spots stay dark even if they're only in the base texture, but the complexion actually can get lighter at the same time from the tint)

 

So I was hoping you had some arcane secret knowledge on how the game blends the tints in. ?

Edited by Good Cat
Link to comment
  • 1 month later...

Wow, thank you so much! This is something i've been looking for for a long while. I remember looking for this about a year ago and giving up because you need Oldrim or LE meshes and I own neither.

But now I can use SE meshes!

As celebration, my first fully functional Nif for anyone that wants it! Use for whatever you like, literally don't care what.

It's a kind of old-timey looking School Desk. My Noble School Desk.

Uses the Noble Furniture Textures. All you need to do it import it into CK yourself. It's fully functional.... after I finally figured out Nifscope, Chunk Merge, and Flags.

It's a little rough and simple looking but I made it in like a day just so I could test out attempting to import it into skyrim.

It has 3 sitting spots but the middle spot can't be used, idk, probably something to do with the original bench the Furniture Node was taken from, NPCs might be able to sit in the middle spot.

 

 

NobleBenchNif.png.57c1edc5ba4219e837aa3125b6d3f7c3.png

 

ScreenShot9.png.51704d8013f718a55b24f3cfa5d8f5da.png

 

 

 

NobleSchoolDesk.nif

Link to comment
  • 1 month later...

I've got some questions about how to handle FO4 segments that I'd like feedback on. Dunno how much traffic this thread gets, but if you've been using pynifly you might have opinions.

 

When I started with pynifly I didn't have a full understanding of how FO4 segmentation works. (Still don't.) Let me lay out what I understand at this point so I can even ask the question:

  • There are segments and subsegments. Segments correspond to a body part. Subsegments break a body part into bits. Subsegments are grouped under a parent segment. If a segment has subsegments it does not have vertices associated with it—it's just there to group subsegments. Subsegments always have vertices associated with them. 
  • Subsegments have a user index and a bone ID (currently pynifly also has a "material" but I think that was me misunderstanding something OS does):
    • The index is a small integer. It is unique and increases monotonically within a segment. For dismembering it's just an index, but in headparts it may be used like a Skyrim body part: correlated with a flag set in an armor addon to decide whether to show that part, and so that different armor can knock out sections of another armor.
    • The Bone ID is a magic number that goes with the subsegment. I believe it’s a hash of bone names. It may repeat across different subsegments under the same segment. -1 is used as a null value.
  • The first segment is always empty. 
  • Some nifs have additional empty segments before getting to the first with subsegments. These are important, for reasons that aren’t clear. So it has to be possible to create them in Blender and export them in the right order.
  • Order matters for subsegments too, but that order is always the same as the user index order.
  • Bone ID may be duplicated across different types of nif. E.g. Supermutant and Human arms use the same bone IDs, but their hands do not.

So, requirements for Pynifly:

  • Can define segments. Can determine the order of segments in the export (mostly to put enough empty segments before the first with subsegments).
  • Can define subsegments. Subsegments can be associated with their parent segments. Subsegments can have a user index and bone ID. User index defines order of export.
  • On import, segments and subsegments become vertex groups. Their names have to be human-readable.

Challenges:

  • How to associate vertex group names with segmentation on export? Currently, the names are human-readable strings and are associated with materials and subsegments are associated with parent segments with a data structure. This means every type of nif needs its own entries in the data structure, which is tedious and error-prone. It means that modders can't create a new structure I didn't foresee. But it does mean there are friendly names to use when setting up your mesh.
  • How to name vertex groups on import? Currently the Bone ID is used to find a name, but that can fail when the bone ID is reused--e.g. synth bodies currently import with nonsensical group names.

Proposed solution:

  • On import give segments generic names ("FO4 Segment ##"), as now. Maybe shorter, e.g. "FO4 S##".
  • Give subsegments fabricated names, e.g. "FO4 Segment ## | <user ID> | <Bone ID>" so the supermutant left foot would be "FO4 Segment 06 | 05 | 2749638001".
    • Maybe do a translation from known bone ids to strings so it would be "FO4 Segment 06 | 05 | Foot.R". It seems like bone IDs always correspond across different mesh types.
    • Maybe also do a translation on the index, so the hair top would be "FO4 Segment 01 | Hair Top | Head". ("Head" because all the head parts seem to use the same Bone ID.)
  • On export parse the vertex group name.
    • All vertex groups with the same first part get put under one segment. The segments are exported in alpha (so numeric) order.
    • The second part is the subsegment user ID and order.
    • The third part, if a number, is used as a bone ID; otherwise it's used as a lookup to find a bone ID. If omitted, -1 is used.

Thoughts?

Link to comment
  • 1 month later...

Well, I spent the last week chasing my tail. First I decided I had to really (really, really) understand quaternions and transforms so I implemented a whole matrix math layer and rewrote all the tests to use it. Then I got everything working using that layer. THEN I found out that Blender has all that already implemented in one of their libraries. So I ripped my layer out and rewrote the tests again, because now the matrix math stuff wasn't available at the pynifly layer anymore. I have everything put back together and now there's a new version up that does the simplest of all possible collisions. But it's good news because the rest are (in theory) just the same, only with different collision shapes. We'll see.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use