@@ -8,11 +8,12 @@ def __init__(self, name: str, mapping_definitions: list):
8
8
self .mapping_definitions = mapping_definitions
9
9
10
10
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' ):
12
12
self .property_name = property_name
13
13
self .color_dest = color_dest
14
14
self .alpha_dest = alpha_dest
15
15
self .color_space = color_space
16
+ self .interpolation = interpolation
16
17
17
18
def __repr__ (self ):
18
19
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):
43
44
texture .image = bpy .data .images .load (path .join (directory , pathStr ))
44
45
texture .location = (- 500 , node_height )
45
46
texture .image .colorspace_settings .name = self .color_space
47
+ texture .interpolation = self .interpolation
46
48
47
49
if self .alpha_dest is not None :
48
50
material .links .new (texture .outputs ['Alpha' ], groupNode .inputs [self .alpha_dest ])
@@ -346,7 +348,6 @@ def getRowInputs(self, row, suffix):
346
348
347
349
348
350
class ColorSetMapping :
349
- # ColorSetMapping('ColorTable', 'g_SamplerIndex_PngCachePath', 'DiffuseTableA', 'DiffuseTableB', 'SpecularTableA', 'SpecularTableB', 'color_a', 'color_b', 'specular_a', 'specular_b', 'id_mix'),
350
351
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 ):
351
352
self .property_name = property_name
352
353
self .id_texture_name = id_texture_name
@@ -430,6 +431,7 @@ def apply(self, material, groupNode, properties, directory, node_height):
430
431
texture .name = self .id_texture_name
431
432
texture .label = self .id_texture_name
432
433
texture .image .colorspace_settings .name = 'Non-Color'
434
+ texture .interpolation = 'Closest'
433
435
434
436
435
437
# separate color
0 commit comments