Import error

Issue #176 closed
Noname created an issue

Using latest version blender 2.83.5 and 2.90.0 Beta both fails to import dbz file with:

Steps:

  1. launch Daz and re export using latest export script
  2. launch blender 2.83.5 and import, errors with:
Traceback (most recent call last):
  File "C:\Users\user\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\Diffeomorphic-import_daz-86228514b8b7\error.py", line 247, in execute
    self.run(context)
  File "C:\Users\user\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\Diffeomorphic-import_daz-86228514b8b7\daz.py", line 48, in run
    getMainAsset(self.filepath, context, self)
  File "C:\Users\user\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\Diffeomorphic-import_daz-86228514b8b7\main.py", line 87, in getMainAsset
    asset.build(context, inst)      # Builds armature
  File "C:\Users\user\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\Diffeomorphic-import_daz-86228514b8b7\figure.py", line 263, in build
    child.buildEdit(self, rig, None, cscale, center, False)
  File "C:\Users\user\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\Diffeomorphic-import_daz-86228514b8b7\bone.py", line 420, in buildEdit
    omat = self.flipBone(omat, head, tail, flip)
UnboundLocalError: local variable 'flip' referenced before assignment

location: <unknown location>:-1

Comments (9)

  1. Thomas Larsson repo owner

    I don’t understand how the first bug could have ever happened. It should definitely be gone in the last commit.

    The second bug existed for a short time yesterday. It should also be gone.

    There will be an error if you have save global settings during the last week or so. To fix it, open the global settings dialog and load factory settings, or just change the Orientation type.

  2. sc

    Python: Traceback (most recent call last):
      File "C:\Users\asus\AppData\Roaming\Blender Foundation\Blender\2.91\scripts\addons\Diffeomorphic-import_daz-f5f5399b6944\error.py", line 247, in execute
        self.run(context)
      File "C:\Users\asus\AppData\Roaming\Blender Foundation\Blender\2.91\scripts\addons\Diffeomorphic-import_daz-f5f5399b6944\daz.py", line 48, in run
        getMainAsset(self.filepath, context, self)
      File "C:\Users\asus\AppData\Roaming\Blender Foundation\Blender\2.91\scripts\addons\Diffeomorphic-import_daz-f5f5399b6944\main.py", line 87, in getMainAsset
        asset.build(context, inst)      # Builds armature
      File "C:\Users\asus\AppData\Roaming\Blender Foundation\Blender\2.91\scripts\addons\Diffeomorphic-import_daz-f5f5399b6944\figure.py", line 251, in build
        rig.DazLoadOrientation = GS.dazOrientation
    TypeError: bpy_struct: item.attr = val: Object.DazLoadOrientation expected a string type, not bool
    
    location: <unknown location>:-1
    

  3. Thomas Larsson repo owner

    OK, that GS.dazOrientation is a bool explains the original error, but I just cannot understand how it can not be a string. It is only changed in a few places and always to a string.

    I used DazOrientation both as a scene, object, and bone property. It shouldn’t cause problems, but to eliminate any risk I renamed the object and bone properties into DazOrient. It is bad style to use the same name for different things anyway.

    Since I cannot reproduce this problem, I suspect that your settings file is corrupt in some way that I don’t understand. Did you try to Load Factory Settings? Also, you could try to delete the file named “import-daz-settings-28x.json” in your home directory (just above your Documents folder).

  4. Noname reporter

    Version that I used was: 86228514b8b7

    Steps:

    1. using script I update local version (it’s just batch file downloading latest version and extracting and now cp files to daz for exporting)
    2. in blender - remove old version
    3. in blender - install latest version
    4. in Daz, if daz export plugin changed, re export files
    5. test importing in Blender

    So I tried other advice that @Thomas Larsson

    @Thomas Larsson

    mentioned, settings reset and … it works correctly now. It appears that setting are root of issue.

    The old settings that I exported just before reset are located here so Thomas can take a look if he thinks it’s not a waste of his time (I think it is and would leave just note that reset is required).

    Keeping this task open as other people have import issues also so lest hear from them and then close this.

  5. Noname reporter

    Updated to latest version of plugin and I see that there is warning popup naging to reset settings and… it works ! This was tested with 2.90.0 (I have 2 blender versions alongside) and 2.90 was not updated so this proves that when this situation happens user will get notification and will know what to do.

  6. Thomas Larsson repo owner

    Now I understand what happened. The scene property DazOrientation used to be a bool, and was then replaced by an enum. But if you had saved settings with the old definition, you run into these problems with the new versions.

    Solved by replacing DazOrientation by a brand new property, which has never been used before and is hence not saved in any old settings files.

  7. Log in to comment