Materials similar name not correctly imported.

Issue #926 resolved
bouich jules created an issue

Hello,

so i’ve noticed this weird problem that i never saw before with my environment.

so this is how my mesh looks in blender:

and this is how it looks in DAZ:

i think this problem occcure because the materials name are similar in daz i guess.

anyway in both case i have uploaded the dbz and duf file in attachment,

Thank you!

Comments (14)

  1. Thomas Larsson repo owner

    This is a strange asset. The plugin uses material names to identify the materials, but this mesh has several materials called “1” (cf. the polygon_material_groups entry in the duf file) which are not the same material. To handle this case, a new global setting was introduced: Materials By Numbers. If enabled, it will use the material index rather than the name to identify the material. This option is disabled by default, because I’m not sure what will happen with other assets if it is turned on. But if you enable it, different materials are imported. I cannot verify that the correct textures are assigned to each material, because I don’t have the textures, but there are different materials with different textures.

  2. Alessandro Padovani

    Just for info.

    In daz studio if I try to create a new material with a name that already exists, then I get an error from the geometry editor. So it doesn’t seem possible that two materials get the same name. May be that asset is imported from another package. In this case it may be a bug with the daz importer that doesn’t rename materials with the same name.

    @bouich Where did you get this asset is it imported from a game engine ? If so there’s no need to use daz studio you could import it in blender directly probably getting a better result. And of course I assume the asset is available for free since you redistribute it here.

  3. Thomas Larsson repo owner

    Something strange is going on here. In the Surfaces tab there are only two materials, 1 and 2. However, the duf file contains a material library with 30 materials called 1, 1-1, …, 1-29, which correspond to 30 materials in the scene called 1-30, 1-31, …, 1-59, which differ by their diffuse textures. Perhaps there is some way to group materials together so you can edit all of them at once, like you can edit all Skin or Skin-Lips-Nails materials together.

  4. Alessandro Padovani

    Personally I believe this is a glitch you get in daz studio when importing materials from a game engine. Probably because of a bug in the importer. But have no way to verify this until @bouich explains how did he get this asset.

    If the “game engine“ theory is correct, then we may move the “Materials by Numbers“ feature in the debug section since it handles a bug in daz studio and has nothing to do with “normal“ daz materials. Also renaming to “Materials by Index“ with a tooltip “Fixes a bug in daz studio when importing assets from game engines.“.

    edit. The geometry editor reports a number of surfaces with the same name that’s usually not possible in daz studio as explained above.

    edit. important. Also please note that all the “1” surfaces but one get no polygons assigned, so the useful materials are just two as reported in the surface editor. When importing materials we could skip those having zero polygons assigned, this could be a general fix, and in this case also removes the duplicated names.

  5. bouich jules reporter

    Hello,

    So i use a script that can help me bring all MMD format ( there is ten thousands of MMD out there on the internet) to DAZ, so it’s like having the possibility to import another huge catalogue of item to DAZ. which is just amazing and impressive. the script help me import 100% textures and rigs and everything. Works perfectly. ( it’s like diffeo from daz to blender ) but mmd to daz.

    this MMD addon was created many many years back, probably in 2011 i think Thomas must be aware of it.

    anyway if you don’t have it can get the plugin here i guess:

    https://www.youtube.com/watch?v=Q5jJ_TKKhX0

    So after i imported my MMD i did my scene on daz, then when i wanted export to blender with diffeo i had this problem.

    Thank you!

  6. Alessandro Padovani

    So that pmd importer for daz studio adds surfaces with zero polygons and this is the bug we’re dealing with. Makes no sense. You can import miku dance directly to blender.

    https://www.youtube.com/watch?v=lNsvD4q1YKg

    Anyway Thomas we may add the general fix to skip surfaces with zero polygons as explained above.

  7. bouich jules reporter

    Well of course i am aware you can import pmd directly to blender.

    But with daz, it’s more convenient you can make your scene in daz and when you want export your scene with diffeo you can directly export in single principled and make all your scene game engine ready in 1s.

  8. Thomas Larsson repo owner

    No, not all faces are assigned to the same material, at least not in Blender. Here are the 1-30, 1-31 and 1-39 material assignments.

  9. Thomas Larsson repo owner

    And here is the last ,1-59 material. That must be the green bush that we see everywhere in Bouich’s original picture.

  10. Alessandro Padovani

    @bouich, can you please confirm that the asset now works fine both in daz studio and blender ? Because we can’t confirm anything for the missing textures.

    Thomas, so the information is in the duf file but daz studio assigns zero polygons to materials with the same name ? How can this work ? May be because of the missing textures ? Personally I’d go for adding a tooltip that this is a fix for the miku miku dance importer. Not needed for well formed daz assets.

  11. Thomas Larsson repo owner

    The option has been renamed to Materials By Index and a longer tooltip. It is still in the Materials section, since the Debug section contain options for debugging the plugin rather than fixing dubious behaviour in duf files.

  12. Log in to comment