thanks for this - I've been trying to get a python script to help with lip sync -- this seems to be something that has been solved years ago, but so far I'm struggling....I've been having the merlin plug in help with my python, but am wondering if you can just point me in the right direction: ideally I'd import a csv file that has frame numbers and visemes, then the script would pose my model with the pose name that matches the viseme name at the relevant frames. I've gotten 'parts' of this to work, like applying a pose on a very simple armature, but think I must have a concept or several wrong in getting python to 'find' and apply the poses. Any help appreciated
i don't understand your problem properly and the tools you are mentioning i have no experience with, but if you are talking about poses, you might need to search for actions and the values on the keyframes of those actions
constraint.type is how you get the constraint type. C.active_pose_bone.constraints.remove(constraint) is how to delete it. Example (hopefully the youtube respects the spacing i used here): select the bone you want to remove constraints from: for constraint in C.active_pose_bone.constraints: if constraint.type == 'COPY_TRANSFORMS': C.active_pose_bone.constraints.remove(constraint)
@@slephy I was hoping to select the bone that I wanted to delete the constraint of based on its name rather than whether it's the active bone, but now I'm guessing that it might only be possible to do this operation with Python if the bone is actively selected. Is that correct?
@@slephy I'm getting an error that says "'PoseBone' object is not iterable," but maybe that has something to do with the fact that I'm still on Blender 3.6?
@@mienaiknife No, you can't iterate through a single pose bone, because it's not part of a list, but you can iterate through the constraints of a single pose bone.
In fact :
bpy.context.object.pose.bones['bone 1'].bone.
&
bpy.context.object.data.bones['bone 1'].
give you access to the exact same commands.
Truuuuuuuuueeee 😆
thank you so much for this video! it's taught me a ton
you're welcome :)
Enjoyed this! Thanks.😎
♥️
Thanks a lot for the video ♥
thanks for this - I've been trying to get a python script to help with lip sync -- this seems to be something that has been solved years ago, but so far I'm struggling....I've been having the merlin plug in help with my python, but am wondering if you can just point me in the right direction: ideally I'd import a csv file that has frame numbers and visemes, then the script would pose my model with the pose name that matches the viseme name at the relevant frames. I've gotten 'parts' of this to work, like applying a pose on a very simple armature, but think I must have a concept or several wrong in getting python to 'find' and apply the poses. Any help appreciated
i don't understand your problem properly and the tools you are mentioning i have no experience with, but if you are talking about poses, you might need to search for actions and the values on the keyframes of those actions
How do I delete a bone constraint based on what type of constraint it is?
constraint.type is how you get the constraint type. C.active_pose_bone.constraints.remove(constraint) is how to delete it. Example (hopefully the youtube respects the spacing i used here): select the bone you want to remove constraints from:
for constraint in C.active_pose_bone.constraints:
if constraint.type == 'COPY_TRANSFORMS':
C.active_pose_bone.constraints.remove(constraint)
@@slephy I was hoping to select the bone that I wanted to delete the constraint of based on its name rather than whether it's the active bone, but now I'm guessing that it might only be possible to do this operation with Python if the bone is actively selected. Is that correct?
@@mienaiknife No, you can easily do it with the bone name: C.object.pose.bones['bone_name']
@@slephy I'm getting an error that says "'PoseBone' object is not iterable," but maybe that has something to do with the fact that I'm still on Blender 3.6?
@@mienaiknife No, you can't iterate through a single pose bone, because it's not part of a list, but you can iterate through the constraints of a single pose bone.