#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.