merged geograft morph deformation results do not match daz results

Issue #361 resolved
Luke Graybill created an issue

After loading shapekeys/morphs, transferring them to geograft meshes, and finally merging the Golden Palace geograft to a base figure, the unposed merged mesh result looks great.

However, as bones with shapekey deformations that affect the geograft area of the mesh are moved away from the rest pose, the deformations become increasingly out of sync with the surrounding vertices that came from the original base mesh. Eventually, at the extents of a deformation, there are distortions in the surface of the mesh along the boundaries where the geograph was merged. These problems are not present in Daz with the same pose applied.

Here I’ve imported the default G8F figure with Golden Palace genitals, imported all the body morphs, JCMs, and flexions, transferred JCMs and flexions to the geograft, and merged the meshes. Next, I set the “Legs Spread” body morph to 1.0, and compared it with an exported OBJ from Daz with the same body morph applied at 100%.

Note that the merged mesh in blender distorts differently along the edges of the thigh and buttocks where the geograft was joined with the main body mesh. This effect is even more pronounced in other more extreme poses, where the result in Daz looks good, but in Blender it can be rather hideous.

Comments (37)

  1. Luke Graybill reporter

    I am not a Daz expert by any means, but I’ve noticed that in Daz, the geograft mesh sits well below the surface of the body mesh, for whatever reason, and the geoshell is what is flush with the body mesh:

    It is unclear to me whether the vertex weights in Daz are for the geograft mesh or the geoshell mesh? Maybe Daz is somehow averaging them differently so that it deforms properly?

    At any rate, it seems like merging the meshes in Blender is not functioning entirely correctly, but I’m not knowledgeable enough to say exactly what is wrong.

  2. Alessandro Padovani

    I see golden palace comes with its own jcms, but I’m not sure myself what you have to do to get them working. As for shells, I don’t get your odd displacement with legs spread in daz studio. Anyway diffeo ignores the shell geometry and only gets the shell materials.

    Then please use wireframe to depict genitals when possible. Other than better show the issue, that is more decent for sensitive people. Not me I’m fine.

  3. Alessandro Padovani

    Xin, it seems “import custom jcms” doesn’t exist anymore and I’m not sure how do we import the golden palace jcms. That’s probably the issue Luke is having. I suppose it’s “import custom morphs” now, but it doesn’t seem to create the drivers.

    Then I’m not a rig expert and I don’t usually go this deep with jcms.

    edit. Nope, “import custom morphs” works fine and it creates the drivers for the golden palace jcms. It was my mistake because I deselected “property drivers”, so may be the plugin got confused. It seems we need both “property drivers” and “bone drivers” selected for the drivers to be created. I’m not sure if this is a bug.

  4. Thomas Larsson repo owner

    This seems to be a problem with vertex groups rather than shapekeys. The Legs spread morph only drives bone rotations, in particular the thigh bend and twist bones. However, GP does not have a thigh twist vertex group, although it clearly extends into the GP area as the following picture shows. No idea how it could work in DS.

  5. Xin

    Are you sure there isn’t any other morph correction being applied in daz? I don’t have this thing so I can’t test it. Will see if I can get it later.

  6. Xin

    Also, Blender has a vertex weight smooth operator and the levels operator that you can use to quickly smooth and expand the weight paint in the transition. This requires a little bit of knowledge to get right (since you risk breaking vertex weight normalization otherwise), but it will likely work decently here. I will also try that.

    As a side note, is Bitbucket broken for anyone else? I can’t edit comments.

  7. Thomas Larsson repo owner

    I am positive that the thigh twist vertex groups extend into the genitals area, but the genitals themselves do not have those vertex groups. If you don’t load any body morphs, you can still see that the body and the genitals transform differently if you rotate the twist bone. I don’t see how any corrective morphs could fix that.

  8. Luke Graybill reporter

    I have tried loading the Golden Palace specific JCMs, and they still do not create the correct deformations as what is shown in Daz. (Unless I was doing something wrong, which is entirely possible.)

  9. Luke Graybill reporter
    • edited description

    Censored the genital image in the original post, just in case. Sorry if it bothered anyone earlier.

  10. Luke Graybill reporter

    Thomas, I think the IK system in Daz is rotating the Y axis of the thigh bend bone by some percentage of the amount the Y axis of the thigh twist bone is rotated, which then deforms the genitals. In Blender, rotating the Y axis of rThighTwist is not affecting the Y axis of rThighBend at all.

    I can’t tell if this would fix the deformations in the legs spread pose, but possibly. In Daz, the legs spread pose appears to rotate both the twist and bend bones to -60, but when I manually set the rotations in Blender to those values, the mesh is even more messed up, so 🤷‍♂️ .. maybe there is some formula that I’m not aware of that should be happening between those values?

    (Edit: actually that doesn’t exactly make sense, because the foot is not rotated in Daz, despite the rotation of the thigh bones. I do not understand this.)

  11. Xin

    I don’t know what pose dial you guys are using (I don’t really use those so I don’t have any), but by posing manually I can get a very close match.

    Have you tried moving the Subsurf modifier to the top of the stack (before the armature) or maybe unchecking the Preserve Volume option in the armature modifier? that might affect deformations a little, although changing preserve volume is a bad idea.

    I don’t really see the issue here. Maybe describe the pose exactly, without dials? just pose manually.

  12. Xin

    Also, try clearing the Custom Split Normals Data from the obj mesh (go to Object Data Properties → Geometry Data → Clear Custom Split Normals Data). Also check that the Auto Smooth settings are the same in both meshes.

  13. engetudouiti

    @Thomas

    So you suppose it caused by vertex weight of the Grafted mesh, I recommend, at first check in daz studio, with use “node weight map brush” tool options, then select the  “thigh twist “ of the grafted item, and it actually colored weight or not with compare blender scene weight map

    then if I were you, I remove all jcm effect in daz studio, (G8 offer property which can remove jcm I remember, if G3 you need to manually set them as zero, after posing, then compare without import any jcms.

    I do not have the product then can not do it, but untill you confirm, weight map is imported correctly for grafted mesh or something happen when merge in blender side, or rigitidy group setting problem, , you can not go foward. if vertex weight is same, actually morph only effect this prbolem. so you need to check JCM effect for the Grafted mesh.

  14. engetudouiti

    So If I were Luke,

    I do same pose in daz studio with set base resolution, at same time remove all morph effect, with show hidden property and check “currently used” with select grafted item root.

    Then I pose in blender, with un-check all shape keys currently change values. (make shape keys hidden) and compare with wire view. (so you can check each vertex move more clear around connected area)

    if I can confirm, it is almost same = weight map or bone arrange or pose rotation cuase no issue,

    now I may return JCM in daz studio, and check which JCM or morph effected when pose, with “currently used” morph.

    About JCM problem,, there need many things you check. but at least you can detect which JCM cause issue, or not drive correctly. (ERC not well imported) with activate same name shape keys (in blender) and Daz studio one by one.

    if you limit pose test, you may not see so many jcms effect the pose, I think maybe 4 or 6.

  15. Xin

    I found the issue. It has nothing to do with JCMs or subdivision, in fact you can disable them and you will still see the issue with just a bend of 60 on “Left Thigh Bend”.

    Do the following to see the issue in Daz:

    • Set the Left Thigh Bend to 60 and hide the main mesh, leaving only the grograft visible.
    • Go into the geometry editor in Daz and see how the boundary of the geograft is no longer snapped to the main mesh, basically respecting its actual real vertex weights.

    Daz is just taking the boundary of the geograft and copying the vertex weights of the main mesh during its fitting mechanism I believe. But when you go in the geometry editor, the fitting is no longer performed so you get the real deformation based on its own vertex weights, the same one you see in Blender.

  16. Xin

    So I believe that a possible fix in Blender is to take the vertex weights of the main mesh on the boundary during merging. In the interior vertices, just respect the original weights, but on the boundary, take the weights from the vertices of the main mesh that overlap with the geograft.

    I will check later to see if this is indeed a solution.

  17. engetudouiti

    So at least coonfirm when merge boundary cause issue, I may tarnsfer weight map, from original to merged one again.

    But I do not clear remember if there was way to limit transfer weight only selected or visible vertex.. (I may suppose so)

    Then if it cause problem, actually G3 and grafted item may have same issue, (I did not care it because I do not import all jcm of currently using character,, so usually correct it with modifier or add new temp morph with driver)

    I may test later. if it can return more reasonable defomation for G3

  18. Xin

    That being said, there is absolutely no reason to have different vertex weights on the boundary. The author of Golden Palace is just being sloppy or the product is quite old.

  19. engetudouiti

    actually one of boundary vertex weight are ignored when we merge them. (so default mesh or grafted mesh vertex weight is only used.

    same thing happen when we make morphs for grafted item. though I do not clear remember, but boundary vertex will only deformed by Character morph or Grafted morph after fit to. (Though I forget which is used)

  20. engetudouiti

    Yes I may request, change current boundary when merge. at current about connected boundary, add on use the grafted item boundary, but it can be changed to use Body mesy boundary.

  21. engetudouiti

    How snap grafted item to character body mesh about boundary, and how remove mesh I do not clear remember, (those step are improved,gradually long time ago,, before I need to do it manually about some product, (which not well made, then zero pose, boundary postion not pefrectly align with body mesh)

    but if with zero pose,, daz and blender show perfect same postion, after merged,, I may recommend, try transfer weight for boundary only,, from body (original character) to the merged body with script.

    I suppose if plug in can generate those bondary loop edge as new vertex group temporally. when import each grafted item,, eg “connectedloop”

    then at current grafted boundary are used when merge (I suppose so). So when merged , the loop vertex group may remain. then can use it to limit transfer weight map. (i do not know how we can do it without use blender modifier, but I suppose there should be method, we can copy vertex weight from A to B only about the temp made vertex group.

    (if not, we need to use modifier, and controll them by python)

  22. Xin

    It can be done easier with Python. New merge algorithm would be as follow:

    for v in geograft_boundary:  
        v2 = body_mesh.find_closest_vertex(origin = v.co)     
              # v2.co and v.co should be basically the same since we are in rest pose
    
        v.vertex_weights = v2.vertex_weights
    

    The interior vertices should keep their original vertex weights.

  23. engetudouiti

    if add on use bpy.ops.mesh.merge to connect 2 vertex, after merge mesh(as blender operation), which mesh vertex will be remain and another will be removed may change selection order, I suppose.

    Though Thomas may know detail how add on connect 2 vertex for boundary loop. (if selection order is only matter, it may be easy solved without transfer weight map)

  24. engetudouiti

    Xin thanks! (though I do not have time to test,, if it work without problem, it seems subsitute way,

    I afraid if we can not remain geograft_bondary..(can not set them) a I afraid, to generate such group seems difficult than I expected… (can you?) , If exported json or duf have such data, it is not dificult though,,, at least in daz studio UI, usually I can not check bondary loop as group etc,, in geometry edit.. (we need to set face boundary in geometry editor, when we make grafted item,, but we do not see any group in geometry editor.. which only select boundary vertex)

  25. Xin

    See:

    It’s easy to discard inner holes' boundaries if there are any (Golden Palace has no holes), since those will have no corresponding overlapping vertices, so they should be skipped in the loop above.

  26. engetudouiti

    Yes I can manually set geograft_boundary group of the grafted item. but I do not know add on actually generate those when we import. (though I suppos if add on use bpy.ops to connect verts, it may generate vertex list , so add on already know boundary group of grafted mesh (geograft_boundary).

    I see, yes there should be way, as you did. 😀

    anyway I am a little bit exciting, it seems make my G3 character with gen more natural ^^; (acually I felt there seems issue, but not reported because I seldom use default G3, so do not confrim it,,, and not test ^^; ) thanks yours.

    and maybe we can use default vertex group or material group for those inner part which need to discard when set boudary loop, (by script need to auto set them with use those operator function)

  27. Thomas Larsson repo owner

    Merge Rigs now copies the body vertex groups to the geograft on the common boundary before merging, which seems to fix the main problem. Some vertices one step inside the geograft still don’t move quite right, but the plugin cannot fix that.

  28. Luke Graybill reporter

    Just tested the changes in build 1010 (c8826b0) and the results in Blender now appear to match Daz almost perfectly (or at least, I don’t see any noticeable difference with the legs spread pose, or with other more extreme poses that were problems before.) As Thomas said, there are still some vertices that don’t move quite right, but those deformation issues are present in Daz too, and (I believe) are due to the GP product itself having problems.

    At least in the case of this geograft, I think the addon is now producing a significantly more faithful result to what Daz gives, which is fantastic. Thank you all for the technical evaluations, and Thomas for the fix!

  29. Alessandro Padovani

    Thomas, when we define a geograft in daz studio, we have to select a boundary graft area where the geograft “grafts” to the figure. The graft area is selected by polygons, not vertices, and it is supposed to always match with the figure geometry.

    May be this graft area is what needs the body vertex groups to be copied, thus extending the common boundary. This could be the cause of the “wrong” vertices. No idea where the graft area is defined in the duf file though.

    edit. Then if the fix is already good enough I guess we may be happy with it.

    edit. After reading the comments by Luke and Engetudouiti, I understand the “wrong” vertices are in daz studio too, so this means the current fix is fine.

  30. Alessandro Padovani

    Xin, I get the same issue with editing comments. You have to click inside the edit box, after clicking the edit button.

  31. engetudouiti

    Alessandro actually we need not need perfect align poligons for grafted item. .so some of grafted product only keep same positon for boundary loop. but inner verts (2nd) not fit well.

    (though we set poligons in daz studio, actually only loop edges is used when graft item fit to. so even though inner loop mesh not fit with the body mesh, grafted mesh still work without problem.

  32. engetudouiti

    Then if 2nd loop vertex weight remain issue,, when fit to,

    I may import as FBX first then transfer weight for 2nd loop with script..

    because FBX may only support to import blender as grafted merged mesh with keep vertex weight for deform bones. obj can not keep vertex weight, do not test with collada, and this script not merge when import,, so there is case,, if some weight not show same value as daz studio, I suppose I will compare, the vertex weight change or not with FBX version.

  33. Log in to comment