Jump to content

Batch tool to apply glossiness and specular strength to meshes (e.g for oily body while wearing armor))


Hyperenor

Recommended Posts

Posted

Hello everyone ! To have an oily body effect while wearing armors/clothes, etc, I use the method where I edit the meshes (.nif file) with NifSkope to manually set the glossiness and specular strenght. It's quite tedious, especially if i want to do this for every meshes generated by bodyslide for example. So I quickly made this litte tool to automate the process.

 

Bewary that the tool is in early stage, you may encouter bugs and it is sadly quite slow. For now, please, process only meshes that you can quickly rebuild (through bodyslide for example), if a meshes is somehow corrupted in the process. Also, it has difficulty to handle large amount of files. Please proceed by small batches.

 

Hope you find it useful despite its flaw ! If you have some suggestions or encouter some bugs, feel free to let me know !

 

 

More Information on GitHub

 

 

HTool - NifBatchTools

 

HTool - NifBatchTools is a tool to apply desired glossiness and specular strength to all meshes with body parts, contained in the target folder. The goal is to be able to have an oily body effect, while wearing armor/clothes, etc. It only affect body parts, so meshes with no visible body parts will not be modified. To see if a mesh has to be modified, the tool is looking for a block whose name is matching one of the keywords (defined in the .ini). If not the mesh is ignored, otherwise the parameters are applied. It automatically overwrite the mesh once, and if, modifications has been made.

 

 

Preview of the tool


tool.png.7c04d597b3c3b376da67f15b6f89a3f7.png

 


Dependencies

 

  • Verified only on meshes defined for Skyrim Legendary Edition. It should works with SSE but I did not test it.
  • Verified only on meshes using UUNP. For CBBE bodies, it may be necessary to modified the list of keywords (very easy to do, please see Instructions)
  • Not a hard dependency, but if you have NifSkope installed and set as the default program to open .nif files, you can easily open a mesh with it, by double-clicking on an item from the list.

 

 

Download

The tool is available on GitHub. You can either :

 

 

Basic Usage

 

  1. Specify the folder you wish to scan for meshes (usually the folder containing meshes generated from bodyslide). It will register every relevant meshes
  2. Set desired glossiness and specular strength
  3. Click on Apply. It is sadly very slow (13 minutes for 100 meshes). The process is bottlenecked by the library I used to read and write .nif files. I can't do much about it. I implemented multi-threading but the I/O is what takes most of the time. Don't try to move the GUI and interact with it too much if you process a large amount of files.
  4. You can check if the values have been correctly set by opening the file in NifSkope (If it is installed and set as the default program to open .nif files, you can open meshes directly from the tool by double-cliking on an item in one of the list).

 

NOTE : A default htool.ini is generated at the same location as the executable, if none is present. Take a look, you may wish to change some settings, such as : default glossiness and specular strength, list of keywords, etc.

If a mesh is not processed, it probably is because the corresponding block has not a name that is defined in the list of keywords. To find what keyword you must add and how to add it, please refer to the doc on GitHub.

 

 

How does it work ?

 

The tool try to find in the mesh, a NiTriShape block, whose name is one of the keywords. As they are several NiTriShape block, only the one who represents a body part, should be modified. That's the role of the keywords. The default ones are as follow : UUNP, FemaleHead, Hands, Feet, CL0, CL1

 

I added CL0 and CL1, because they are used by an outfit mod to describe the body part.

 

How to report a bug

Please describe precisely what happened and also include the .log file ! The more information you give me, the more I can help you. Without the .log I can't do much.

 

 

More Information on GitHub

 

 

Posted

40MB for that small program ? o.O

But ok ill try it... normaly im using ENB i love Oil/Wet everything so its fine for me if rocks etc. have oil effect

 

Also ENB applay it to Outfits ❤️

 

Sometimes i even edit Latex Outfits to make them more Oil :o...

one good thing about ENB is that You can change Oilness any time You want xD

 

 

 

 

Once i fix my game - i broke something again - i will test Your program :o !...

Posted

Hello TobiaszPL

 

In the archive (which is rougly 40 MB), the executable is by itself 2 Ko, The rest is taken by the dependencies so you don't have to download anything else. Most of the space is taken by PySide (Qt), which is quite heavy. When uncompressed, PySide2 takes 50 MB without the .dll, which add another 20MB.

 

If you wish you can also apply glossiness and specular strengh to armors parts by editing the keywords, in the .ini. Since you seem to know how it works, you just have to add the name of the NiTriShape block you wish to be processed.

 

 

Posted

Ok everything nice...

but...

 

Can You plz make this loaded and ignored .nif list longer?...

and can you "cut" file name to show only Data/../../.. ? ignoring directories before??

 

also... can You add... or im blind...

button to "remove" .nif from list?... there is some armors i would want to not change :x...

 

Spoiler

5156.png.cc7c47c18c5178a8e5135e6fbbfdc94f.png

 

And... always when i wanted to change glossines i load .nif file with ARMOR...

Why my Armors are ignoread and CalienteTools are loaded ? :o...

 

My whole life i was doing wrong ? xD...

Posted

1. (List view size) So for the list view, you can resize the window to make it bigger. The window open with the minimum size to accomodate lower resolution. Beware to do this before you apply the patch as the GUI will become mostly unresponsive

 

2. (Path Size) Idem, you can resize so the whole path is visible

 

3. (Remove item) Good point, I'll add it.

 

4. (Mesh ignored). The purpose of this tool was to apply the parameters to body parts and not armor parts, but it can be tweaked to do so. For this, the tool doesn't discriminate a file based on its location, but based on the presence of a NiTriShape block whose name is specified in the keywords list. By default, they are:

 

UUNP, FemaleHead, Hands, Feet, CL0, CL1.

 

It's done on purpose so that only the body part of a mesh is modified and not armor parts. If you wish, for the armor part to be modified you will have to add the relevant name in the keyword list. However, in general, they are very different from mod to mod, so in the end you will end up with a huge keyword list. There is instructions on the GitHub readme, on how to find the keyword and on how to add it, so a mesh part can be affected by the process.

Posted

Why use a external tool that modify every piece of armor and must be excuted again each time you add a new armor? If you run BodySlide for change your body and make a batch build you must run the tool again.

 

Why you not use Wet Function Redux that change in game the NiOverride properties of every nearby npc and can make it dinamicaly depending of the wheather or the aroused level and is automatically applied to all body types and suport any armor that you want.

 

With your tool ALL npc's have ALWAYS the same glossiness whitout exception. 

With Wet Function Redux every npc can have a diferent glossiness no mater the armor or clothes wearing.

And not need any especial ENB config because works without ENB.

 

 

Posted

I'm not sure the objectives are the same, especially because you mentionned you do not need an ENB. Tweaking specular strength and glossiness is mostly based on your visual setup, and so an ENB.

 

To be sure Wet Function Redux is changing textures, to be more sweaty or not, based on several conditions, or does it also modify the meshes ?

 

The goal here is to modify the mesh file so that the texture appears differently. It is my understanding that you have to tweak the glossiness and the specular strength (of the mesh) based on your visual setup (lighting mods and ENB), to have the desired oily effect. With the same sweaty textures, different values can make the body appear more oily or not.

Posted

For that Wet Function Redux have the MCM. For change the max and min values to perfectly match yours preferences. And yes, add textures for wet effect but the glosiness effect is disable by default. If you only want specular and glosiness you must configure it in the MCM.

 

I recomend you download, install and test Wet Function Redux because make exactly the same that make your tool in a dynamical way changing the specular and glossiness values ussing the function

NiOverride.AddSkinOverrideFloat

and have exactly the same results no mater the armor or clothes wearing. See the code:

Spoiler

    If specularEnabled
        UpdateSNFloat(specular, nifSpecularKey, slot, node)
    EndIf
    If glossinessEnabled
        UpdateSNFloat(glossiness, nifGlossinessKey, slot, node)
    EndIf
    If regenHead && updateTex && isPlayer
        act.RegenerateHead()
    EndIf
    Return defaultTex
EndFunction
Function UpdateSNFloat(float value, int nifKey, int slot=0, string node="")
    Float currentValue
    If slot
        currentValue = NiOverride.GetSkinPropertyFloat(act, false, slot, nifKey, -1)
    ElseIf Node
        currentValue = NiOverride.GetNodePropertyFloat(act, false, node, nifKey, -1)
    Else
        Return
    EndIf
    If currentValue!=value
        Log("Updated float for "+LabelSN(slot, node)+" of nifKey ["+nifKey+"] to ["+value+"] from ["+currentValue+"]", -4)
        If slot
            NiOverride.AddSkinOverrideFloat(act, fem, false, slot, nifKey, -1, value, false)
            If firstPerson
                NiOverride.AddSkinOverrideFloat(act, fem, true, slot, nifKey, -1, value, false)
            EndIf
        Else
            NiOverride.AddNodeOverrideFloat(act, fem,  node, nifKey, -1, value, false)
        EndIf
    EndIf
EndFunction

 

Posted
On 10/18/2019 at 3:25 AM, TobiaszPL said:

Genio, WetFunction is useless and very limited :x...

and also works only sometimes xD

 

ENB or .NIF edit only :o !...

 

Can you explain WHY you say that non sense?

Posted

Because its true?...

 

WetFunction is useless...

1) idk why but it not always works - at least for me sometimes body is without glossines and specular once i change outfit

2) have very limited options - value between 10 and 1000 wow !...

3) Need time to restart like 2/3 sec and you change values inside Menu so you have to close Menu in order to see changes

 

 

with NifScope and ENB You can see changes in real time lol

First you can set Glossiness and Specular with NifScope and then copy values to Hyper Program

so you can applay changes to every single mesh :x...

 

 

Best to change Glossiness and specular is ENB - WetFunction is waste of Time, Mod for stupid ppl...

other thing is This topic .exe program to change or NifScope - you change once and you never ever have problems with stupid WetFunction 

 

but that wasn't my explanation, my exmplanation is:

 BECAUES I CAN !.... ?????????????

 

Can you explain =WHY= you say that non sense?...

 why You recomend to use WetFunction?...

 

 

//Edit:

as long i can see "Post" button thats my explanation to every my post :)...

Posted
20 hours ago, TobiaszPL said:

1) idk why but it not always works - at least for me sometimes body is without glossines and specular once i change outfit

2) have very limited options - value between 10 and 1000 wow !...

3) Need time to restart like 2/3 sec and you change values inside Menu so you have to close Menu in order to see changes

That is a problem in your game because 58k downloads in 3 years and only 20 pages in the support topic mean that Wet Function Redux not have any problem.

I know that some special body's from some personaliced races are not compatibles with NiOverride.

In the same way, some armors have bad parameters in the body parts included inside the armor. 

Make test for determine if your problem is caused by personaliced race or specific armors.

 

The Max and Min options are exactly the Max and Min values suported by NifScope.

The mod have an OnUdate script that run every 2 seconds. I think is not a lot of time.

The MCM is only need for for configure the mod. I not open the MCM after configure it.

Of course, the first day or week you need open the MCM a lot of times for understand what make each parameter.

 

20 hours ago, TobiaszPL said:

with NifScope and ENB You can see changes in real time lol

First you can set Glossiness and Specular with NifScope and then copy values to Hyper Program

so you can applay changes to every single mesh :x...

And you always end with exactly the same Glossiness and Specular on every NPC and a false Glossiness in other mesh like rocks, weapons, armors... For change the Glossiness level you must close the game, process all the mesh again, open the game for see the result and look if the body's look better or if the Glossiness in the rocks is less. If not like the results you must repeat the process.

 

With Wet Function Redux you can have a diferent Glossiness on every NPC and have it only and exclusivelly on body mesh, not in rocks, weapons or armors. You can change the level of the Glossiness in game and see the result in some seconds whitout close the game.

The visual diference in game is tremendous, at least for me, because i hate the reflecting rocks.

 

You like the reflecting rocks? Good for you.

You think is better manage the Glossiness with ENB making changes in the mesh? Good for you.

You want have exactly the same Glossiness in every npc? Good for you.

 

If you not want waste your time simply use Wet Function Redux.

Not need modifiy the mesh. Can have diferent Glossiness in each npc. Can change the Glossiness level in seconds whitout close the game. Affect only body mesh. Can be better?

  • 1 year later...

Archived

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

  • Recently Browsing   0 members

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