使用bpy修改并创建节点,使用新的连接方式
作者:
小沙盒工作室 | 来源:发表于
2022-04-16 11:50 被阅读0次#from easybpy import *
import bpy
mat = bpy.context.object.active_material
nodes = mat.node_tree.nodes
#clear all node
nodes.clear()
#create node
imageTex = nodes.new(type="ShaderNodeTexImage")
bsdf = nodes.new(type='ShaderNodeBsdfPrincipled')
node_output = nodes.new(type='ShaderNodeOutputMaterial')
#setup image
print(imageTex)
imageTex.image = bpy.data.images[0]
#link together
links = mat.node_tree.links
link_image_bsdf = links.new(imageTex.outputs[0], bsdf.inputs[0])
link_bsdf_out = links.new(bsdf.outputs[0], node_output.inputs[0])
本文标题:使用bpy修改并创建节点,使用新的连接方式
本文链接:https://www.haomeiwen.com/subject/xmzcertx.html
网友评论