TransMat icon indicating copy to clipboard operation
TransMat copied to clipboard

transmat crashing on the emission settings and when the emission node is in the material

Open darthron1975 opened this issue 2 years ago • 1 comments

I wanted to export few materials that were created by the kotorblender plugin and some of those use the emission node in place of the Principled BSDF shader. Every time i hit translate material it throws the following errors:

Python: Traceback (most recent call last): File "C:\Users\luke\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\TransMat.py", line 614, in execute to_socket = str(f"'{socket_translate[ID][socket]}'") KeyError: 'ShaderNodeEmission'

location: :-1

and

Python: Traceback (most recent call last): File "C:\Users\luke\AppData\Roaming\Blender Foundation\Blender\2.93\scripts\addons\TransMat.py", line 485, in execute nodedata['pln_create'].append( str(f"{nodename}{socket_translate[ID][input.name]} = create_expression({material.name}, unreal.MaterialExpressionConstant, {nodedata['pln_location']}") ) KeyError: 'Emission Strength'

location: :-1 .

here is also the node layout of 2 of the materials if needed Screenshot (10)

Screenshot (11)

darthron1975 avatar Oct 25 '23 11:10 darthron1975

Unfortunately, I'm not sure what support to offer in this case, it has been a few years since I worked on this addon, and I have since stopped working on Epic/Unreal related projects.

I agree with your assessment that there is an issue with translating the Emission node, and I can tell you that the whole addon works via strings in dictionaries, so if there was a change made to one of the strings (e.g. it used to be 'Emission Strength' and now it's just 'Strength') it could cause the errors you are encountering.

I know that's not much help, but there is also an alternative implementation, one that actually inspired this project to begin with, but has been updated more recently: https://github.com/angjminer/blueman

If you want to try and get the code working I can try and help with error codes or explanations, but no longer being an Unreal user that might be the best I can do.

SpectralVectors avatar Oct 28 '23 18:10 SpectralVectors