Skyrim
0 of 0

File information

Last updated

Original upload

Created by

DavidJCobb

Uploaded by

DavidJCobb

Virus scan

Safe to use

About this mod

Scripts, add-ons, and other doodads I've created to automate various tasks in Blender.

Files are provided as is.

Permissions and credits
Changelogs
Cobb Blender Tools for Skyrim
This is a collection of scripts, add-ons, and other doodads I've created to help me with various tasks in Blender. Files are provided as-is.

I'm currently using Blender 2.78, so that's what everything current will have been written for and tested on unless otherwise stated (there's some 2.49b stuff).

Import CK Prefab
The Creation Kit can be used to export a list of selected references in a cell, as a text file. This file contains the references' editor IDs, positions, rotations, and scales. The Import CK Prefab add-on can load these files and reconstruct arrangements of references (i.e. "prefabs") in Blender. This is most useful when dealing with architectural kits, when you need to take large structures built from disparate pieces and convert them to single objects.

Before you can import these files, you need a "palette folder," which will contain the relevant 3D models converted from NIFs to BLENDs (literally just import them and save them). The BLEND files need to be named after the editor IDs of your references (typically the same as the base form). When importing, be sure to specify the location of this palette folder in the options in the left pane, and keep in mind that subfolders will not be searched. Assuming default settings, any missing files will result in the creation of empty objects named "MISSING - Editor ID," which will still be positioned appropriately; you can always set up the missing blend later, and then paste its contents as a child node of the empty object to fit it right into position.

When you import, your prefab will be doubly-nested under two empties: Origin and Root. To realign your entire prefab on the origin, pick an imported model to serve as your center. Set Root's position to the negation of your center object's position, and set Origin's yaw-rotation to the negation of your center object's yaw. (The "clumsily recenter" import option does something like this for you, using the average of all positions and using the first non-zero yaw rotation it finds; this is useful just so you don't need to whisk the camera miles away from the model origin. You'll still want recenter the prefab by hand in order to get things exact.)

Recommended workflow: create BLEND files for all of your meshes; then, use NifUtilsSuite to extract the collisions as NIFs, and save those in your palette folder with the naming convention editorID.collision.blend. Then, use two import operations: the first with default settings; the second using ".collision" as your filename suffix. You will then have the visible and compressed-collision geometry all in one file.

Known issue: If the top-level objects in a palette blend have transforms on them, those transforms will get blown away when the importer attempts to place those objects at the coordinates dictated by your CK text file. To work around this, modify your palette blend: create a new Empty and nest the transformed objects under it (alternatively, just apply the transforms).

Loose Scripts
To execute these, create a Text Editor window. Create a new Text if Blender hasn't for you. Paste the script in and click the "Run Script" button. Bear in mind that text data created in this window will be saved into your blend; it shouldn't cause problems, but it's something to be aware of if you'd prefer to manually remove cruft.

Merge identical materials
Scans all materials in your current blend file and merges any that have identical properties. Nested data structures are not checked; only scalar and array values. This means that the script is not foolproof and can yield false positives; however, it should work fine for imported vanilla meshes. In tests, it was able to distinguish between materials in Soul Cairn meshes that used identical textures but subtly different values.

Remove unused materials and textures
If you leave materials and textures unused after importing them, Blender will happily continue to save them into your file again and again, forever. This script will scrub them out for you. For best results, run this after "merge identical materials" to clean up any textures that were left behind.

Copy vertex group by UV [B2.49b]
Given a source mesh and a target mesh whose coinciding vertices have identical or near-identical UVs, copies one or more vertex groups from the source mesh to the target mesh. Uses UVs rather than indices to match vertices together: the two meshes don't need to have the same vertex order, but the matching pre-process is very, very slow.

My use case was when improperly importing body meshes (such that the dismember partitions were ruined) and editing them. I didn't want to have to redo my edits from scratch, so I just imported the originals properly and used this tool to copy the vertex groups to my edited meshes. Speaking of, a tip: the Blender 2.49b NIF scripts only understand Fallout 3 skin partition names, so you have to rename back and forth between those in NifSkope to import properly; you don't have to choose names that make sense, so feel free to map Skyrim's "calves" partition to Fallout 3's "brain" partition if that's particularly memorable to you.

Reorder vertices based on template with matching UVs [B2.49b]
Given a subject mesh (whose vertices you wish to reorder) and a template mesh (whose vertex order you wish to copy), creates an output mesh (by copying the template mesh) and copies data (vertex groups, armature data, etc.) from matching vertices in the subject mesh. Uses UVs to match vertices together; note that the matching pre-process is very, very slow.

Primary use case is when you're working with body/armor meshes, and the vertex orders between your _0 and _1 meshes don't match up for some reason. If they have identical UV mapping, this script should be able to fix your vertex ordering with minimal hassle (provided you're willing to wait on the pre-process step).

FAQ: Frequently Assumed Questions
Your loose scripts crash Blender.
If they don't crash every single time you run them, then it's just Blender being Blender. Unless Python is supposed to use manual memory management and nobody told me, it seems that Blender will just up and crash for no reason even if the script is written properly, so save early and often when you're using these to make mods for Skyrim.

Can you make these for 2.49?
I don't plan on converting any scripts to any version of Blender that I don't use them on, sorry. These can be very time-consuming to write, test, and bug-proof: the "reorder vertices" script for Blender 2.49b took over six straight hours of work, which wasn't helped by how long it took the script to crunch all the data it needed every time I needed to re-test it.