Does anyone have an idea how I might be able to generate a lot of random poses of a human armature in blender,such as the head or the finger movements ? I would like to create and save several different head or finger movements on the pose library and with a python script I want to randomize and cyclic them. Do you know if someone wrote an addon like this already ? Or how can it be done ? Anyway you can read the full story here :


and here :



1 Answer 1

#i can already tell you you won't like the results.

import math
import bpy
import random
def MoveRandBone(LIMIT1,LIMIT2,BONE_NAME):
    ob = bpy.data.objects['metarig']
    bpy.context.scene.objects.active = ob
    BONE = ob.pose.bones[BONE_NAME]
    BONE.rotation_mode = 'XYZ'
    tmpcheck = random.randint(1,3)
    if tmpcheck == 1:
        axis = 'X'
    if tmpcheck == 2:
        axis = 'Y'
    if tmpcheck == 3:
        axis = 'Z'
    tmpangle = random.randint(LIMIT1,LIMIT2)
    angle = tmpangle
    BONE.rotation_euler.rotate_axis(axis, math.radians(angle))
def cripple():#does everthing
    ob = bpy.context.object
    if ob.type == 'ARMATURE':
        armature = ob.data
        for bone in armature.bones:
def listedlimits():#and since you know what every bone is, you can make your own list and generate a random pose.

#this is just a terrible way to animate, but can be a lot of fun if you just want to see random effects and apply limits to your bones, note that the
#limits here are not the total limit but the limits as to what can be applied. you are far better off going into riggify and creating your own by lining
#an metarig up. Or by using someone elses human rig.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.