Skip to content

Commit 0298f25

Browse files
Fix characterlegacy.shpk outline issue
- sets interpolation to closest for the index texture
1 parent 725db3f commit 0298f25

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

MeddleTools/node_groups.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@ def __init__(self, name: str, mapping_definitions: list):
88
self.mapping_definitions = mapping_definitions
99

1010
class PngMapping:
11-
def __init__(self, property_name: str, color_dest: str, alpha_dest: str | None, color_space: str):
11+
def __init__(self, property_name: str, color_dest: str, alpha_dest: str | None, color_space: str, interpolation: str = 'Linear'):
1212
self.property_name = property_name
1313
self.color_dest = color_dest
1414
self.alpha_dest = alpha_dest
1515
self.color_space = color_space
16+
self.interpolation = interpolation
1617

1718
def __repr__(self):
1819
return f"PngMapping({self.property_name}, {self.color_dest}, {self.alpha_dest}, {self.color_space})"
@@ -43,6 +44,7 @@ def apply(self, material, groupNode, properties, directory, node_height):
4344
texture.image = bpy.data.images.load(path.join(directory, pathStr))
4445
texture.location = (-500, node_height)
4546
texture.image.colorspace_settings.name = self.color_space
47+
texture.interpolation = self.interpolation
4648

4749
if self.alpha_dest is not None:
4850
material.links.new(texture.outputs['Alpha'], groupNode.inputs[self.alpha_dest])
@@ -346,7 +348,6 @@ def getRowInputs(self, row, suffix):
346348

347349

348350
class ColorSetMapping:
349-
# ColorSetMapping('ColorTable', 'g_SamplerIndex_PngCachePath', 'DiffuseTableA', 'DiffuseTableB', 'SpecularTableA', 'SpecularTableB', 'color_a', 'color_b', 'specular_a', 'specular_b', 'id_mix'),
350351
def __init__(self, property_name: str, id_texture_name: str, color_ramp_a: str, color_ramp_b: str, specular_ramp_a: str, specular_ramp_b: str, color_a_dest: str, color_b_dest: str, specular_a_dest: str, specular_b_dest: str, index_g_dest: str):
351352
self.property_name = property_name
352353
self.id_texture_name = id_texture_name
@@ -430,6 +431,7 @@ def apply(self, material, groupNode, properties, directory, node_height):
430431
texture.name = self.id_texture_name
431432
texture.label = self.id_texture_name
432433
texture.image.colorspace_settings.name = 'Non-Color'
434+
texture.interpolation = 'Closest'
433435

434436

435437
# separate color

0 commit comments

Comments
 (0)