changing/adding material to an existing hair prop

I want to dye only the front curl of a hair prop (is wearable hair also called "prop"?) in a different color. When I change the hair texture, I get colored strains all over the hair. So my idea is to export the hair to OBJ, import that into a program like Blender, select those strains I want to color, assign a new material to them, and bring it back into DS. But I haven't succeeded with that.

Loading a new UV set didn't import the new material. My guess is that the menu command update base geometry might do the trick, but I can't get it to work. Unfortunately, this tip https://www.daz3d.com/forums/discussion/60689/can-t-get-update-base-geometry-working didn't help since the hair prop only has base resolution. My hope is that I'm just using the wrong settings when exporting the hair to OBJ. Because when I export it and try to import that very file right back in with update base geometry it still says The loaded gemetry does not match the geometry it is updating. Vertex and facet count must be the same.

Or is there a way of adding a new material in the surface tab and assign parts of the geometry to that new material within DAZ Studio?

Comments

  • SixDsSixDs Posts: 2,384
    edited January 2020

    What is commonly referred to as "prop hair' tends to be comprised of a single mesh - of the sort one might use for toons. The most commonly encountered type of hair is (usually) comprised of a skull cap to which strips of geometry are attached = strip hair. The illusion of individual strands is created through the use of transparency maps (images) that are plugged into the corresponding channel in the Surfaces tab in DAZ Studio. The third type of hair is commonly referred to as "strand-based" hair, and is comprised of actual individual geometries forming strands that are also attached to a skull cap or base. What you are attempting to do will be dependent upon which type of hair you are dealing with. It is possible to see this by changing to the Mesh view in the viewport, if you do not already know.

    If you are lucky and have a strip-based hair, then it probably comes with diffuse or base colour maps, which can be edited in an image editing program such as Photoshop, etc. to give you the transitional colour effects that you desire. If it is a true prop hair, then it may have colour maps, or, because it is a very simple type of hair, possibly procedural (= single colour) materials. Similarly, strand-based hairs will often use procedural materials for colour rather than maps. In either of the latter cases, your enquiry regarding geometry would be on the right track, although I don't know how difficult that might be with a strand-based hair comprised of hundreds of hair strands. In any event, you would normally want to create new material zones for the two different colours using the Geometry Editor tool within DAZ Studio. If you can do that, you will have two new material zones that you can colour as you wish.

    If you could tell us the name of the specific hair that you are working with, that might allow us to give more specific advice.

    Post edited by SixDs on
  • thilionthilion Posts: 57

    Thank you for that elaboration. I knew that there is a difference between "pro hair" and strand based hair, but I didn't know that the pro hair has a subcategory, strip hair. I have seen that kind of hair before, but what I am testing here is the basic tolouse hair.

    However, I have already found out what error I had made. I thought, since I only want to update the materials, I'd only click "Read Surface" and "Read Material Library" in the import dialogue. When you do that, you'll get that error message. When you also activate "Read Faces", no errors will occur. The rest can be unchecked. I haven't noticed any difference when the other 3 options are also enabled. At least not with the changes I had made (assign part of the geometry to a new material).

    So, problem solved :-)

  • thilionthilion Posts: 57
    edited January 2020

    I'm still trying to add a new material, because the method with updating the geometry didn't work all the way. The geometry_library wasn't saved in the dsf-file. The result was only blocks as hair. My guess is the bounding boxes. So I copied that geometry_library-part out of the original dsf-file, and then it worked again, but all the material-changes were gone.

    So I investigated the dsf-file a little further. There is this section:

    			"polygon_groups" : {				"count" : 2,				"values" : [					"Head",					"Neck"				]			},			"polygon_material_groups" : {				"count" : 3,				"values" : [					"Strands",					"Hair",					"Base"				]			},			"polylist" : {				"count" : 26088,				"values" : [					[ 0, 0, 0, 1, 2, 3 ],

    I found out what the 6 values in the polylist-listing are. The first number is the entry from the polygon_groups, the second number is the entry from the polygon_material_groups, and the other 4 numbers are the vertices of the corresponding face. I have experimented with the first two numbers, and my theory was proven.

    So I thought, it should be possible to add a new material to the polygon_material_groups. Unfortunately, it doesn't. I then tried to simply change the name of an existing matrial, to see where the changes need to be made. Actually, it doesn't matter what the values within the polygon_material_groups are. The materials in the Surface tab in DAZ Studio still have the original names.

    I have made changes to the corresponding sections of the material_library in the duf-file which is the hair-prop that you click in the Content Library. I added a word to the Tags-value. That change can be seen in the material in the Surface tab, but the name of the material in the Surface tab doesn't change. I have changed all occurances of the name of the material in the duf-file and the dsf-file, still the original name in the Surface tab. After that name-change, the corresponding material in the Surface tab has the default-shader after the change, because the material with the original name cannot be found.

    Does anyone know where the list of materials, that can be seen in the Surface tab, is being defined?

    Post edited by thilion on
  • thilionthilion Posts: 57
    edited January 2020

    A screenshot might help

    Screenshot_2020-01-09 011233.jpg
    615 x 465 - 50K
    Post edited by thilion on
  • Catherine3678abCatherine3678ab Posts: 8,388
    edited January 2020

    You cannot change the assigned material zones.

    You can make a new uvmap and rearrange the islands so you can colour the curl importing the new uvmap obj and making a new uvset. You could then apply a different image [surface panel] to the model to colour the curl.

    You can change the names of the materials that appear on the Surface Tab using the geometry editor brush and the Tool Panel. [done when making new items, not for existing products]

    You could also just change the colour of the one curl in post work.

     

    Post edited by Catherine3678ab on
  • chris-2599934chris-2599934 Posts: 1,835
    edited January 2020
    thilion said:

    Or is there a way of adding a new material in the surface tab and assign parts of the geometry to that new material within DAZ Studio?

    Yes there is, it's called the geomtetry editor.

    Select the hair (probably easiest to do this before you fit it to the figure) and choose the Geomtery Editor from the tools menu. Select the polygons that you want to move to a new surface, then right click and assign those polygons to a new surface. It's a fiddly tool to use, so I suggest you search for some tutorials on how to use it, here's one to start with: https://www.daz3d.com/forums/discussion/166896/the-material-zone-geometry-tool-tutorial-shaders

    Once you have your new surface, the polys concerned will be plain grey. I suggest you copy the surface properties from the original surface they were in, and then change them as required.

    Post edited by chris-2599934 on
  • thilionthilion Posts: 57
    thilion said:

    Or is there a way of adding a new material in the surface tab and assign parts of the geometry to that new material within DAZ Studio?

    Yes there is, it's called the geomtetry editor.

    [.............]

    Thank you very much! I will absolutely try that out.

    While I was offline today I have composed another reply in response to Catherine, which goes down a totally different path. But I will try out your suggestion!

  • thilionthilion Posts: 57

    You cannot change the assigned material zones.

    You can make a new uvmap and rearrange the islands so you can colour the curl importing the new uvmap obj and making a new uvset. You could then apply a different image [surface panel] to the model to colour the curl.

    You can change the names of the materials that appear on the Surface Tab using the geometry editor brush and the Tool Panel. [done when making new items, not for existing products]

    You could also just change the colour of the one curl in post work.

     

    Thank you Catherine3678ab for replying. However, UV-mapping and materials are not directly associated regarding the geometry of an object. A UV-map is a translation table that tells the software what vertex in 3D-space is linked to which 2D-coordinate on a texture. A material doesn't have to contain a texture. The DSON specifies that polygons are linked to a material. With the help of a UV-map a texture may be associated with the material, but that's optional (see http://docs.daz3d.com/doku.php/public/dson_spec/object_definitions/geometry/start). Such a surface would be just flat and colored, though.

     

    I am currently studying the DSON specifications (http://docs.daz3d.com/doku.php/public/dson_spec/start). DUF- and DSF-files use that format (DSON User File and DSON Support File). A simple object only needs one of those files each.

    For testing purposes, I have created triangles and assigned their faces (polygons) to a material. Thus, the corresponding DUF- and DSF-files are quite clearly arranged.

     

    So, this is my very simple object in DSON (DAZ Scene Object Notation):

    {  "id" : "triangle",  "vertices" : {    "count" : 4,    "values" : [      [ 2.5, 0.0, 0.0 ],      [ 0.0, 4.0, 0.0 ],      [ 5.0, 4.0, 0.0 ],      [ 2.5, 8.0, 0.0 ]    ]  },  "polygon_groups" : {    "count" : 1,    "values" : [ "default"]  },  "polygon_material_groups" : {    "count" : 1,    "values" : [ "mat_1" ]  },  "polylist" : {    "count" : 2,    "values" : [      [0, 0, 0, 1, 2],      [0, 0, 1, 2, 3]    ]  }}

    The first number in the values-array of the polylist is the index within the polygon_groups.

    The second number is the index within the polygon_material_groups.

    The rest of the numbers are the indexes of the vertices.

     

    So, we have 2 triangles that sit on top of each other. Both are linked to the same material. The details of the material, such as shader settings, are further defined in the material_library, which is located in the DUF.

     

    What I want to do now is to add a material in the DSON. I did so and – to my best knowledge – also made all necessary entries in the material_library. However, when I load the “triangle prop” into DS, only the first material mat_1 is shown in the surface tab.

    I am clearly missing something. The question is: what? I couldn’t find any hierarchical properties like the parent property in a node asset.

     

    Catherine3678ab, as you can see, I’m not looking for a solution with the tools provided in DS such as geometry editor. I want to do this on the very basic metadata level. Nevertheless, I do thank you for the time you have taken to read my reply to the end  :-)

  • thilion said:
    .... edited

     

    Catherine3678ab, as you can see, I’m not looking for a solution with the tools provided in DS such as geometry editor. I want to do this on the very basic metadata level. Nevertheless, I do thank you for the time you have taken to read my reply to the end  :-)

    We do not normally go about editing files to make changes, lot easier to use the tools provided in the program. Have fun ;-)

  • thilionthilion Posts: 57

    We do not normally go about editing files to make changes, lot easier to use the tools provided in the program. Have fun ;-)

    I understand that, although the tutorials from Josh Darling made me approach that rather difficult but effective way. And I did try the geometry editor. Using it would help me to get done what I want to do (apply a new material to selected polygons of a prop/figure), however, it is not easy to select all the many poligons I want to change with the geometry editor. It was easier for me to identify the poligons in the DSF-file and make the changes with a little script. I did use the geometry editor to add a new material to the DUF-file. That saved me from a lot of copy/paste/edit.

    As for the weird results I was constantly getting: I couldn't believe the simplicity of the problem's solution. I had tested so many changes in the DUF- and DSF-files. The thing is that all changes were present each time I reloaded the prop, except for the material. The problem is - either a bug or by design - that DAZ Studio appears to have a material-library cache. So each time you delete a prop (or figure) and reload it, all data is being read from the DUF/DSF-files, except for the materials.
    This revelation came by chance, when I shut down my computer for the day and started up the software next day. Suddenly all changes were there, including the new material. I found out that you don't have to shut down and restart DS, but starting a "new session" by choosing File > New obviously clears the chache for the material-library.

    So, when you are changing the DUF- and/or DSF-files and want to reload your prop/figure to check your changes, make sure to clear all caches by hitting File > New before reloading the file into DS.

  • thilionthilion Posts: 57
    thilion said:

    Actually, it doesn't matter what the values within the polygon_material_groups are. The materials in the Surface tab in DAZ Studio still have the original names.

    I have to correct my previous statement. It does matter! The list of materials in the polygon_material_groups is exactly what will be listed under the Surface tab, however, you need to clear the material_library cache (I assume that is what it is called) before that change will have an effect. Either choose File > New from the menu or if that doesn't help, restart DS.

Sign In or Register to comment.