最近想写插件搞批处理,搞不定了
blender吧
全部回复
仅看楼主
level 6
mobilefzb 楼主
所以想把问题发上来,看看有没有人能解决下。
其实就是cycles的相关功能不知到如何调用
我想把布料材质绑定,自动化了,就建立了一个 按钮 执行一个operator,然后在operator里面excute方法里面执行这些代码
def execute(self, context):
#进行平滑
bpy.ops.object.shade_smooth()
bpy.ops.object.mode_set(mode="EDIT")
#subdivide
bpy.ops.mesh.subdivide(number_cuts=50)
bpy.ops.object.mode_set(mode="OBJECT")
#新建材质
cottonMaterial = context.blend_data.materials.new("CottonMaterial")
bpy.ops.object.material_slot_add()
context.active_object.material_slots[0].material = cottonMaterial
# Set Up the Cotton Material
cottonMaterial.name = "CottonMaterial"
#how to set value under cycles mode 关键是blender渲染模式下的设置有现成参考
#就是那个自动生成云那个脚本。但是那个在blender渲染器模式下,cycles下无论如何都无法定位到相关设置
#bpy.ops.node.add_node(use_transform=True,type="ShaderNodeBsdfGlossy")
#bpy.ops.node.add_node(use_transform=True,type="ShaderNodeOutputMaterial")
return {'FINISHED'}
2014年02月11日 13点02分 1
level 9
不明觉厉
2014年02月11日 14点02分 2
level 8
表示这学期开学才学c语言现在一点都看不懂诶,嘛
2014年02月13日 13点02分 3
level 1
建议把这问题发到 blenderartists . org 论坛的 Coding 代码版块 Python Support 分类里,
也许国外网友能解决你的问题。
blenderartists . org/forum/forumdisplay.php?11-Python-Support
2014年02月14日 02点02分 4
刷网页 很痛苦
2014年02月14日 12点02分
level 13
写几个断点,看看哪步没跳过。
有些时候 bpy在console显示的和要输入到脚本里面执行的,有差别
2014年02月14日 14点02分 5
1