Last active
March 27, 2018 07:14
-
-
Save dskjal/7e89bf47a11db213e7da0e4631c7611a to your computer and use it in GitHub Desktop.
不要なモディフィアを削除するスクリプト
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
#アクティブなアーマチュアのすべてが対象 | |
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 | |
#ボーンについているすべての Transfromation を削除 | |
crs = [c for c in bone.constraints if c.type == 'TRANSFORM'] | |
for c in crs: | |
bone.constraints.remove(c) | |
#選択されているボーンのみが対象 | |
for b in bpy.context.selected_pose_bones: | |
for c in b.constraints: | |
if c.name == 'Copy Rotation': | |
b.constraints.remove(c) | |
break | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment