Jump to content

[Blender] Script to prepare meshes for Skyrim NIF export


kosukosu1

Recommended Posts

Posted

Reposting this from my blog - created my very first python script to automate what was a time sink. Might be useful for those who use blender...

 

When I convert meshes for Skyrim from another source (oblivion, another game, etc), or when editing clothes for a custom body, I use blender. A lot of the blender functionality is still unknown for me - my focus on bringing pervy clothes and environments help me learn it pretty much :)

One of the things i find myself doing a lot is:

  • deleting the materials of a mesh
  • creating a new material
  • creating a new texture
  • setting the texture mode to UV
  • assign an image to the texture
  • saving the uvmap (this step is required or else the uvmaps don't appear in the exported nif and then you can't texture it)

The thing is, it doesn't matter what image or material gets assigned to the mesh because it gets thrown away and replaced with a BSLightingShaderProperty that's specific to Skyrim.

Doing the above process becomes a chore when there are a lot of meshes to deal with, say in an environment.

So I know there's python scripts in blender, and having done not that much of python, i was able to write up a script that does the above steps for the selected meshes in blender all automatically:
kosu_skyrim_prepare.7z

You can put the script in the Bin\Blender\.blender\scripts directory, and you should see a menu item in the Object menu in the 3d window:
post-17069-0-13819400-1410113903_thumb.png

To use:

  • select the meshes you want to prepare for skyrim (usually you'd select all meshes)
  • go to Object -> Scripts -> Prepare for Skyrim
  • a UV export menu will pop up - hit ok
  • You'll see a small option to flip normals - do that if you want to flip all the normals of the selected meshes
  • Hit OK and if you look at the python console, you'll see it processing and it'll say Done! when it's Done (in the console)

Now you can do a NIF export and then you can just delete all the stuff besides NiShapeData within a node, and copy over a BSLightingShaderProperty node from another mesh and reassign the texture.

 

Maybe I might be the only one using blender for skyrim since everyone else seems to use 3dsmax... :P

Posted

Great, post this just after I did this process about 100 times in the space of two weeks.

 

Just kidding :P Sounds great, will try it next time I find myself exporting. Thanks!

Posted

Dude, this is fantastic work. A lot of modders actually use blender to make their models, so I think you've got something great here! Maybe you should post this on the Nexus Forums as well?

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

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