한 번에 여러 이미지의 텍스처 보간을 변경하는 방법은 무엇입니까? [복제]

Nov 19 2020

많은 이미지를 평면으로 가져 왔고 다음과 유사한 문제를 해결하기 위해 텍스처 보간을 선형에서 가장 가까운 것으로 변경해야합니다. 사이클의 투명 이미지 평면에는 이상한 테두리가 있습니다 (나는 eevee에 있지만).

이것은 파이썬으로 할 수 있습니까?

답변

5 susu Nov 19 2020 at 03:28

모든 이미지 텍스처 노드를 찾아 보간 유형을 'Closest'다음 과 같이 설정해야합니다 .

import bpy

# Run through all materials of the current blend file
for mat in bpy.data.materials:
    # If the material has a node tree
    if mat.node_tree:
        # Run through all nodes
        for node in mat.node_tree.nodes:
            # If the node type is texture 
            if node.type == 'TEX_IMAGE':
                # Set the interpolation -> Linear, Closest, Cubic, Smart
                node.interpolation = 'Closest' 

보다: https://docs.blender.org/api/current/bpy.types.ShaderNodeTexImage.html#bpy.types.ShaderNodeTexImage.interpolation