Hairblending script for DAZStudio
I'm finally getting around to releasing this. Hopefully others will find it useful. Download it from here and just merge it into your library.
From the README:
Outoftouch has produced a number of hair props for Poser/DAZ Studio that include a "HairBlending" feature.
As released, this feature is automated only in Poser Python. This script reimplements that functionality in
DAZScript.HairBlending works on any hair with a vertically oriented UV and straight strips. Simply select all the hair
materials in the Surfaces tab that you wish to blend, then launch the script. Choose, from top to bottom,
a "Base", a "Layer", and a "Mask", then *Do It*. HairBlending will use the L.I.E. to create your hair texture.
The script, and OOT Hair Blending in general, should be renderer agnostic as it only edits the diffuse channel.NOTE: Outoftouch has graciously allowed me to release icon versions of the hair textures used for hairblending.
Comments
sweet, thanks!
The lower part is unreachable, the window is too "long"...
Thanks a lot, I'm going to try this out when I get home and have access to my Ocean Hair.
Hmmm. I'd have to make it two columns wider to make it any shorter (or reduce the icon size). What's your monitor resolution?
1366x768
Pretty small, I know...
Or add scrolling...
Yeah. I looked at that, and will again. GUI programming isn't really my thing. Maybe this weekend.
How groovy! Thank you.
One Temporary Solution That Works Is To Go To The Runtime/Textures/Esemwy Folder
And Delete Some Of The Non Natural Color Icons That You Know You're Not Going To Use Such As The Blues,Greens,Ect.
This Works.
Thanks this looks interesting...
OK, scrolling works well enough that it'll fit within that 1366x768 monitor. If anyone has a better solution, please speak up.
'It is a very good size indeed!' (paraphrased from Alice in Wonderland)
But what I meant to ask is: is this script specifically meant to be used with OOT's products only, or can it be pointed to textures obtained elsewhere?Well, the icons are small versions of the textures, but you could recreate that easily enough. The names of the icons allow me to easily look up the textures in Runtime/Textures/outoftouch/!hair and its subdirectories. For example the icon named
01.hair.jpg
allows me to know that the texture to use is01OOTHair.jpg
in theOOTHairTextures
directory. Everything you'd need to change is either at the top or bottom of the script. Oh, and for whatever reason, the textures are 1.5x the size of the masks.If you can send me a listing of your texture paths and the image dimensions, I can create a fork of the code for you.
Ooh, now that you've explained that it's the icon names you use as "keys" (very elegant; I never noticed DAZ Script can pick up file names from a directory like that), I understand now how to adapt this to my (rather gigantic and messy LOL) library =) So thank you for the offer, but I guess I can do this myself.
I got the new version, it's perfect! Now I can use it, thanks!
Does this script only work on OOT hair products??
The script will work on any hair that has vertically oriented textures, but, as written, it's dependent on textures included with OOT hair products for sale on Renderosity. It's designed as a work-alike for the Poser Python script included with OOT hair.
This looks fantastic thank you!
Awesome!
But, am I the only one that is having problems getting this to work?
Maybe I'm doing it wrong??
I select the hair figure, select the zones I want to change then run the script - and nothing. :(
I have several OOT hairs that came with the Hair Blending options installed so I assume it isn't that.
Thanks :)
Can you tell me what's at the end of your error log after running the script?
Loading script: C:/!3D Content/Non DAZ3D/Scripts/Esemwy/OOTHairBlending.dsa
Script executed successfully: C:/!3D Content/Non DAZ3D/Scripts/Esemwy/OOTHairBlending.dsa
EDIT: I'm on 4.9 if that matters?
Perhaps it is a path problem. Is "C:/!3D Content/Non DAZ3D" set as one of of your "DAZ Studio Formats" content paths and have you installed the icons in "Runtime/Textures/Esemwy/HairBlending"? In addition, it looks for OOTs textures in "Runtime/Textures/outoftouch/!hair" using the content manager. It's possible it behaves a bit differently on Windows.
I'm running 4.9 as well, and even when I don't have anything else installed properly, I still get a dialog even though it's missing all the icons.
If you right click on the script and select "Open in Script IDE...", is it 206 lines long and ends in "main();" ?
If you select File->Run [Continue] Script..., does it still behave the same?
If this doesn't get us anywhere, I'll send you a version of the script with more extensive logging, and we'll go from there.
Yes that directory is set as both DS Formats and PS Formats - contains products from Rendo. I also have your product saved to the same directory.
I do get the nice dialog when I click the script - I'm able to select from the 3 categories but when I select the "Do It" button it goes away and does nothing. The diffuse textures remain the same. It does remember my previous selections though when I restart the script.
I'm showing the script as 206 lines with the last line being the main(); - Running through the Script IDE does the same thing.
OK, I suspect it's not finding the actual texture directory, but regardless, I added a bunch more logging and error checking. Download the new version here.
Thanks so much for this script! Super handy! I was just curious if it is possible to add two more texture directories to the script some how? I have the OOT Iray Hair Textures plus the OOT Iray Hair Textures Xpansion. Can you give me an example of what to add to the script if possible? The folders are located in:
...\Runtime\Textures\outoftouch\!hair\OOTHairIray
...\Runtime\Textures\outoftouch\!hair\OOTHairIrayXP
Would it be easier to just copy the textures I want and make icons for them? It looks like your script automatically counts/adds the textures in there.
I have the same expansion, but never itegrated them with the script. You'd need to create icons such that the names of those icons could help you look up the directory where the actual texture exists. It's probably easier to create a merged set of textures in a single directory and new icons to match their names. The current limitation comes from using the digits at the beginning of the icon name to determine the texture name.
Hmmm... I just had an interesting idea that would allow people to extend this to arbitrary textures without modifying code. I'll get back to you. In the mean time feel free to hack at it. I believe @Mustakettu85 did something similar.
What I did was actually modify the code and make several modified copies for different texture folders scattered on my hard drive =) Crude but easy to do LOL
@Esemwy That is interesting; I'll wait 48 hours then start hacking the script myself if you don't make any moves by that time.
@Mustakettu85 Do you think you could post an example of your script?
New version available here. I only have permission to use icons from OOTHairBlending, so out of the box, this does nothing new. If, however, you install new icons in the magic icon directories, the script will use the corresponding textures as well. You may want to clean out the old icons from Runtime/Textures/Esemwy/HairBlending, but leaving them in place won't break anything.
Here's what I've done: (From the README)
The icon folder in Runtime/Textures/Esemwy/HairBlending has been rearranged to accomodate expanding the textures supported by the OOTHairBlending script. There are two icon sub-folders, hair and alpha. These directories directly parallel Runtime/Textures such that the icon name under alpha or hair can be used to lookup the complete texture name.
Example 1:
Runtime/Textures/Esemwy/HairBlending/hair/SWAM_Art/04IrayCol/SW_Iray_Col02_C.jpg
Runtime/Textures/SWAM_Art/04IrayCol/SW_Iray_Col02_C.jpg
Example 2:
Runtime/Textures/Esemwy/HairBlending/alpha/outoftouch/!hair/OOTHairAlpha/01OOTHairAlpha.jpg
Runtime/Textures/outoftouch/!hair/OOTHairAlpha/01OOTHairAlpha.jpg
In order to add your own icons, all you have to do is copy your hair textures to the
Runtime/Textures/Esemwy/HairBlending/hair/
directory (or the alpha sub-directory if they are masks), while maintaining the same sub-directory structure, and resize the images to 50x50 pixels.