Missing L.I.E. blend modes
Issue #1375
resolved
import_daz version: 1.7.0.1406
blender version: 3.4.0
Error:
RuntimeError: Error: Python: Traceback (most recent call last):
File "C:\Users\sello\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\Diffeomorphic-import_daz-d129114df734\error.py", line 214, in execute
self.run(context)
File "C:\Users\sello\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\Diffeomorphic-import_daz-d129114df734\main.py", line 229, in run
self.loadDazFile(filepath, context)
File "C:\Users\sello\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\Diffeomorphic-import_daz-d129114df734\main.py", line 155, in loadDazFile
asset.build(context)
File "C:\Users\sello\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\Diffeomorphic-import_daz-d129114df734\cycles.py", line 87, in build
self.tree.build()
File "C:\Users\sello\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\Diffeomorphic-import_daz-d129114df734\cycles.py", line 322, in build
self.buildLayers()
File "C:\Users\sello\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\Diffeomorphic-import_daz-d129114df734\cycles.py", line 333, in buildLayers
self.buildLayer("")
File "C:\Users\sello\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\Diffeomorphic-import_daz-d129114df734\cycles.py", line 426, in buildLayer
self.buildBump(uvname)
File "C:\Users\sello\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\Diffeomorphic-import_daz-d129114df734\cycles.py", line 636, in buildBump
self.bumpval,self.bumptex = self.getColorTex("getChannelBump", "NONE", 0, False)
File "C:\Users\sello\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\Diffeomorphic-import_daz-d129114df734\cycles.py", line 880, in getColorTex
tex = self.addTexImageNode(channel, colorSpace, isMask)
File "C:\Users\sello\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\Diffeomorphic-import_daz-d129114df734\cycles.py", line 1788, in addTexImageNode
group.addTextureNodes(assets, maps, colorSpace, isMask)
File "C:\Users\sello\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\Diffeomorphic-import_daz-d129114df734\cgroup.py", line 1700, in addTextureNodes
self.mixColor(map, texnode, outnode)
File "C:\Users\sello\AppData\Roaming\Blender Foundation\Blender\3.4\scripts\addons\Diffeomorphic-import_daz-d129114df734\cgroup.py", line 1735, in mixColor
mix,a,b,out = self.addMixRgbNode(blendType[map.operation], 4)
KeyError: 'blend_soft_light'
Location: D:\Program Files\Blender Foundation\Blender 3.4\3.4\scripts\modules\bpy\ops.py:113
So I Updated the blendType
dict in cgroup.py
's mixColor
function to:
blendType = {
"multiply" : 'MULTIPLY',
"add" : 'ADD',
"subtract" : 'SUBTRACT',
"alpha_blend" : 'MIX',
# DS 4.20.1.84+ / file_version 0.6.1.0+ modes:
"blend_clear" : 'MIX', # ???
"blend_destination" : 'MIX', # ???
"blend_destination_atop" : 'MIX', # ???
"blend_destination_in" : 'MIX', # ???
"blend_destination_out" : 'MIX', # ???
"blend_destination_over" : 'MIX', # ???
"blend_source" : 'MIX', # ???
"blend_source_atop" : 'MIX', # ???
"blend_source_in" : 'MIX', # ???
"blend_source_out" : 'MIX', # ???
"blend_source_over" : 'MIX', # ???
"blend_xor" : 'MIX', # eh...
"blend_color_burn" : 'BURN',
"blend_color_dodge" : 'DODGE',
"blend_darken" : 'DARKEN',
"blend_difference" : 'DIFFERENCE',
"blend_exclusion" : 'DIFFERENCE', # eh...
"blend_hard_light" : 'LINEAR_LIGHT', # eh...
"blend_lighten": 'LIGHTEN',
"blend_multiply" : 'MULTIPLY',
"blend_overlay": 'OVERLAY',
"blend_plus" : 'ADD',
"blend_screen" : 'SCREEN',
"blend_soft_light": 'SOFT_LIGHT',
}
And that seemed to work. Not all the new modes have matching blend modes in blender, but I figure “MIX” at least lets the import continue even if the materials are off.
Comments (3)
-
repo owner -
reporter - changed status to closed
Awesome, thanks!
-
- changed status to resolved
- Log in to comment
Thanks for spotting this. I added the blend modes that make sense, and use MIX as default so the problem doesn’t reappear if daz adds additional modes in the future.