Skip to content

Instantly share code, notes, and snippets.

@dskjal
Last active March 27, 2018 07:14
Show Gist options
  • Select an option

  • Save dskjal/7e89bf47a11db213e7da0e4631c7611a to your computer and use it in GitHub Desktop.

Select an option

Save dskjal/7e89bf47a11db213e7da0e4631c7611a to your computer and use it in GitHub Desktop.

Revisions

  1. dskjal revised this gist Mar 27, 2018. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion remove_modifier.py
    Original file line number Diff line number Diff line change
    @@ -29,6 +29,6 @@
    for b in bpy.context.selected_pose_bones:
    for c in b.constraints:
    if c.name == 'Copy Rotation':
    bone.constraints.remove(c)
    b.constraints.remove(c)
    break

  2. dskjal revised this gist Mar 27, 2018. 1 changed file with 2 additions and 4 deletions.
    6 changes: 2 additions & 4 deletions remove_modifier.py
    Original file line number Diff line number Diff line change
    @@ -26,10 +26,8 @@
    bone.constraints.remove(c)

    #選択されているボーンのみが対象
    selected_bone_names = [b.name for b in bpy.context.active_object.data.bones if b.select]
    for name in selected_bone_names:
    bone = bpy.context.active_object.pose.bones[name]
    for c in bone.constraints:
    for b in bpy.context.selected_pose_bones:
    for c in b.constraints:
    if c.name == 'Copy Rotation':
    bone.constraints.remove(c)
    break
  3. dskjal revised this gist Jan 8, 2017. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion remove_modifier.py
    Original file line number Diff line number Diff line change
    @@ -15,7 +15,7 @@
    if c.target.name == 'Empty':
    bone.constraints.remove(c)
    break
    #Constraint のボーン名で削除
    #Constraint のターゲットボーン名で削除
    if c.subtarget.name == 'Bone.001':
    bone.constraints.remove(c)
    break
  4. dskjal revised this gist Jan 8, 2017. 1 changed file with 13 additions and 13 deletions.
    26 changes: 13 additions & 13 deletions remove_modifier.py
    Original file line number Diff line number Diff line change
    @@ -1,36 +1,36 @@
    import bpy

    #アクティブなアーマチュアのすべてのボーンが対象
    for bone in bpy.data.objects[bpy.context.active_object.name].pose.bones:
    #最初の一つだけを削除する
    #アクティブなアーマチュアのすべてが対象
    for bone in bpy.context.active_object.pose.bones:
    for c in bone.constraints:
    #名前
    #Constraint の名前で削除
    if c.name == 'Limit Location':
    bone.constraints.remove(c)
    break
    #モディフィアのタイプ
    #Constraint の型で削除
    if c.type == 'COPY_ROTATION':
    bone.constraints.remove(c)
    break
    #モディフィアのターゲット
    #Constraint のターゲット名で削除
    if c.target.name == 'Empty':
    bone.constraints.remove(c)
    break
    #ターゲットボーン
    #Constraint のボーン名で削除
    if c.subtarget.name == 'Bone.001':
    bone.constraints.remove(c)
    break

    #モディフィアについてる Transformation モディフィアをすべて削除
    #ボーンについているすべての Transfromation を削除
    crs = [c for c in bone.constraints if c.type == 'TRANSFORM']
    for c in crs:
    bone.constraints.remove(c)

    #アクティブなアーマチュアの選択されているボーンのみが対象
    selected_bone_names = [b.name for b in bpy.data.objects[bpy.context.active_object.name].data.bones if b.select]
    #選択されているボーンのみが対象
    selected_bone_names = [b.name for b in bpy.context.active_object.data.bones if b.select]
    for name in selected_bone_names:
    bone = bpy.data.objects[bpy.context.active_object.name].pose.bones[name]
    bone = bpy.context.active_object.pose.bones[name]
    for c in bone.constraints:
    if c.name == 'Copy Location':
    if c.name == 'Copy Rotation':
    bone.constraints.remove(c)
    break
    break

  5. dskjal created this gist Jan 8, 2017.
    36 changes: 36 additions & 0 deletions remove_modifier.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,36 @@
    import bpy

    #アクティブなアーマチュアのすべてのボーンが対象
    for bone in bpy.data.objects[bpy.context.active_object.name].pose.bones:
    #最初の一つだけを削除する
    for c in bone.constraints:
    #名前
    if c.name == 'Limit Location':
    bone.constraints.remove(c)
    break
    #モディフィアのタイプ
    if c.type == 'COPY_ROTATION':
    bone.constraints.remove(c)
    break
    #モディフィアのターゲット
    if c.target.name == 'Empty':
    bone.constraints.remove(c)
    break
    #ターゲットボーン
    if c.subtarget.name == 'Bone.001':
    bone.constraints.remove(c)
    break

    #モディフィアについてる Transformation モディフィアをすべて削除
    crs = [c for c in bone.constraints if c.type == 'TRANSFORM']
    for c in crs:
    bone.constraints.remove(c)

    #アクティブなアーマチュアの選択されているボーンのみが対象
    selected_bone_names = [b.name for b in bpy.data.objects[bpy.context.active_object.name].data.bones if b.select]
    for name in selected_bone_names:
    bone = bpy.data.objects[bpy.context.active_object.name].pose.bones[name]
    for c in bone.constraints:
    if c.name == 'Copy Location':
    bone.constraints.remove(c)
    break