Page 1 of 1

Blender mhx2 movement

PostPosted: Fri Nov 09, 2018 3:21 am
by cch
I'm trying to animate mhx2 rig to a set of desired motions, but I'm not sure how to go about this. I do NOT have a mocap file that is going to be imported, but should I be making my own bvh file? Or is there any way to write a script of motion paths or joint angles to set the movements?

Thank you.

Re: Blender mhx2 movement

PostPosted: Fri Nov 09, 2018 10:27 am
by joepal
I guess you could make the animation visually in blender (by moving around bones and setting keyframes), select the rig and then do file->export->BVH. That'd probably be the easiest way, depending on what your end goal is.

Re: Blender mhx2 movement

PostPosted: Fri Nov 16, 2018 6:38 am
by cch
I'm trying to eventually simulate specific movements of the leg, either from video data or from a set list of joint positions. Is there a way to script the desired joint angles, rotations, or motion path?

Re: Blender mhx2 movement

PostPosted: Fri Nov 16, 2018 8:09 am
by joepal
Blender python is pretty competent. A structured way to do this scripting is to write your own addon, but if you go to the text/script view you can run arbitrary scripts.

If you have a selected rig object containing a bone called "leftleg", you can access it through:

Code: Select all
import bpy
obj = bpy.context.scene.objects.active
armature = obj.armature
bpy.ops.object.mode_set(mode='POSE')
bones = self.armature.pose.bones
leftleg = bones['leftleg']


The variable leftleg is then an instance of this: https://docs.blender.org/api/blender_py ... eBone.html

(the above is out of my head and not tested, might contain typos)