Closed FrankV724 closed 7 months ago
Inside finalizematerials.py, we can add three simple lines to add the normal map to the optimized material.
First addition:
if mat.node_tree.nodes.get('Image Texture'): if ' light.png' in mat.node_tree.nodes['Image Texture'].image.name: light_image = mat.node_tree.nodes['Image Texture'].image.name dark_image = mat.node_tree.nodes['Image Texture'].image.name.replace('light', 'dark') normal_image = mat.node_tree.nodes['Image Texture'].image.name.replace('light', 'normal') # here else: dark_image = mat.node_tree.nodes['Image Texture'].image.name light_image = mat.node_tree.nodes['Image Texture'].image.name.replace('dark', 'light') normal_image = mat.node_tree.nodes['Image Texture'].image.name.replace('dark', 'normal') # here
Second addition:
new_node.nodes['MapMain'].image = bpy.data.images[light_image] new_node.nodes['Darktex'].image = bpy.data.images[dark_image] new_node.nodes['MapNorm'].image = bpy.data.images[normal_image] # here
Thanks, I added your edits in.
Inside finalizematerials.py, we can add three simple lines to add the normal map to the optimized material.
First addition:
Second addition: