Jump to content

New Clothing Body Style Converter Beta v0.89f (10-26-2014)


gerra6

Recommended Posts

Posted

We got a little further ;)

 

 

 

Python 3.2.5 (default, May 15 2013, 23:06:03) [MSC v.1500 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> ================================ RESTART ================================
>>>
Distance : 10.0
target : G:/Obliv/portable_tools_24/Convert Clothing b_51/Convert Clothing b_51/PythonPortable/App/Scripts/kgtools/Clothing Converter/to/dmrafupper.nif
uv_search : True
destination : Clothing Converter/lattice/lattice.lat
norm_weight : 0.0
template : G:/Obliv/portable_tools_24/Convert Clothing b_51/Convert Clothing b_51/PythonPortable/App/Scripts/kgtools/Clothing Converter/from/zkecfupper.nif
v_index : True
targets : 1
**********Bones Initialized**********
initializing meshes
Foot:HGECF{}2{} : Initializing Vertices
Foot:HGECF{}2{} : Vertex Initialization Complete
Foot:HGECF{}2{} : Initializing Skin
Foot:HGECF{}2{} : *Initializing Skin Bone Transforms
Foot:HGECF{}2{} : *Calculating world Coordinates
Foot:HGECF{}2{} : Skin Initialization Complete
Building Vertex Dictionary
initializing faces
**********Meshes Initialized**********
**********End**********
b'Bip01 Neck1' Transform Identified
[  1.000  0.000 -0.000  0.000 ]
[ -0.000  1.000  0.000  0.000 ]
[  0.000 -0.000  1.000  0.000 ]
[ -0.000  0.000  0.000  1.000 ]

b'Bip01 Head' Transform Identified
[  1.000 -0.000 -0.000  0.000 ]
[  0.000  1.000  0.000  0.000 ]
[  0.000 -0.000  1.000  0.000 ]
[ -0.000  0.000  0.000  1.000 ]

**********Bones Initialized**********
initializing meshes
Foot:Upperbody{}2{} : Initializing Vertices
Foot:Upperbody{}2{} : Vertex Initialization Complete
Foot:Upperbody{}2{} : Initializing Skin
Foot:Upperbody{}2{} : *Initializing Skin Bone Transforms
Foot:Upperbody{}2{} : *Calculating world Coordinates
Foot:Upperbody{}2{} : Skin Initialization Complete
Building Vertex Dictionary
initializing faces
**********Meshes Initialized**********
**********End**********
morph keys None None
Attempting Vertex Index Search
CTX Mesh b'Foot:HGECF{}2{}'
0 Vertices matched with vertex index search
Attempting UV Search
uv match_set {<kg.mesh_util.mesh object at 0x0920BA10>}
Searching left side of Foot:HGECF{}2{}
Building Vertex Dictionary
Building Vertex Dictionary
Performaing UV Search
Traceback (most recent call last):
  File "G:\Obliv\portable_tools_24\Convert Clothing b_51\Convert Clothing b_51\PythonPortable\App\Scripts\kgtools\make_lattice.py", line 183, in <module>
    Main()
  File "G:\Obliv\portable_tools_24\Convert Clothing b_51\Convert Clothing b_51\PythonPortable\App\Scripts\kgtools\make_lattice.py", line 162, in Main
    good_targets += uvSearch(cs, to_mesh, from_mesh, act_p_vert = search_res, ctx_p_vert = lattice_res, face_search = True)
  File "G:\Obliv\portable_tools_24\Convert Clothing b_51\Convert Clothing b_51\PythonPortable\App\lib\site-packages\kg\search_util.py", line 1150, in uvSearch
    face_search = face_search
  File "G:\Obliv\portable_tools_24\Convert Clothing b_51\Convert Clothing b_51\PythonPortable\App\lib\site-packages\kg\search_util.py", line 1747, in getVertexInfluence
    normalize = sum(1 / l for vec, l in lengths) / inf
ZeroDivisionError: float division by zero
>>>

 

 

 

Mem

Posted

Thanks.

 

That particular pair of meshes created a situation that I honestly did not forsee.

 

Here's an update that should resolve that bug.

 

Download:

 

Upgrade Package 52: Upgrades Portable v.50 or v.51 to v.52: Convert Clothing b_52_Upgrade.7z

To Install: copy the PythonPortable folder into your existing portable install and overwrite all files when prompted.

 

Light Package 52: Scripts Only: Convert Clothing b_52_Light.7z

Posted

Glad to hear it.

 

One note...I'm spotting some weird bits of distortion here and there. It think it's due to my fairly quick and dirty weighting algorithm.

 

I'm building out something a bit more robust that should hopefully resolve that.

Posted

I thought there might of been something with the 50 version all I was getting was a crash when trying to convert things when I tried it last night but it was pretty late at that time so I never got a chance to post anything I tried the 52 upgrade and it seems to be working now no crashes. Thank you for the update.

Posted
I gave version 52 a spin, again with the Northgirl armor.

 

For starters, I realized why it was stopping after the first file: because I was asking it to do stupid things, such as converting a gloves mesh using the female body lattice I created, doh! For reasonable conversions, multiple selection works just fine. :)

 

These items could not be converted:

- northbelt_0.nif

- northbelt_1.nif

- Weste2_0.nif

- Weste2_1.nif

They're the largest files in Northgirl armor by far (1.1 MB apiece), I assume this is due to their fur lining. The scripts runs a good while so it is making an effort, but it gives out in the end. It's probably a size/capacity issue with large meshes.

 

These items could also not be converted:

- boots_go.nif

- gloves_go.nif

I'm assuming these are used for previewing the gear in the Inventory, so their model doesn't matter.

 

Finally, conversion stopped immediately on these items:

- boots_0.nif

- boots_1.nif

- gloves_0.nif

- gloves_1.nif

Perhaps these are just identical between the source and target body models, what with UNP Topmodel being mostly based on UNP Skinny.

 

All in all, the conversion process works smoothly and reliably.

 

With the conversion from UNP Skinny to UNP Topmodel, some issues remain:

- Distortion at the breast area.

- When equipping the chestpiece, the body as always reverts to UNP.

post-368191-0-66715100-1395958471_thumb.png

 

So I tried converting from UNP Main to UNP Topmodel.

- The shirt looks much better.

- The trouser's backside is distorted.

- The leg straps escaped the conversion, making them float around the leg.

post-368191-0-13798500-1395958529_thumb.pngpost-368191-0-64282300-1395958531_thumb.pngpost-368191-0-41585100-1395958533_thumb.png

 

Next time I'll try with a simpler armor.

 

One thing I'd like to know: I can see the body switching from UNP Topmodel to UNP Main when equipping the chestpiece. When unequipping, it switches back. Is there a way to avoid this? Would the body type be coded in the mod that I substitute the meshes in?

Posted

These items could also not be converted:

- boots_go.nif

- gloves_go.nif

I'm assuming these are used for previewing the gear in the Inventory, so their model doesn't matter.

 

Finally, conversion stopped immediately on these items:

- boots_0.nif

- boots_1.nif

- gloves_0.nif

- gloves_1.nif

Perhaps these are just identical between the source and target body models, what with UNP Topmodel being mostly based on UNP Skinny.

Hmm... If the boots and gloves aren't converting, that probably means that the tool could not find vertex matches between them. That's not a good thing.

 

Basically, the tool doesn't really track whether or not a vertex was actually modified, it only checks whether or not a vertex found a valid target on the template. Depending on that particular tool and the settings, it will copy that data from the template vertex to the target vertex, even if that data is pretty much identical to the original data on the template (it costs about the same to update the data as to do a comparison, so the tool doesn't bother to check each time). So, even if the hands were identical, the tool should have saved them to the output folder.

 

Did your 'From' and 'To' nifs include a body, hands, and feet?

 

- Distortion at the breast area.

That seems to be a big issue with the post v.50 versions of the tool. I *think* the problem is in my face location weighting algorithm (determines the contribution of each face vertex for a given coordinate on the face), but I'm not yet certain.

 

***Edit***

Yep.  I found the problem.

 

I've completely revamped the algorithm for weighting locations of a face.  V.60 is looking very solid now.

 

- When equipping the chestpiece, the body as always reverts to UNP.

 

One thing I'd like to know: I can see the body switching from UNP Topmodel to UNP Main when equipping the chestpiece. When unequipping, it switches back. Is there a way to avoid this? Would the body type be coded in the mod that I substitute the meshes in?

That I have no idea. One thing worth noting about the clothing converter, it changes the shape of the meshes, but not their essential characteristics. So a UNP body converted by clothing converter will still be a UNP body, it will just take on a new shape.

 

Now, I do have a framework in place that can copy a body mesh from one nif into another. I'll see about adding streamlined 'body swapper' tool.

 

- The leg straps escaped the conversion, making them float around the leg.

That's pretty weird. It's possible that the search distance is too low for the leg straps to get converted.

 

Would you be willing to send me your working files (From body, To Body, and the meshes (both the ones that did not convert, and the ones that had distortions). I'd like to do some stress tests with the tool and see where it's breaking.

Posted

OK.

I think this is the one.

Clothing Converter Release Candidate V.0.60

This update represents a massive improvement to the quality of the clothing conversions.

For best results, please discard pre v.60 lattices.

Download:

Full Portable Package: Outdated File Removed

Portable Package Upgrade (v.5x to v.60): Outdated File Removed

Light Install (scripts only): Outdated File Removed

Change Log:
1. Significant improvement to the back-end face location weighting algorithm allows the tool to precisely match the best fit location on a mesh. Limited testing has shown converted clothing with no UV or vertex distortion.

Posted

Now that this update is out of the way, I'll get back to finishing up the automated clipping mesh cleaner.

 

For that project, I'm happy to state that face collision detection coding has been completed.  Now I just need to decide how I want the tool to resolve identified collisions.

Posted

If it wouldn't take so long to do it, I'd iiWP6TyvbKcKn.pngeveryone of your posts in this entire fucking thread. 

 

Rock the hell on. I'm bout to try out v60

Posted (edited)

Lattice generated in much less time than before - output was also significantly smaller. Both of which seem very promising!

 

Can't seem to get it to run a conversion, though. :/ Crashes before producing anything, in the first few seconds.

 

Attaching the lattice file in case anything can be made of it. Not sure what's going on.

 

EDIT: waaaaait a second.

 

Do'oh. Forgot to uncheck UV search didn't I.

 

Testing again without the rookie incompatibility issue.

 

Never mind, didn't help.

cbbe_to_sevenbase.7z

Edited by xarathos
Posted

So here's a problem that was partially stated by orgs1n, but clearly exhibited by my own conversion attempts

 

An outfit has at least some parts of the original body mesh. Therefore, converting outfits from ADEC to BodySlide CBBE causes problems because the ADEC and CBBE UVmap is different. Therefore therefore, you can't effectively convert outfits from varying bodies to an arbitrary "other" body.

 

I stop short of saying that's a "must-have" feature, but it certainly limits the scope of the converter in skyrim.

 

I also had the problem (with v42) that the conversion didn't appear to fully convert the outfit even tho i chose "all edges" but lets see how v60 treats it. So far it already seems significantly faster.

 

Stand by . . . 

 

Posted

Lattice generated in much less time than before - output was also significantly smaller. Both of which seem very promising!

 

Can't seem to get it to run a conversion, though. :/ Crashes before producing anything, in the first few seconds.

 

Attaching the lattice file in case anything can be made of it. Not sure what's going on.

 

EDIT: waaaaait a second.

 

Do'oh. Forgot to uncheck UV search didn't I.

 

Testing again without the rookie incompatibility issue.

 

Never mind, didn't help.

 

I've got the same thing.

 

[edit]

Alright i was fuxoring around to get a text dump of the output . . . didn't work as expected.

 

But for everyone else in this thread, if you manually call py.exe convert_clothing.py from a cmd window, then the window stays open after termination.

 

here's what I got:

Microsoft Windows [Version 6.3.9600]
(c) 2013 Microsoft Corporation. All rights reserved.

g:\Games\Skyrim\Apps\Convert Clothing\Convert Clothing RC_60_Light>py convert_clothing.py > dump.txt
'py' is not recognized as an internal or external command, operable program or batch file.

g:\Games\Skyrim\Apps\Convert Clothing\Convert Clothing RC_60_Light>F:\Pythoncrap\Python33\py.exe convert_clothing.py > dump.txt
Traceback (most recent call last):
  File "convert_clothing.py", line 223, in <module>
    Main()
  File "convert_clothing.py", line 166, in Main
    lattice = loadLattice(current_settings['template'])
  File "g:\Games\Skyrim\Apps\Convert Clothing\Convert Clothing RC_60_Light\kg\lattice_util.py", line 61, in loadLattice
    for node_data in lattice['nodes']]
  File "g:\Games\Skyrim\Apps\Convert Clothing\Convert Clothing RC_60_Light\kg\lattice_util.py", line 61, in <listcomp>
    for node_data in lattice['nodes']]
KeyError: 'norm'

g:\Games\Skyrim\Apps\Convert Clothing\Convert Clothing RC_60_Light>

ADEC3 to FFW.7z

Posted

It looks like the clothing converter was getting a bit stupid if the nif the lattice was built out of lacked vertex normals.

 

This patch should fix that:

 

Clothing Converter RC 61

 

Download:

 

Portable Package Upgrade: Updates v.60 to v.61: Outdated File Removed

 

Scripts Only: V.61: Outdated File Removed

 

Change Log:

 

1. Resolves bug that could occur when a Lattice generated from a Normal free mesh was loaded into Clothing Converter.

Posted

different error . . . 

ADEC_0_V3.0_TBBP{}2{} : Recalculating Normals
ADEC_0_V3.0_TBBP{}2{} : Normal Vector Calculation Complete
ADEC_0_V3.0_TBBP{}2{} : Recalculating Normals
ADEC_0_V3.0_TBBP{}2{} : Normal Vector Calculation Complete
Traceback (most recent call last):
  File "make_lattice.py", line 183, in <module>
    Main()
  File "make_lattice.py", line 175, in Main
    lattice = lattice_util.make_minimal_lattice(from_mesh, p_vert = lattice_res)

  File "g:\Games\Skyrim\Apps\Convert Clothing\Convert Clothing RC_61_Light\kg\lattice_util.py", line 118, in make_minimal_lattice
    return Lattice(location = lat_center, node_dict = node_locs, faces = faces)
  File "g:\Games\Skyrim\Apps\Convert Clothing\Convert Clothing RC_61_Light\kg\lattice_util.py", line 244, in __init__
    self.faces = [nodeFace((nodes[n_1], nodes[n_2], nodes[n_3]), normal) for (n_1, n_2, n_3), normal in faces]
  File "g:\Games\Skyrim\Apps\Convert Clothing\Convert Clothing RC_61_Light\kg\lattice_util.py", line 244, in <listcomp>
    self.faces = [nodeFace((nodes[n_1], nodes[n_2], nodes[n_3]), normal) for (n_1, n_2, n_3), normal in faces]
  File "g:\Games\Skyrim\Apps\Convert Clothing\Convert Clothing RC_61_Light\kg\lattice_util.py", line 279, in __init__
    self.normal = vector3(normal)
  File "g:\Games\Skyrim\Apps\Convert Clothing\Convert Clothing RC_61_Light\kg\math_util.py", line 370, in vector3
    vec.x, vec.y, vec.z = coords
TypeError: 'Vector3' object is not iterable

g:\Games\Skyrim\Apps\Convert Clothing\Convert Clothing RC_61_Light>
Posted

Bah.

 

This should fix that bit of nasty.

 

V.62 Upgrade (Upgrades v.60 to 62): Outdated File Removed

 

V.62 Scripts Only: Outdated File Removed

 

Change Log:

 

1. Resolves crash when loading lattices.

Posted

Convert Clothing Release Candidate v.63
 
This update significantly improves the clothing converter's left/right symmetry for vertices near the X-Axis (within .1 unit of X-Axis).  It also fixes a bug that could cause a crash when loading certain types of lattices.
 
Download

Portable Package Complete (Python, Pyffi, Clothing Converter scripts):

Portable Package Upgrade (Upgrades from v.60, 61, or 62 to v.63)Convert Clothing RC_63_Upgrade.7z
 
Portable Package Light Download (Scripts Only. Recommended if you want to run a 64 bit version of Python): Convert Clothing RC_63_Light.7z
 
Change Log
 
1. Modifies Convert Clothing search to generate improved symmetry along X-Axis
2. Resolves Crash when loading certain types of lattices

Symmetry issue and resolution

DMRA Cuirass Before Conversion

post-20303-0-90420700-1396031809_thumb.png

V .60-62 After Conversion from DMRA to FCPA (Template Generated with UV Search Enabled)

post-20303-0-68839800-1396030022_thumb.png

v.63 After Conversion from DMRA to FCPA (Template Generated with UV Search Enabled)

post-20303-0-13905900-1396030025_thumb.png

v.63 After Conversion from DMRA to FCPA with Z-Axis and X-Axis movement locked on selected meshes (Template Generated with UV Search Enabled)

post-20303-0-26910700-1396032590_thumb.png

For certain nifs and certain conversions, the UV map search actually hurts the quality of the conversion. Here is an example of the same conversion using a lattice with the UV search disabled.

v.63 After Conversion from DMRA to FCPA (Template Generated with UV Search Disabled)

post-20303-0-70664600-1396035517_thumb.png

v.63 After Conversion from DMRA to FCPA with Z-Axis and X-Axis movement locked on selected meshes (Template Generated with UV Search Disabled)

post-20303-0-32023900-1396035947_thumb.png

Posted

An outfit has at least some parts of the original body mesh. Therefore, converting outfits from ADEC to BodySlide CBBE causes problems because the ADEC and CBBE UVmap is different. Therefore therefore, you can't effectively convert outfits from varying bodies to an arbitrary "other" body.

Yeah, It's a doable feature.

 

Basically, the next generation of the Clothing converter will be packaged with a set of UV Map conversion matrices that can be used to match equivalent geometric regions between meshes with known, but different, UV Maps.

 

In addition to that, I plan on re-visiting my Mesh Copy tool to update it and remove some weird bugs. Now that I have a bit more experience with the Nif format than I did when I wrote it, I hopefully can avoid the pitfalls from the last time I attempted to create a tool that could arbitrarily copy geometry blocks from one nif to another.

 

 

 

Version Mismatches between different nif files can make it extremely dangerous to directly copy blocks between nifs and has caused endless headaches. It got so bad that, in the case of Mesh Rigger, I sidestepped the issue of directly copying Bones from a template nif entirely. Bizarrely, when Mesh Rigger copies bones, or even an entire skeleton, from a template to a target nif, it doesn't actually copy the bones at all.

 

It actually builds an entirely new nif with version info that matches the target nif, then it constructs entirely new bones and assigns them the properties of the template bones and adds them to the newly constructed target nif.

 

 

 

 

Now, once the UV Map conversion is complete and Mesh Copy is fully functional, it should be fairly simple to add a 'Mesh Replace' feature to Mesh Copy that would swap one mesh for another, based on some sort of user-customizeable criteria. One example would be to replace all 'skin type' meshes with a different set of 'skin type' meshes.

 

Another possibility would be to replace all meshes with the same base texture path.

Posted

Yeah i wouldn't think that you'd have to do anything complex if the mesh is intact, which would likely be 90% of the time . . . for whatever reason, nobody culls those hidden faces.

Posted

Yeah i wouldn't think that you'd have to do anything complex if the mesh is intact, which would likely be 90% of the time . . . for whatever reason, nobody culls those hidden faces.

I actually have most of the code in place to automatically detect whether or not a given face could be considered hidden.

 

It would take some testing, but I think I might be able to build a 'cull hidden faces' feature into the clipping tool (haven't decided what to call it yet).

 

Unfortunately, the clipping tool failed a fairly low-level stress test last night. I need to revisit my face collision detection algorithm...something isn't working the way it should be.

Posted

Still crashing for me right after I hit "okay" in the clothing converter. Remade the lattice a few times with each new version but whatever it is it's still choking on me when I try to make CBBE->Sevenbase happen. :/

Posted

Send me the files you're working with. I'll see if I can replicate the crash.

 

*Edit* I should note, I'm at this very moment rewriting a section of the tangent space calculation algorithm, and modifying the Lattice generator, so it's possible I already fixed whatever is causing your crash...it's also possible that my development version has a new bug that will cause a new crash.

 

Best if I test using your meshes just to be safe.

Posted

Same here. I've not been able to convert clothing in 60 and 63. I've attached the file tree.

 

Lattice = femalebody_0_from_UNP_BASE_Main_body_V1dot2_to_UNP Topmodel BBP-41051-3-1.lat

Target = northknit_0.nif

 

It runs a while, then issues an error, but the command window closes to fast to read it.

Posted

Thanks.

 

I'll see what I can figure out.  From your logs, it looks like it completed the vertex search and then crashed.

 

Might have been the tangent space recalculation, I spotted a potential crash bug there this morning...on the hunt now for other similar potential crashes in the Normal Vector algorithm.

Posted

Clothing Converter Release Candidate v.64

 

This update should resolve the crash issue reported by orgs1n

 

Download

 

Portable Install Upgrade (upgrades v.60, 61, 62, 63 to 64): Outdated Download Removed

 

Light Install (Scripts Only): Outdated Download Removed

 

Change Log

1. Updated Tangent Space and Normal Vector calculations to eliminate potential zero division errors

2. Improved fidelity of Tangent Space calculations near UV seams

3. Reduced console spam during vertex searches

4. Make Lattice and Convert Clothing tools now split match searches into left side axis and right side axis searches. This should improve the symmetry of both lattices and clothing conversions.

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...