From 6c9f393a31e90b80a4172f74068f786a92560771 Mon Sep 17 00:00:00 2001 From: StjerneIdioten Date: Sat, 30 Sep 2023 00:25:21 +0200 Subject: [PATCH] fix(material): disable export of diffuse color when a texture or emissive map is selected fix #173 close #174 --- addon/i3dio/node_classes/material.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/addon/i3dio/node_classes/material.py b/addon/i3dio/node_classes/material.py index 8b8cf91..1961284 100644 --- a/addon/i3dio/node_classes/material.py +++ b/addon/i3dio/node_classes/material.py @@ -116,8 +116,11 @@ def _diffuse_from_nodes(self, node): file_id = self.i3d.add_file_image(diffuse_image_path) self.xml_elements['Texture'] = xml_i3d.SubElement(self.element, 'Texture') self._write_attribute('fileId', file_id, 'Texture') - # Write the diffuse colors - self._write_diffuse(diffuse) + else: + # Write the diffuse colors + emission_socket = node.inputs['Emission'] + if not emission_socket.is_linked: + self._write_diffuse(diffuse) def _emissive_from_nodes(self, node): emission_socket = node.inputs['Emission']