python - 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
解决方案
推荐阅读
- excel - 来自单个单元格的最大值,然后表示
- caching - nuxt 支持 Cache Busting 吗?
- optimization - 任何 NEON 指令都可以在 Cortex A53 或 A55 上通过向量长乘累加 (SMLAL) 双重发出?
- reactjs - 在 componentDidUpdate 上 setState 到窗口变量一次
- javascript - 角度不确定复选框功能不起作用
- batch-file - 我们可以使用 if 条件来比较 BATCH SCRIPT 中的两个日期吗?
- karate - 空手道:问号被编码为路径的一部分
- r - 强制绘图在中间有“0”,并且在 R 中为 + 和 - 值等量缩放
- c# - 如何使用数据库优先更改连接字符串
- ios - 转换后获取不正确的日期格式