首页 > 解决方案 > How to move an armature in an "arm curl" like manner

问题描述

I am currently trying to figure out how to move an armature like this picture below: Armature Example: because I have done something similar but I was just wondering if there is a method or way of doing it that I may have to take into account:

Also here is the code that I used for my script in python but I am not getting the desired results that I want.

import bpy

#Very Experimental code above 

#This part move the LArm bone
bpy.ops.transform.translate(value=(-0.0482102, 0.0114472, 0.0880355), constraint_axis=(False, False, False), constraint_orientation='GLOBAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1.61051)
bpy.ops.transform.translate(value=(-0.305557, 0.0572005, 0.432175), constraint_axis=(False, False, False), constraint_orientation='GLOBAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1.61051)
bpy.ops.transform.translate(value=(-0.418317, 0.065683, 0.488198), constraint_axis=(False, False, False), constraint_orientation='GLOBAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1.61051)
bpy.ops.transform.translate(value=(-0.0400046, 0.0210943, 0.168067), constraint_axis=(False, False, False), constraint_orientation='GLOBAL', mirror=False, proportional='DISABLED', proportional_edit_falloff='SMOOTH', proportional_size=1.61051)

#This part rotates the LArm bone
    w =  3.055
    x = -0.600
    y = 0.400
    z = -0.518
    Subject = "LArm"
    bpy.context.object.pose.bones[Subject].rotation_quaternion[0] = w
    bpy.context.object.pose.bones[Subject].rotation_quaternion[1] = x
    bpy.context.object.pose.bones[Subject].rotation_quaternion[2] = y
    bpy.context.object.pose.bones[Subject].rotation_quaternion[3] = z
    bpy.context.object.pose.bones[Subject].lock_rotations_4d = True
    bpy.context.object.pose.bones[Subject].lock_rotation_w = True

Also I would rather have an explanation of how to move it in that desired position, not so much a breakdown of the code I am using however if that is the case then go right ahead and clarify the reason as to why it would solve the issue.

Hopefully there isn't any confusion what I am trying to ask, but if there is please tell me and I will try my best to solve this issue.

Also, if it isn't much trouble could someone add the tag "armature" if possible, thanks.

Never mind I solved the issue It was as simple as fixing the w and z values

标签: pythonblender

解决方案


推荐阅读