Open wikid24 opened 1 year ago
I think I found out how to do it with this code:
import bpy
from mmd_tools.core.bone import FnBone
armature = bpy.context.active_object
pose_bone = bpy.context.active_object.pose.bones['ankle_L_D']
pose_bone.mmd_bone.has_additional_rotation = True
pose_bone.mmd_bone.additional_transform_bone = 'ankle_L'
FnBone.apply_additional_transformation(armature)
#FnBone.clean_additional_transformation(armature)
There is no API yet that can do the operation you want. 😢
Each properties are updated with the following functions: | Property | Update functions |
---|---|---|
has_additional_rotation |
_updateMMDBoneAdditionalTransform |
|
additional_transform_bone |
_setAdditionalTransformBone , _updateMMDBoneAdditionalTransform |
I think that properties can be safely updated by programming the same thing as these functions.
thanks for this!
Yesterday I spent almost the entire day trying to debug a defect with function I created. Function was using was working perfectly fine in one library, but in another library, it was applying a completely random pose bone. I didn't know about the .as_pointer(), but now that I know it is needed, I will attempt to recreate your code. :)
Hi,
I am trying to automate some of the MMD model conversion stuff I am doing via python.
I want to apply MMD additional rotation to bone 'ankle_L_D', and the transformation target is 'ankle_L'.
Is there a way to do this via code? if I were to import an MMD library (not sure which one) is there any code I could write that would be similar to writing something like:
if there is a way, it would save me a TON of time vs trying to reverse engineer the whole thing