NameError while importing scene

Issue #1591 resolved
PuniMochi created an issue

Blender 3.5.1

Diffeormorphic 1.7.0.1425

Traceback (most recent call last):
File "C:\Users\enjin\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\Diffeomorphic-import_daz-bfd3d12ec5f6\error.py", line 214, in execute
self.run(context)
File "C:\Users\enjin\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\Diffeomorphic-import_daz-bfd3d12ec5f6\main.py", line 229, in run
self.loadDazFile(filepath, context)
File "C:\Users\enjin\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\Diffeomorphic-import_daz-bfd3d12ec5f6\main.py", line 155, in loadDazFile
asset.build(context)
File "C:\Users\enjin\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\Diffeomorphic-import_daz-bfd3d12ec5f6\cycles.py", line 87, in build
self.tree.build()
File "C:\Users\enjin\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\Diffeomorphic-import_daz-bfd3d12ec5f6\cycles.py", line 323, in build
self.buildCutout()
File "C:\Users\enjin\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\Diffeomorphic-import_daz-bfd3d12ec5f6\pbr.py", line 130, in buildCutout
alpha,tex = self.getColorTex("getChannelCutoutOpacity", "NONE", 1)
File "C:\Users\enjin\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\Diffeomorphic-import_daz-bfd3d12ec5f6\cycles.py", line 886, in getColorTex
tex = self.addTexImageNode(channel, colorSpace, isMask)
File "C:\Users\enjin\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\Diffeomorphic-import_daz-bfd3d12ec5f6\cycles.py", line 1840, in addTexImageNode
group.addTextureNodes(assets, maps, colorSpace, isMask)
File "C:\Users\enjin\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\Diffeomorphic-import_daz-bfd3d12ec5f6\cgroup.py", line 1700, in addTextureNodes
self.mixColor(map, texnode, outnode)
File "C:\Users\enjin\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\Diffeomorphic-import_daz-bfd3d12ec5f6\cgroup.py", line 1754, in mixColor
setFactor(map.transparency, texnode, "Alpha", mix)
File "C:\Users\enjin\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\Diffeomorphic-import_daz-bfd3d12ec5f6\cgroup.py", line 1723, in setFactor
fac.default_value = 1
NameError: name 'fac' is not defined

I get this error trying to import a scene to Blender. I’ve imported bunch of different scenes before and this is the first time I got the error.

This one in particualr also took me 52 seconds to export from DAZ, while my usual time with scenes take less than 10 seconds.

What is this ‘fac’ that’s not defined?

Comments (14)

  1. Thomas Larsson repo owner

    I think this bug is fixed in the development version. A number of bugs have been fixed since 1.7.0, time for a new stable release soon.

  2. PuniMochi reporter

    Traceback (most recent call last):
    File "C:\Users\enjin\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\Diffeomorphic-import_daz-b311b8b9a79c\error.py", line 222, in execute
    self.run(context)
    File "C:\Users\enjin\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\Diffeomorphic-import_daz-b311b8b9a79c\main.py", line 228, in run
    self.loadDazFile(filepath, context)
    File "C:\Users\enjin\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\Diffeomorphic-import_daz-b311b8b9a79c\main.py", line 155, in loadDazFile
    asset.build(context)
    File "C:\Users\enjin\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\Diffeomorphic-import_daz-b311b8b9a79c\cycles.py", line 88, in build
    self.tree.build()
    File "C:\Users\enjin\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\Diffeomorphic-import_daz-b311b8b9a79c\cycles.py", line 329, in build
    self.buildCutout()
    File "C:\Users\enjin\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\Diffeomorphic-import_daz-b311b8b9a79c\pbr.py", line 139, in buildCutout
    CyclesTree.buildCutout(self)
    File "C:\Users\enjin\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\Diffeomorphic-import_daz-b311b8b9a79c\cycles.py", line 1524, in buildCutout
    alpha,tex = self.getColorTex("getChannelCutoutOpacity", "NONE", 1.0)
    File "C:\Users\enjin\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\Diffeomorphic-import_daz-b311b8b9a79c\cycles.py", line 894, in getColorTex
    tex = self.addTexImageNode(channel, colorSpace, isMask)
    File "C:\Users\enjin\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\Diffeomorphic-import_daz-b311b8b9a79c\cycles.py", line 1890, in addTexImageNode
    group.addTextureNodes(assets, maps, colorSpace, isMask)
    File "C:\Users\enjin\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\Diffeomorphic-import_daz-b311b8b9a79c\cgroup.py", line 1800, in addTextureNodes
    self.mixColor(map, texnode, outnode)
    File "C:\Users\enjin\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\Diffeomorphic-import_daz-b311b8b9a79c\cgroup.py", line 1853, in mixColor
    setFactor(map.transparency, texnode, "Alpha", mix)
    File "C:\Users\enjin\AppData\Roaming\Blender Foundation\Blender\3.5\scripts\addons\Diffeomorphic-import_daz-b311b8b9a79c\cgroup.py", line 1819, in setFactor
    self.links.new(node.outputs[0], mix.inputs[0])
    AttributeError: 'NoneType' object has no attribute 'outputs'

    This is what I got after updating diffeo to 1.7.1.1627 but I’m guessing this isn’t the development version?
    Where can I find the development version?

  3. PuniMochi reporter

    I got it to work with the process of elimination and it turns out the terrain and high quality/detailed food assets caused it. For some reason leaving even one of them on the scene caused the error despite the exporting time being greatly reduced to like 9 seconds from the 52 seconds originally.

    I’ll keep this open since it’s not really a solution. Still have to try the development version (Can’t find it).

  4. Thomas Larsson repo owner

    Could you upload the duf file so I can have a look. Normally I would need the entire asset, but in this case it is a problem with materials, specifically layered images, and I think they are stored directly in the duf file.

  5. Alessandro Padovani

    If you did not make a clean install then there may be issues. So check first if clean install works fine. Then when providing test scenes for Thomas you should try to make it as simple as possible to reproduce the bug, the smaller is the scene the easier it is to handle.

  6. Thomas Larsson repo owner

    No, I don’t have any problem to import your files in the latest dev version. Except that the file “/data/GCJellyfish/Dirty Dishes 2/Breaded Sole Bite/sole bite.dsf” isn’t found. Perhaps somebody put in an extra space between sole and bite.

  7. PuniMochi reporter

    Okay so I did a fresh install and had the same problem. So I did another process of elimination on just the food assets. I managed to narrow it down all the way and it turns out the margaritas were the cause. Meals and dishes worked.

    And one of its children node ‘Martini glass dirt’ was causing the above error.

    https://drive.google.com/drive/u/0/folders/1cIsaEjjPZty-NmSXjUgA0tly6eyDnC8E

    Here I added the martini dirt duf file so please take a look at this one.

  8. Alessandro Padovani

    daz studio 4.21.0.5, blender 3.5.1, diffeomorphic 1.7.1.1627

    I can confirm that your test scenes work fine, apart martini. With martini we have a LIE in the opacity map using a color instead of a picture and that’s probably causing the output error message. Note that this is a completely transparent layer since opacity is 0% so it doesn’t have any effect on the LIE. If we delete the 0% LIE layers in daz studio then the scene loads fine in blender.

    # LIE layers conversion
    if opacity == 0
        skip this layer
    if resource == none
        use a rgb color node instead
    

  9. Log in to comment