INNER CODE UNIT · Python
alter_sequence_head_pose
TimoBolkart/voca · edit_sequences.py:159
def alter_sequence_head_pose(source_path, out_path, flame_model_fname, pose_idx=3, rot_angle=np.pi/6, uv_template_fname='', texture_img_fname=''):
'''
Load existing animation sequence in "zero pose" and change the head pose (i.e. rotation around the neck) over time.
:param source_path: path of the animation sequence (files must be provided in OBJ file format)
:param out_path: output path of the altered sequence
:param flame_model_fname: path of the FLAME model
:param pose_idx: head pose parameter to be varied in [3,6)
:param rot_angle: maximum rotation angle in [0,2pi)
'''
if pose_idx < 3 or pose_idx >= 6:
print('pose parameter index out of range [3,6)')
return
if not os.path.exists(out_path):
os.makedirs(out_path)
# Load sequence files