[Solved] Character Preset: How to set Eyelashes color using a Post Load script ?
Hello,
I'm trying to create a character preset for Genesis 8.1 (I'm not sure it's different with other generations) and after watching a useful video by Josh Darling (thank you!), reading various messages in relation to Post Load (thank you @crosswind for your various tutorials!), I'm almost where I want to be: I'm currently able to load and set the color of the eyebrows (and understand why it didn't work initially…) but setting the color of Eyelashes is not working and I don't understand why I'm doing wrong.
Here is how my Post Load Settings currently look:
In this screentshot, I'm using H.mat preset, but I also tried with a standart material preset (setting the boolean to True). Both are stored in the My Library folder (located in my Documents folder on my Mac and Daz is authorized to access it).
Applying them manually works, but in both cases, when I'm asking the Post Load script to load either of them, the Eyelashes are keeping their default surface setting. I looked at the log and according to it, Daz does find the file, does something with it, seems happy with the result and continues to the next steps without raising any warning or error.
Here is what I think is the relevant portion of the log (in this case, using a standard material preset):
[INFO] :: Prepare asset load (merge): /Presets/Characters/Materials/Eyelashes.duf
[INFO] :: Locking viewport redraw...
[INFO] :: Viewport redraw locked.
[INFO] :: Native format content directories: 23
[INFO] :: Poser format content directories: 4
[INFO] :: Other import format content directories: 0
[INFO] :: Begin asset load (merge): /Presets/Characters/Materials/Eyelashes.duf
[INFO] :: Determining missing assets...
[INFO] :: Setting textures...
[INFO] :: Creating materials...
[INFO] :: Applying animations...
[INFO] :: Finished asset load (merge): 0m 0.21s - /Presets/Characters/Materials/Eyelashes.duf
If someone has an idea about what I'm doing wrong, I'm all ears
Comments
One thing to check is what's in the H-MAT, are there material settings for other items in it, if so then that's why it's not working as Post Load wont use the MAT if there is.
Post Load script works with both Mat and H.Mat presets. I see no issue from the settings in the screenshot that you posted... but in DS log you pasted, it tells another preset file : "Eyelashes.duf" rather than "Eyelahses (H.Mat).duf" that was set in Post Load script ...
I wonder if the character preset with Post Load scritp has been correctly saved... Can you open the character peset DUF file with Notepad++, and check if the path + file of the H.Mat Preset is correct (at the bottom of the file...) ?
I'm not sure if I checked the right section, but the scene section in the H.mat file is very similar to the one in Victoria 8.1 Mat file (with Eye brow instead of Eyelashes referenced in the later).
Here the scene section from my H.mat file:
Eyelashes.duf is the standard material file, I tested both but I initially looked at the log only when it was loading the standard materials preset. I also tested with a wrong file to see what was different in the log.
The log with the H.mat file is not very different (test done a couple of minutes ago):
Standard mat file:
If so, it's odd... Is there an H.Mat Preset file with the very same name but locates in another Daz Library of yours, which could be firstly loaded... ?
Or, you may try my files with the same Settings on a G8.1F Dev Load with pink eyelashes... (extract the enclosed folder to your Daz Lib... then load the char preset "G8.1F Dev.duf"...), see if it'll work.
Default Post Load setup for G8.1 is that the Eyelashes do not call a MAT file, instead it's the H-MAT called by the Tears that gets applied to both.
Now your Tears are calling the default H-MAT for both the lashes and the tears, which is breaking the Post Load.
Post Load is very touchy and can be easily "broken", especially with H-MATs.
I've recently "fixed" a H-MAT issue for a G9 character one of my friends bought, the character preset loaded a morphed grey golem, and she couldn't understand why as all of the MATs worked when applied. The issue was the H-MAT Post Load was using, it was looking for the genitals while the Post Load wasn't.
I don't think so: I tried with various names.
With you test file, it does work.
Would creating a H.Mat file with setting for both the tears and the eyelashes, then loading it after the tears are loaded solve my problem ?
That's it ! I missed that Tears using an H.Mat Peset which is loaded after lashes H.Mat, as Bejaymac said ~ Yes, you can replace it with the H.Mat preset that you created, or place the settings of Eyelashes to the bottom in Post Load script.
I tried another solution: I moved the H.mat eyelashes under the Tears setting, at the end of it.
And it worked
I did it that way because I saw that what was loaded after the Tears was a file placed under a 'Script tools' directory and I wasn't sure that I would catch everything with a H.mat files. It's likely less efficient, because I think I'm reversing what happened until now (having my presets replaced by the default ones) but at least, I'm sure I'm not missing something the default .duf file is doing.
Thank you both for your help