STEAM 群組
Blender Tutorial Community BlenderTuts
STEAM 群組
Blender Tutorial Community BlenderTuts
25
遊戲中
223
線上
創立
2012 年 10 月 16 日
語言
英文
地區
United States 
所有討論 > General Discussion > 主題細節
protatoguy 2019 年 11 月 10 日 下午 5:13
How do I add multiple modifers that also modifies the options?
I'm trying to make a script that adds multiple VertexWeightMixes with the first vertex group as bone_01D2 and the vertex B as the list. However, it does not work out as expected, as it adds the modifiers, but does not change the others added after it.
import bpy namelist = [("bone_0200"),("bone_01C8"),("bone_01CE"),"bone_01CC","bone_01C9","bone_01D0","bone_01C1","bone_01CF","bone_01BA", "bone_01BC","bone_01BD","bone_01BB","bone_01D4","bone_01C7","bone_01D3","bone_01C0","bone_0206","bone_0204"] for vertex_b in namelist: vertex_a = "bone_01D2" vertexA = bpy.context.object.vertex_groups.get(vertex_a) vertexB = bpy.context.object.vertex_groups.get(vertex_b) if vertexA is None: print("Vertex " + vertex_a + " Does not Exist!") continue if vertexB is None: print("Vertex " + vertex_b + " Does not Exist!") continue bpy.ops.object.modifier_add(type='VERTEX_WEIGHT_MIX') bpy.context.object.modifiers["VertexWeightMix"].vertex_group_a = vertex_a bpy.context.object.modifiers["VertexWeightMix"].vertex_group_b = vertex_b bpy.context.object.modifiers["VertexWeightMix"].mix_mode = 'ADD' bpy.context.object.modifiers["VertexWeightMix"].mix_set = 'B'
所有討論 > General Discussion > 主題細節