INNER CODE UNIT · Python
alter_sequence_shape
TimoBolkart/voca · edit_sequences.py:112
def alter_sequence_shape(source_path, out_path, flame_model_fname, pc_idx=0, pc_range=(0,3), uv_template_fname='', texture_img_fname=''):
'''
Load existing animation sequence in "zero pose" and change the identity dependent shape 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 pc_idx Identity shape parameter to be varied in [0,300) as FLAME provides 300 shape paramters
:param pc_range Tuple (start/end, max/min) defining the range of the shape variation.
i.e. (0,3) varies the shape from 0 to 3 stdev and back to 0
'''
if pc_idx < 0 or pc_idx >= 300:
print('shape parameter index out of range [0,300)')
return
if not os.path.exists(out_path):
os.makedirs(out_path)