Import Error on A Piece of Clothing

Issue #324 closed
Andrew DeVine created an issue

Hello! I’ve encountered a bug trying to import a piece of clothing from DAZ 4.15 into Blender 2.83 (Windows 10)

I’m using v1.5.1 of the plugin (commit d5ad834)

I’ve attached the duf and dbz files. Here’s the traceback from Blender:

Traceback (most recent call last):
File "C:\Users\adevi\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\Diffeomorphic-import_daz-d5ad8347c7d9\error.py", line 247, in execute
self.run(context)
File "C:\Users\adevi\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\Diffeomorphic-import_daz-d5ad8347c7d9\daz.py", line 48, in run
getMainAsset(self.filepath, context, self)
File "C:\Users\adevi\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\Diffeomorphic-import_daz-d5ad8347c7d9\main.py", line 68, in getMainAsset
main = parseAssetFile(struct, toplevel=True)
File "C:\Users\adevi\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\Diffeomorphic-import_daz-d5ad8347c7d9\files.py", line 281, in parseAssetFile
return asset.parse(struct)
File "C:\Users\adevi\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\Diffeomorphic-import_daz-d5ad8347c7d9\files.py", line 105, in parse
asset = self.parseUrlAsset(nstruct)
File "C:\Users\adevi\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\Diffeomorphic-import_daz-d5ad8347c7d9\asset.py", line 170, in parseUrlAsset
asset.update(struct)
File "C:\Users\adevi\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\Diffeomorphic-import_daz-d5ad8347c7d9\node.py", line 652, in update
node = GeoNode(self, geo, geostruct["id"])
File "C:\Users\adevi\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\Diffeomorphic-import_daz-d5ad8347c7d9\geometry.py", line 70, in init
geo.nodes[self.id] = self
AttributeError: 'Figure' object has no attribute 'nodes'

Comments (11)

  1. Thomas Larsson repo owner

    I don’t have access to nimble elf pants, so I cannot reproduce your errors; all I get are warnings about missing assets. But I had a look at your trackback and the code, and my spontaneous reaction is that this cannot happen. Alas, apparently it does. I made some changes to silence the error, but this just fixes the symptom and not the underlying cause.

    It might be a good idea to crank up the verbosity, at first to 3, and see if something interesting is printed in the terminal.

  2. Andrew DeVine reporter

    Yeah this is the first time I’ve encountered this…makes me wonder if it’s something the DAZ artist did that’s not “kosher” or something.

    Turning the verbosity to 3 gave some more info (I missed the verbosity setting before!):

    Parsing data
    Duplicate asset definition
    Asset 1: <Figure /data/nikisatez/g8fnimbleelf/nimble%20elf%20pants/nepants_5967.dsf#nepants_5967 1 None>
    Asset 2: <Geometry /data/nikisatez/g8fnimbleelf/nimble%20elf%20pants/nepants_5967.dsf#nepants nepants None>
    Ref: /data/nikisatez/g8fnimbleelf/nimble%20elf%20pants/nepants_5967.dsf#nepants

    With Verbosity at 5:

    Parsing data
    +FILE /scenes/test.duf
    +FILE /data/nikisatez/g8fnimbleelf/nimble%20elf%20pants/nepants_5967.dsf
    +FILE /data/nikisatez/g8fnimbleelf/nimble%20elf%20pants/uv%20sets/nikisatez/base/default.dsf
    -FILE /data/nikisatez/g8fnimbleelf/nimble%20elf%20pants/uv%20sets/nikisatez/base/default.dsf
    -FILE /data/nikisatez/g8fnimbleelf/nimble%20elf%20pants/nepants_5967.dsf
    Duplicate asset definition
    Asset 1: <Figure /data/nikisatez/g8fnimbleelf/nimble%20elf%20pants/nepants_5967.dsf#nepants_5967 1 None>
    Asset 2: <Geometry /data/nikisatez/g8fnimbleelf/nimble%20elf%20pants/nepants_5967.dsf#nepants nepants None>
    Ref: /data/nikisatez/g8fnimbleelf/nimble%20elf%20pants/nepants_5967.dsf#nepants

    I also edited the python to “quiet” the error but ended up with no mesh imported, only an empty. I eventually traced it back to the duf file and gave up since I’m not familiar with the format/terminology. I’ll try your edits though and see if that makes a difference

    BTW, this is the first difficulty I’ve encountered with it…the addon is pure magic! Great work, man.

  3. Thomas Larsson repo owner

    Please check if the last commit works better. I don’t have the files myself, but a copy of the mesh is actually stored locally in the scene file, and I have manage to load that. The plugin also loads materials and armatures, but other things, like textures, vertex groups and bone orientations are not defined in the scene.

  4. Alessandro Padovani

    May be Andrew did changes to the assets in the scene. As I recall, it seems to me that support for modified assets is limited. That is, to import a modified asset it has to be saved as support asset first (file > save as > support asset). Modified assets are stored locally in the scene, while support assets are linked.

    Then if support for modified assets is improved in the new commit that’s nice.

  5. Andrew DeVine reporter

    Hm I don’t think I made any changes in Daz (but I’m not the most experienced with Daz!). I just loaded the object into the scene via the Smart Content tab then immediately saved the scene and exported the dbz.

    BUT, Alessandro’s idea worked! I started a new Daz scene, and brought the object into the scene. With it selected, I did SaveAs → Support Asset → Figure/Prop Asset. Then I started another new Daz scene, and used “Merge an existing file” to bring the saved pants asset in. I then saved the new Daz scene and exported the dbz…and the blender import worked just fine (using commit 7274c9f)

    (I noticed as I was writing this that you just pushed again and it looks like it may be relevant so I’ll check that one out too)

    Just for development’s sake: if I don’t do the above process and just use the duf/dbz files attached to the issue with 7274c9f, I still get some python errors. There was a “halt” that wasn’t an assignment or function in asset.py line 101 that looked like an error so I removed that, and then I get this:

    Verbosity 2:

    Parsing data
    Not a geometry:
    <Figure /data/nikisatez/g8fnimbleelf/nimble%20elf%20pants/nepants_5967.dsf#nepants_5967 1 None>
    Missing local asset:
    '/scenes/test.duf#nepants'

    Missing local asset:
    '/scenes/test.duf#nepants'

    Missing local asset:
    '/scenes/test.duf#nepants'

    Missing local asset:
    '/scenes/test.duf#nepants'
    in file:
    '/scenes/test.duf'

    ... this repeats 6 more times, probably because I removed the "halt" in asset.py that I assume was meant to stop execution

    Preprocessing...
    Traceback (most recent call last):
    File "C:\Users\adevi\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\Diffeomorphic-import_daz-7274c9f84550\error.py", line 247, in execute
    self.run(context)
    File "C:\Users\adevi\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\Diffeomorphic-import_daz-7274c9f84550\daz.py", line 48, in run
    getMainAsset(self.filepath, context, self)
    File "C:\Users\adevi\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\Diffeomorphic-import_daz-7274c9f84550\main.py", line 74, in getMainAsset
    inst.preprocess(context)
    File "C:\Users\adevi\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\Diffeomorphic-import_daz-7274c9f84550\node.py", line 198, in preprocess
    geo.preprocess(context, self)
    File "C:\Users\adevi\AppData\Roaming\Blender Foundation\Blender\2.83\scripts\addons\Diffeomorphic-import_daz-7274c9f84550\geometry.py", line 93, in preprocess
    self.data.preprocess(context, inst)
    AttributeError: 'Figure' object has no attribute 'preprocess'

    Verbosity 3:

    Parsing data
    Duplicate asset definition
    Asset 1: <Figure /data/nikisatez/g8fnimbleelf/nimble%20elf%20pants/nepants_5967.dsf#nepants_5967 1 None>
    Asset 2: <Geometry /data/nikisatez/g8fnimbleelf/nimble%20elf%20pants/nepants_5967.dsf#nepants nepants None>
    Ref: /data/nikisatez/g8fnimbleelf/nimble%20elf%20pants/nepants_5967.dsf#nepants

    Not a geometry:
    <Figure /data/nikisatez/g8fnimbleelf/nimble%20elf%20pants/nepants_5967.dsf#nepants_5967 1 None>
    WARN (bpy.rna): C:\b\buildbot-worker-windows\windows_lts_283\blender.git\source\blender\python\intern\bpy_rna.c:1479 pyrna_enum_to_py: current value '0' matches no enum in 'Scene', 'Scene', 'DazMorphCatsContent'
    ERROR:
    Not a geometry:
    <Figure /data/nikisatez/g8fnimbleelf/nimble%20elf%20pants/nepants_5967.dsf#nepants_5967 1 None>

  6. Alessandro Padovani

    Andrew, you don’t necessarily need to make changes yourself, some time daz does it for you behind the scene. For example this happens when you fit an outfit for a different generation, as a G3 outfit on G8. In this case the autofit tool generates a new figure and embed it in the scene file.

    You can somehow recognize embedded assets because they get a big size, while support assets only get links so the scene file is small.

  7. Thomas Larsson repo owner

    The root cause of the problem is that duplicate assets are handled incorrectly. It was a long time since I saw that problem, and I don’t have any files that reproduces it, so I’m working blindly here. Anyway, I think the last commits can fix it, or at least there is a more informative error message.

  8. engetudouiti

    the duplicated part seems d-force geometry (which usually parented ) . when I check scene file.

    so it may not work even though you can import them as usuall mesh.

    I seldom buy g-force clothing so do not know how it may work, when import, but basically plug in may not support it. (so maybe can import as static duplicated mesh for the d-force part)

  9. engetudouiti

    Then when plug in read duf, check “modifer library” if it include id "dForce Simulation" , add it for out-put info, can use to detect problem. (maybe only d-Force show issue as duplicated ) long time. (so Thomas seldom see it)

  10. Log in to comment