初步接触 blender python 技巧笔记
初步接触 blender python 技巧笔记
obj = bpy.data.objects["Cube"]bpy.context.selected_objects
材质相关:https://s-nako.work/2020/08/how-to-get-material-with-python-api-in-blender/
https://blender.stackexchange.com/questions/150874/python-add-existing-nodegroup-to-material
import bpy
C = bpy.context
def instantiate_group(nodes, data_block_name):
group = nodes.new(type='ShaderNodeGroup')
group.node_tree = bpy.data.node_groups[data_block_name]
return group
instantiate_group(C.object.material_slots[0].material.node_tree.nodes, 'NodeGroup')
未经博主允许,禁止直接转载本博客任何内容(可以在文章中添加链接,禁止原文照搬),如需直接原文转载对应文章,请在该文章中留言联系博主,谢谢!!