Genesis 9: Import Custom Morphs fails when "Transfer to Face Meshes" is selected

Issue #1777 resolved
Danny McGee created an issue

Repro:

  1. In Daz Studio, add a base Genesis 9 figure to the scene
  2. Save the file
  3. Run the “Export to Blender” script
  4. In Blender, use DAZ Importer to import the exported file
  5. Under Setup/Morphs, select “Import Custom Morphs”
  6. Navigate to data/Daz 3D/Genesis 9/Base/Morphs/Daz 3D/Base Feminine 9 and select BaseFeminine_head_bs_Head.dsf
  7. In the import options, select “Use Rig Property Drivers”, “Use Adjusters”, “Body part: Face”, and “Transfer to Face Meshes”
  8. Press “Import Custom Morphs”

AddOn raises an exception:

Python: Traceback (most recent call last):
  File "[...]\Blender\3.6\scripts\addons\import_daz\error.py", line 213, in execute
    self.run(context)
  File "[...]\Blender\3.6\scripts\addons\import_daz\morphing.py", line 1584, in run
    self.finishLoading(namepaths, context, t1)
  File "[...]\Blender\3.6\scripts\addons\import_daz\morphing.py", line 974, in finishLoading
    self.transferToLashes(context)
  File "[...]\Blender\3.6\scripts\addons\import_daz\morphing.py", line 1037, in transferToLashes
    bpy.ops.daz.transfer_shapekeys()
  File "[...]\Blender\3.6\scripts\modules\bpy\ops.py", line 113, in __call__
    ret = _op_call(self.idname_py(), None, kw)
RuntimeError: Error: Python: Traceback (most recent call last):
  File "[...]\Blender\3.6\scripts\addons\import_daz\error.py", line 213, in execute
    self.run(context)
  File "[...]\Blender\3.6\scripts\addons\import_daz\transfer.py", line 299, in run
    failed = self.transferAllMorphs(context, src, targets)
  File "[...]\Blender\3.6\scripts\addons\import_daz\transfer.py", line 319, in transferAllMorphs
    if not self.transferMorphs(src, trg, context):
  File "[...]\Blender\3.6\scripts\addons\import_daz\transfer.py", line 333, in transferMorphs
    self.projection = MP.getProjection(trg)
  File "[...]\Blender\3.6\scripts\addons\import_daz\morphing.py", line 783, in getProjection
    scale = self.projectionFactor[char] * ob.DazScale
KeyError: 'Tear9'
Location: [...]\Blender\3.6\scripts\modules\bpy\ops.py:113

After the operation completes, the new morph appears in the list and mostly works, but the tearline mesh doesn’t conform to the morph. The eyelashes mesh does seem to behave as expected.

EDIT: On further inspection, the eyes also don’t conform to the morph, which is a bigger problem. I can live without the tearline, but I’d definitely like the eyes to remain in their sockets. 🙂

Comments (8)

  1. Danny McGee reporter

    For what it’s worth, I was able to fix the issue locally by updating morphing.py line 783 to this:

    scale = (self.projectionFactor[char] * ob.DazScale
             if char in self.projectionFactor
             else ob.DazScale)
    

    I have no idea if that’s correct, but the custom morph seems to work correctly after the change.

  2. Alessandro Padovani

    1.7.2.1853

    I can’t reproduce the issue. It seems you’re using a old version, please update to the last commit before reporting bugs. For eyes to work you have to enable erc morphs.

    update.

    The error doesn’t arise and the head morphs fine, but the eyes seem to not conform even with morph armature. I never use morph armature myself though so this may be some error on my side, better wait for Thomas to check.

    update. daz favorites works fine.

    Using daz favorites instead of custom morphs works fine. You probably have to load some custom morphs on the eyes too that daz favorites does automatically. The thing is, custom morphs is very technical and not easy to use, it leaves maximum control to the user but you have to know what you’re doing.

    I’d advise to use daz favorites instead whenever possible.

    https://bitbucket.org/Diffeomorphic/import_daz/wiki/Setup/Morphs/Import DAZ Favorites

  3. Thomas Larsson repo owner

    The eyes problem is that the shapekey wasn’t transferred to the eyes, only to the other face meshes. The plugin uses some heuristics to determine whether a mesh is a face mesh, which includes the mesh name and if the mesh has a “head” vertex group. That heuristics has been improved so the G9 eyes are included. However, it doesn’t cover every case so you may have to do some manual transfer afterwards.

    Shapekeys aren’t automatically transferred to hair meshes, but they are to the hair cap. Hair meshes can be very heavy, and if you convert the hair to particles or hair curves the shapekeys are not needed.

  4. Log in to comment