Jump to content

DOWNLOAD MODS

Are you looking for something shiny for your load order? We have many exclusive mods and resources you won't find anywhere else. Start your search now...

LEARN MODDING

Ready to try your hand at making your own mod creations? Visit the Enclave, the original ES/FO modding school, and learn the tricks of the trade from veteran modders...

JOIN THE ALLIANCE

Membership is free and registering unlocks image galleries, project hosting, live chat, unlimited downloads, & more...

[REQ] [SKY] Exporting a 2-texture model from Blender to NIFskope


 Share

Recommended Posts

Hello folks,

 

I am attempting to create new models and UV maps for the Skyrim books to rectify the truly dreadful UV mapping on the default book and since I am not experienced at using Blender I have hit a problem.

 

As you will know, the Skyrim book is a cover and a thick wad of pages. It is split into three moving pieces - the spine, the front cover and its half of the pages plus the back cover and its wad of pages.

 

When I create a single object in Blender and assign two materials and textures to the model, I get a single NiTriShape when I export to NIFskope. This means I can only assign a single texture to the entire model. If I break my Blender model into two Objects (Cover and Pages), I do get two NiTriShape sections so can assign two textures in NIFskope but I have found that all my Normal, Tangent, Bitangent and importantly, UV data is not being brought into the .nif.

 

I have spent a couple of weeks on this project feeling my way through the Blender and export process and have got my model looking great in Blender but I keep getting stumped by the export.

 

I went back to basics and looked at the original Skyrim book .nif that I used as my original import and it consists of a single Object in Blender with three Vertex Groups corresponding to the three parts of the book. The original .nif also had multiple NiTriShapes (front cover and spine, back cover, pages, loose paper pieces) and I have no idea how they managed to do this.

 

I am chasing my tail here and I really need help knowing how to organise my model in Blender. I need to know how many Objects to split my book into, how to make sure the correct portion of the two UV maps are assigned to the correct parts of the model, and how to make sure I export all the correct UV data to NIFskope.

 

I have asked for help in the blenderartist.org forum and got no response over the past week.

 

Here is both the original plus my current .blend file and working textures. If anyone would mind having a look at the .blend and telling me how far off the ideal approach I am I would be extremely grateful.

 

Original Skyrim .nif stripped and imported to Blender : 

http://www.dcoffey.co.uk/images/requiem/SkyrimBookOriginal.blend

 

Current working .blend with two Objects...

 

http://www.dcoffey.co.uk/images/requiem/SkyrimBookExport3.blend

 
Textures :

 

Link to comment
Share on other sites

and since I am not experienced at using Blender I have hit a problem.

 

This, right here, is the problem. While I applaud your ambition, what you are trying to do is considered advanced Blender work because the mesh is skinned. This means, the mesh is rigged to a "skeleton" - all those bones you see, and the NiSkinInstances you see. Importing skinned meshes is messy for the best of us. Your example blend files are missing half the information it needs.

 

But! Don't be discouraged! I'm going to give you two alternative methods to accomplish what you're trying to do.

 

1. Adjust the UV in NifSkope. (easiest process)

 

You may or may not be aware this is possible. Right click on any part of the mesh in NifSkope and you'll get a context menu. Go to Textures > Edit UV. A pop-up window will show up, showing exactly the same thing as the UV window in Blender. From here you can manipulate the verts or groups of verts at will and you can see the changes on the mesh while you're doing it. I'm not sure how deeply you want to re-UV these books, but this is a great method for minor changes.

 

2. Strip the mesh completely to adjust the UV in Blender, then copy parts.

 

If you need to re-UV more deeply than above, you can still do it in Blender with some adjustments to your process. This is going to turn into a lengthy tutorial (and hopefully I don't miss any steps)

 

A) Open the book mesh in NifSkope. Change the user and user versions as you've been doing.

 

B) Start striping away ALL blocks until all you have left is the BSFadeNode, a NiNode under that, and your 3 NiTrishapes under that. Under the NiTrishapes all you should keep is the NiTriShapeData that goes with each. SAVE the file under a NEW temp file name.

 

C) It's now ready to import into Blender. Once imported you'll have 4 objects. We only need the 3 NiTriShapes. The extra object is the NiNode so you need to delete that. You won't see it at first, it's hidden inside the book, so click on the book cover and hit H to hide it. Hide the pages and the extra pages objects as well. You'll see the NiNode as a 90 degree angle line with X and Y at the end. Make sure to select it all then hit X to delete it.

 

D) Hit ALT+H to reveal your hidden objects.

 

E) Now you can prepare your objects and re-UV map them like normal. Apply a NEW material to each object (not the same material or you'll group them all together as one NiTriShape again), apply the texture, re-UV to your hearts content. When you're finished, export like normal.

 

F) Open this modified mesh in NifSkope. Change the user and user version first thing (so you don't forget). Now we need to clean up the mesh. You should have a NiNode, with the 3 NiTriShapes below it. Expand each NiTriShape and delete every block EXCEPT the NiTriShapeData. When finished it should look like the stripped down version we started with - NiTriShape and NiTriShapeData only.

 

G) Open a 2nd window of NifSkope, and open the original book mesh you started with. Expand the NiNode with the NiTriShapes under it.

 

H) In your modified mesh window, find the NiTriShape of the book cover, right click on it, and go to Block > Copy Branch. Move to your original mesh window, right click on any NiTriShape and go to Block > Paste Branch. This will copy our modified NiTriShape into the original mesh without it being attached to anything. You'll see the new TriShape floating at the bottom of the block list.

 

I) Find the original book cover NiTriShape, remember the line number. In the NiNode block details, expand Children. Double click on the line with the original book cover NiTriShape and replace that line number with the line number of the NiTriShape we just copied over. The original NiTriShape should now be floating at the bottom of the block list. Don't delete it yet.

 

J) Expand the old now floating NiTriShape and make note of its existing NiSkinInstance and BSLightingShaderProperty line numbers. Highlight the new copied over NiTriShape. In it's block details, find the line Skin Instance, double click and add the line number of the existing NiSkinInstance from the old TriShape. Expand BS Properties and enter the existing BSLightingShaderProperty line number there.

 

K) You can now delete the OLD NiTriShape (right click > Block > Remove Branch).

 

L) Repeat steps H - K for the other two NiTriShapes.

 

You now have your new UV map information in the existing book mesh without messing around with actual skinning of the mesh or having to recreate collision (which you don't want to do). Save it, it's done.

 

I wish you the best of luck with your ambitious project! :)

  • Upvote 1
Link to comment
Share on other sites

Huge thanks for the comprehensive reply!

 

I have identified enough optimisations in the original book mesh that will make it well worth while to edit the mesh itself - about 10% fewer verts by culling stuff you just can't see - will I still be able to export the NiTriShapes and insert them into the recipient nif or will it mess up anything important like collision?

 

EDIT : I just tried inserting my two NiTriShapes into the donor .nif and managed to get the book to appear in the world view but it was a vaguely book-shaped disjointed mess of triangles that had been put through the shredder. This was my edited mesh with edited UV. I assume the list of vertices is messed up? In addition, the bones in the book appeared to be pushing on random vertices and there were a few oddly coloured ones that did not reflect the colours in the texture itself.

 

Still, it appeared in the game if it looked like it had been stuffed down Sheogorath's underpants for the past hundred years!!

Edited by DanielCoffey
Link to comment
Share on other sites

I can certainly start from a clean .nif again and chalk the past couple of weeks up as learning experience. I do have some specific questions.

 

If I am inserting my NiTriShapes back into an existing .nif, can I...

 

1. Move vertices slightly to alleviate unwanted creases in the model?

 

2. Remove, merge or create new vertices to optimise the model?

 

3. Keep all the cover in one NiTriShape instead of the current two (and remove the unwanted one in the .nif)?

 

I don't want to mess up the skin weighting information but there are some truly horrible parts in the model that can be improved. As I mentioned, I reduced the count of verts down from 550-ish to 495 by culling hidden or minuscule parts of the mesh.

 

With question 3, currently the rear cover is meshed and mapped separately from the cover/spine NiTriShape and references its own texture (the paper does the same too - the blocks and the loose bits are held in different NiTriShapes). Is there an overhead to declaring a texture twice for UV mapping or doesn't it matter? Could the Skin Data sections be merged too?

Link to comment
Share on other sites

1. Yes.

2. Removing and merging should be fine (I actually can't guarantee that, but you'll know when you test it). Do not add any new verts, they won't be weighted.

3. No. The book is set up as is in order to work properly - 'open and close' when you read it. You do not want to change that. Keep it as is with 3 NiTriShapes, and do not combine them.

 

Heh, yes, this is going to turn into quite the learning experience for you, but hopefully in a good way. Keep at it and enjoy it. Have a :cookie4u: to keep you going. :)

Link to comment
Share on other sites

Thank you for the additional replies.

 

The model is a lot more sensitive to disturbance than I appreciated. When first imported to Blender, not many of the faces are attached to their neighbours so this makes moving them tricky and makes the UV map a mess. If I weld some vertices together to simplify the fragmented UV I end up with another shattered mess in Skyrim after inserting the NiTrishapes. If I simply draw seams, redo the UV and move a few verts I get another mess.

 

I even tried just assigning the new materials and textures and redoing the UV without moving or welding a single vert and still got floaters when the book opened. Frankly I am stumped as it should be more robust than this.

 

I am reluctantly thinking I may really just have to do the UV movement in NIFskope and not use Blender for the task at all. I am considering doing a temporary but accurate UV layout in Blender and telling it to capture the UV layout as an image and use that as my working texture to align the UV data in NIFskope as, by default, there are some horrible stretched faces that need to be aligned carefully.

 

Thanks for the cookie... it was much needed.

Link to comment
Share on other sites

Almost there...

 

Since the model of this book was being such a diva with the Import/Export process, I created a new UV in blender without editing a single vertex and saved it as an image. I photoshopped it onto my test texture and wrapped it round the book. I am now in NIFskope on a copy of the original .nif manually moving every misplaced vertex to match the lines on my template... but I have another problem.

 

My image is 1024x512 but NIFskope insists on displaying it in a square in the UV editor. The UV editor does not scale to match the aspect ratio of my texture. Is this expected?

 

When I move the vertices (and most of the work is done by Scaling by x:0.5 y:1.0) they do indeed move the texture into the correct place on the model but it is hard on the eyes even zoomed in. Can we make the UV editor work with the correct aspect ratio of the texture or am I forced to work on it scaled?

Link to comment
Share on other sites

Yeah, that is a problem with no solution, unfortunately. The UV Editor cannot scale to offset texture sizes. You should still be able to accomplish what you need. The fact that you can see it as you're doing it, the visual cue should help.

 

But I think you knew this wasn't going to be easy. :)  Glad to hear you're getting closer though!

Link to comment
Share on other sites

Well the UV remapping is completed for the standard double-sided book, both the world view and the higher poly inventory model. I achieved a tolerable result using NIFskope although it would have been better and more accurate if Blender had played ball.

 

My fingers are still itching to optimise the model and it is irritating me that I can't do it. I reckon a good 15% triangle saving on the world view model without even touching the shape just by culling hidden or minuscule triangles. The inventory view had a much higher poly count and seemed to be the parent model that the world view was derived from as it had the same issues of waste. It did have a much more complex skeleton inside it and also failed to load into Blender. I stripped it down the the key NiTriShapes and Blender threw a fit with overflow errors so I gave up and just did the NIFskope uv map blind.

 

I have issued the new .nif files to the author of Book Covers Skyrim and am redoing my artwork for the books in the Requiem overhaul. Once I have done that I will redo the uv map for the Tall Book mesh which is the one that appears as those larger books. They are currently single-sided but I will do them as a full wraparound cover. I intend to upload the new meshes as a Modders Resource on the Nexus so that other mod authors who want custom book covers in their own mods can just pick up the meshes and let rip with new covers for their works.

 

On the subject of the mad scissored triangle issues I observed - is that what happens when the weighting data doesn't match the order of the list of triangles? Could I resolve that by importing the Skeleton Only in Blender, redoing the weighting and create new skin partitions or am I just asking for more pain when exporting?

 

Also, would anyone mind having a look at the error thrown by Blender when importing a standard inventory view of a book for me? Have a look at one of the BooknamehereCA.nif files for the double-sided books, strip everything out except for the four NiTriShapes that are to do with the cover and paper and it should throw a wobbler.

Link to comment
Share on other sites

What is BooknamehereCA.nif ? I see no such file that ends in CA in the meshes\clutter\books folder.

 

As for your mangled mess, yes, that's what happens when it's not weighted and rigged properly. You can resolve that by more experience in Blender. As I've said before it's an advanced technique. Have a read through my Creating Skyrim Armor in Blender tutorial series. The books are slightly different in that they don't have BSDismemberSkinInstances, they only have NiSkinPartitions but that's just an export setting at the end of the process.

Link to comment
Share on other sites

Ah, I was looking at the Book Covers Skyrim mods and the author divides the meshes into those for the world view (*.nif) and the inventory view (*CA.nif) and those had the extra letters in the filename. Their path was meshes/clutter/books/book02/character assets/LustyArgonianMaid01CA.nif.

 

I may still have a look at doing the worldview book in Blender as a learning exercise once I have finished my current objectives but I still get an error from Blender when importing the inventory view mesh. If I have time I will try it again and post the error and my import settings here. The inventory mesh only had around 1200 triangles instead of the world view's 700-odd so it isn't an insane amount.

Link to comment
Share on other sites

Here is the Python error...

 

Attempting to Import this NIF...

 

http://www.dcoffey.co.uk/images/requiem/REQ_TheCraftsmansManualCA_TEST.nif

 

gives me this error...

Blender NIF Scripts 2.5.9 (running on Blender 249, PyFFI 2.1.11)
Traceback (most recent call last):
  File "C:\Program Files (x86)\Blender Foundation\Blender\.blender\scripts\bpymodules\nif_common.py", line 1235, in gui_button_event self.gui_exit()
  File "C:\Program Files (x86)\Blender Foundation\Blender\.blender\scripts\bpymodules\nif_common.py", line 1598, in gui_exit self.callback(**self.config)
  File "C:\Program Files (x86)\Blender Foundation\Blender\.blender\scripts\import\import_nif.py", line 3771, in config_callback importer = NifImport(**config)
  File "C:\Program Files (x86)\Blender Foundation\Blender\.blender\scripts\import\import_nif.py", line 170, in __init__data.inspect(niffile)
  File "C:\Python26\lib\site-packages\pyffi\formats\nif\__init__.py", line 1286, in inspect self.header.read(stream, data=self)
  File "C:\Python26\lib\site-packages\pyffi\object_models\xml\struct_.py", line 354, in read attr_value.read(stream, data)
  File "C:\Python26\lib\site-packages\pyffi\object_models\xml\array.py", line 300, in read elem.read(stream, data)
  File "C:\Python26\lib\site-packages\pyffi\object_models\common.py", line 691, in read % (length, stream.tell()))
ValueError: string too long (0x74070000 at 0x0000003A)
 

 

 
Link to comment
Share on other sites

Nuts! Well spotted, thanks.

 

I am considering having another go at making my UV changes in Blender again but this time I will just make a few minor changes before trying to learn how the skin and weighting goes. I had seen the tutorial and quickly realised that the books were subtly different.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...