io_scene_3ds: cleanup texture handling #10
@ -302,7 +302,21 @@ def add_texture_to_material(image, contextWrapper, pct, extend, alpha, scale, of
|
|||||||
elif extend == 'noWrap':
|
elif extend == 'noWrap':
|
||||||
img_wrap.extension = 'CLIP'
|
img_wrap.extension = 'CLIP'
|
||||||
if alpha == 'alpha':
|
if alpha == 'alpha':
|
||||||
links.new(img_wrap.node_image.outputs['Alpha'], img_wrap.socket_dst)
|
for link in links:
|
||||||
|
if link.from_node.type == 'TEX_IMAGE' and link.to_node.type == 'MIX_RGB':
|
||||||
|
tex = link.from_node.image.name
|
||||||
|
own_node = img_wrap.node_image
|
||||||
|
own_map = img_wrap.node_mapping
|
||||||
|
if tex == image.name:
|
||||||
|
links.new(link.from_node.outputs['Alpha'], img_wrap.socket_dst)
|
||||||
|
nodes.remove(own_map)
|
||||||
|
nodes.remove(own_node)
|
||||||
|
for imgs in bpy.data.images:
|
||||||
|
if imgs.name[-3:].isdigit():
|
||||||
|
if not img.users:
|
||||||
|
bpy.data.images.remove(imgs)
|
||||||
|
else:
|
||||||
|
links.new(img_wrap.node_image.outputs['Alpha'], img_wrap.socket_dst)
|
||||||
|
|
||||||
shader.location = (300, 300)
|
shader.location = (300, 300)
|
||||||
contextWrapper._grid_to_location(1, 0, dst_node=contextWrapper.node_out, ref_node=shader)
|
contextWrapper._grid_to_location(1, 0, dst_node=contextWrapper.node_out, ref_node=shader)
|
||||||
|
Reference in New Issue
Block a user