Issue when converting to MHX

Issue #1967 resolved
Jake created an issue

So, not sure why this is happening, as it hasn’t before, but I’m getting this when I’m converting the armature to MHX:

Python: Traceback (most recent call last):
File "C:\Users\HELLO\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\import_daz\error.py", line 223, in execute
self.run(context)
File "C:\Users\HELLO\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\import_daz\mhx.py", line 625, in run
self.convertMhx(context)
File "C:\Users\HELLO\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\import_daz\mhx.py", line 704, in convertMhx
self.fixBoneDrivers(rig, rig, MHX.BoneDrivers)
File "C:\Users\HELLO\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\import_daz\fix.py", line 248, in fixBoneDrivers
changeTargets(ob.data.shape_keys, rig, rig0)
File "C:\Users\HELLO\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\import_daz\fix.py", line 220, in changeTargets
self.changeTarget(fcu, rna, rig, rig0, assoc)
File "C:\Users\HELLO\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\import_daz\fix.py", line 271, in changeTarget
for var in fcu.driver.variables:
AttributeError: 'NoneType' object has no attribute 'variables'

Edit: Also getting this when converting to Rigify:

Python: Traceback (most recent call last):
File "C:\Users\hello\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\import_daz\error.py", line 223, in execute
self.run(context)
File "C:\Users\hello\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\import_daz\rigify.py", line 1357, in run
rig,meta,dazrig = self.createMeta(context)
File "C:\Users\hello\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\import_daz\rigify.py", line 199, in createMeta
optimizePose(context, True)
File "C:\Users\hello\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\import_daz\convert.py", line 123, in optimizePose
applyRestPoses(context, rig, [])
File "C:\Users\hello\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\import_daz\merge.py", line 1701, in applyRestPoses
applyAllObjectTransforms(rigs)
File "C:\Users\hello\AppData\Roaming\Blender Foundation\Blender\4.0\scripts\addons\import_daz\merge.py", line 1721, in applyAllObjectTransforms
bpy.ops.object.transform_apply(location=True, rotation=True, scale=True)
File "C:\Program Files (x86)\Steam\steamapps\common\Blender\4.0\scripts\modules\bpy\ops.py", line 109, in call
ret = _op_call(self.idname_py(), kw)
RuntimeError: Error: Cannot apply to a multi user: Object "DO Armature", Armature "DO Armature", aborting

So strange

Comments (12)

  1. Thomas Larsson repo owner

    I cannot reproduce this, nor do I understand how this could ever happen. Could you upload a simple blend file where this happens.

  2. Jake reporter

    I don’t have a clue either. I suspect it appeared after I transferred the JCM shape keys I mentioned in the other thread, but they only affect the mesh, not the armature and this is a problem with the armature, as I get those errors even if I just completely delete the mesh.

    And as I recall, I didn’t even touch the armature. I did apply the two pre-set “optimize drivers” operations, but I did so with the fresh duplicate I included in the scene and it works just fine.

    I removed everything in this scene instance, except the main armature and the body mesh that are bugged. And included a fresh version from Daz that converts normally to compare with.

    https://www.mediafire.com/file/cpq7hr8faaoeybw/Armature_fix.rar/file

  3. Jake reporter

    I’m not sure if I should try transferring the custom properties from the fresh model and see if it fixes.

    Obviously redoing everything fixes it, but I’ve got some stuff on another UI platform linked to the old armature that I can’t just carry over as far as I’m aware.

  4. Thomas Larsson repo owner

    Everything should be fixed now.

    There are a lot of problems with the drivers in you file, especially the white mesh. E.g., there are drivers that drive modifiers that don’t exist, that depend on custom properties that don’t exist, that create dependency loops, etc. I added a new button, “Remove Corrupt Drivers”, that gets rid of them. After doing that the rig can be converted to mhx without problems.

    The rigify bug is another issue. The armature of the white mesh seems to be used by multiple objects, and then the plugin fails when it attempts to apply transforms to it. You can apply transforms in the viewport, but get a warning.

  5. Jake reporter

    I was thinking that it’d be wiser for me to just start from scratch, let alone for the fact that even Rigify breaks in the old scene. But I was wondering if you could add an option to add the driver mute button for shape keys that you can choose from a similar list as the one where you choose all the morphs you want to import from Daz or transfer between meshes, which would include even shape keys made after you’ve finished importing what you need.

  6. Thomas Larsson repo owner

    If start from scratch, why don’t you just turn on the global “Shapekey Mute Drivers” setting and be done with? Then again, it would not be that difficult to make a tool that duplicates the driver for shapekey value to shapekey mute.

  7. Jake reporter

    No I mean, for shape keys that don’t have drivers, such as the ones you import with custom morphs function or any new morphs added manually, since it doesn’t cover them.

  8. Thomas Larsson repo owner

    If the shapekey value isn’t driven it is impossible to add a driver for shapekey mute. The obvious idea is to drive mute with the shapekey’s own value, but that causes a dependency loop. So we need to drive both the value and mute with the same property.

    Custom morphs do generate drivers if the Rig Property Drivers option is enabled. If you make a shapekey manually, you can add drivers with Advanced Setup > Morphs > Add Shapekey Drivers . However, that tool ignores the setting for mute drivers. Will fix that.

  9. Log in to comment