Blender: Difference between revisions

2,657 bytes added ,  27 December 2020
Added the Rig bone constraint target setting script
mNo edit summary
(Added the Rig bone constraint target setting script)
Line 93: Line 93:
===Blender Forward throw adjustment script===
===Blender Forward throw adjustment script===
[[XML:TRAM#Blender_Forward_throw_adjustment_script|Please see the XML:TRAM page describing this script.]]
[[XML:TRAM#Blender_Forward_throw_adjustment_script|Please see the XML:TRAM page describing this script.]]
===Rig bone constraint target setting script===
This script sets the targets of Geyser's rig bone constraints, after removing one of the existing pose-matchine characters and replacing it with another.
<pre>import bpy
obj = bpy.data.objects
#SET THIS TO EITHER 1 OR 2 DEPENDING ON WHICH POSE YOU ARE GOING TO USE
prefix='1'
armature = bpy.data.objects['rig']
#copying location
armature.pose.bones["torso"].constraints['Copy Location.00'+prefix].target=obj['mid.00'+prefix]
armature.pose.bones["torso_pivot"].constraints['Copy Location.00'+prefix].target=obj['pelvis.00'+prefix]
#copying rotation
#Torso
armature.pose.bones["hips"].constraints['Copy Rotation.00'+prefix].target=obj['pelvis.00'+prefix]
armature.pose.bones["tweak_spine.001"].constraints['Copy Rotation.00'+prefix].target=obj['mid.00'+prefix]
armature.pose.bones["chest"].constraints['Copy Rotation.00'+prefix].target=obj['chest.00'+prefix]
armature.pose.bones["shoulder.R"].constraints['Copy Rotation.00'+prefix].target=obj['right_shoulder.00'+prefix]
armature.pose.bones["shoulder.L"].constraints['Copy Rotation.00'+prefix].target=obj['left_shoulder.00'+prefix]
armature.pose.bones["neck"].constraints['Copy Rotation.00'+prefix].target=obj['neck.00'+prefix]
armature.pose.bones["head"].constraints['Copy Rotation.00'+prefix].target=obj['head.00'+prefix]
#Arms
armature.pose.bones["upper_arm_fk.L"].constraints['Copy Rotation.00'+prefix].target=obj['left_biceps.00'+prefix]
armature.pose.bones["upper_arm_fk.R"].constraints['Copy Rotation.00'+prefix].target=obj['right_biceps.00'+prefix]
armature.pose.bones["forearm_fk.L"].constraints['Copy Rotation.00'+prefix].target=obj['left_wrist.00'+prefix]
armature.pose.bones["forearm_fk.R"].constraints['Copy Rotation.00'+prefix].target=obj['right_wrist.00'+prefix]
armature.pose.bones["hand_fk.L"].constraints['Copy Rotation.00'+prefix].target=obj['left_handfist.00'+prefix]
armature.pose.bones["hand_fk.R"].constraints['Copy Rotation.00'+prefix].target=obj['right_handfist.00'+prefix]
#Legs
armature.pose.bones["thigh_fk.L"].constraints['Copy Rotation.00'+prefix].target=obj['left_thigh.00'+prefix]
armature.pose.bones["thigh_fk.R"].constraints['Copy Rotation.00'+prefix].target=obj['right_thigh.00'+prefix]
armature.pose.bones["shin_fk.L"].constraints['Copy Rotation.00'+prefix].target=obj['left_calf.00'+prefix]
armature.pose.bones["shin_fk.R"].constraints['Copy Rotation.00'+prefix].target=obj['right_calf.00'+prefix]
armature.pose.bones["foot_fk.L"].constraints['Copy Rotation.00'+prefix].target=obj['left_foot.00'+prefix]
armature.pose.bones["foot_fk.R"].constraints['Copy Rotation.00'+prefix].target=obj['right_foot.00'+prefix]</pre>


[[Category:Bi-platform modding tools]]
[[Category:Bi-platform modding tools]]
191

edits