Compare commits
1 Commits
select-but
...
eac92b808c
Author | SHA1 | Date | |
---|---|---|---|
eac92b808c |
14
common.py
14
common.py
@ -62,6 +62,17 @@ def createFcurve(context, bone_name, transform, index_int):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
def findKeyframe(context, bone, active_frame):
|
||||||
|
arm_object, pose_library = getArmatureData(context)
|
||||||
|
|
||||||
|
for fcu in pose_library.fcurves:
|
||||||
|
if fcu.data_path.startswith('pose.bones["'+bone.name+'"]'):
|
||||||
|
for kp in fcu.keyframe_points:
|
||||||
|
if kp.co.x == active_frame:
|
||||||
|
return fcu.data_path
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def createKeyframe(context, bone_name, transform, index_int, new_marker, loc):
|
def createKeyframe(context, bone_name, transform, index_int, new_marker, loc):
|
||||||
arm_object, pose_library = getArmatureData(context)
|
arm_object, pose_library = getArmatureData(context)
|
||||||
pose_markers = pose_library.pose_markers
|
pose_markers = pose_library.pose_markers
|
||||||
@ -149,6 +160,9 @@ def setBonesfromKeyframes(context, arm_object, active_marker):
|
|||||||
if bone.bone.select or none_selected == True:
|
if bone.bone.select or none_selected == True:
|
||||||
bone_name = bone.name
|
bone_name = bone.name
|
||||||
|
|
||||||
|
if findKeyframe(context, bone, active_marker.frame) is None:
|
||||||
|
continue
|
||||||
|
|
||||||
if bone.rotation_mode == "XYZ":
|
if bone.rotation_mode == "XYZ":
|
||||||
rot_mode = "rotation_euler"
|
rot_mode = "rotation_euler"
|
||||||
elif bone.rotation_mode == "YZX":
|
elif bone.rotation_mode == "YZX":
|
||||||
|
Reference in New Issue
Block a user