# # July 4 2010 # # Moves body to hold foot fixed during steps. # # usage: # Create the initial stationary walk in place using # walk designer. Next, set the scale of the figure and # adjust the height so that the feet are at ground level. # Remove the key frames for orientation and translation except # for the first one, which cannot be removed. # # Inverse kinematics must be on for left and right leg. The # script will turn on inverse kinematics when it runs. # # The timing of the walk cycle must be 31 frames per cycle. The # pose must be the same at frames 1,32,63,94, etc. The total # number of frames in the walk animation should be # f = N*31 + 1 # where: # f = total frames # N = number of cycles # # Finally, run this script. The figure should wak straight # ahead without slipping or sliding of the feet. # # Do not retime the animation until after you have run this # script. The script depends on the walk cycle being exactly # 31 frames long, which is the natural cycle for walk designer. # import math import poser scene = poser.Scene() figure = scene.CurrentFigure() figure.SetIkStatus(2,1) figure.SetIkStatus(3,1) actor = figure.Actor("Right Foot") body = figure.Actor("Body") px_body = body.Parameter("xTran") py_body = body.Parameter("yTran") p_hdg = body.Parameter("yRotate") pz_body = body.Parameter("zTran") px_actor = actor.Parameter("xTran") pz_actor = actor.Parameter("zTran") scale = 21.0 actor = figure.Actor("Body") pScale = actor.Parameter("Scale") print "Scale = ",pScale.Value() scale = pScale.Value() nf_per_step = 92 # 20x scale nf_per_step = 31 # normal scale first_frame = scene.Frame(); NF = scene.NumFrames() i = first_frame scene.SetFrame(i) new_y = py_body.Value() while i