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 :

https://blenderartists.org/t/generating-random-poses/545285

and here :

https://blenderartists.org/t/im-looking-for-some-new-ideas-to-make-a-full-talking-character/1126012/6

up vote 1 down vote accepted
#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
    bpy.ops.object.mode_set(mode='POSE')
    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))
    bpy.ops.object.mode_set(mode='OBJECT')
def cripple():#does everthing
    ob = bpy.context.object
    if ob.type == 'ARMATURE':
        armature = ob.data
        for bone in armature.bones:
            print(bone.name)
            MoveRandBone(300,360,str(bone.name))
def listedlimits():#and since you know what every bone is, you can make your own list and generate a random pose.
    MoveRandBone(350,360,'foot.R')
    MoveRandBone(350,360,'foot.L')
    MoveRandBone(350,360,'shin.R')
listedlimits();

#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

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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