diff --git a/moves.py b/moves.py index f521541..767763b 100644 --- a/moves.py +++ b/moves.py @@ -117,7 +117,7 @@ def cocar(action, mov_param, bones, initialFrame = 18, frameJump = 10): def alisar(action, mov_param, bones, is_right_hand, initialFrame = 18, frameJump = 10, width = 0.25): currentFrame = initialFrame - plane = mov_param['plano'] if 'plano' in mov_param else "perpendicular" + plane = mov_param['orientacao_movimento'] if 'orientacao_movimento' in mov_param else "perpendicular" repetition = mov_param['repeticoes'] if 'repeticoes' in mov_param else 2 handParam = read_hand_param(mov_param) util.setPose(action, handParam, [currentFrame], bones) diff --git a/util.py b/util.py index 1abb493..0e3e203 100644 --- a/util.py +++ b/util.py @@ -61,6 +61,11 @@ left_bones_conf = dict_bones[conf_esquerda_id] + dict_bones[pa_esquerda_id] + di last_keyframe_dict = {} +# Invalid rotation lower bound - 60 degree +invalid_rotation_lower_bound = math.pi/3 +# Invalid rotation upper bound - 330 degree +invalid_rotation_upper_bound = (11*math.pi)/6 + def pose_default(current_frame, frame_jump): setPose(all_actions, [0, 0, 0, 0, 0, 0, 0], [current_frame], all_bones, False) return current_frame + frame_jump @@ -233,7 +238,7 @@ def configure_output(): return def render_sign(user_id = "", sinal = "", frame_final = bpy.context.scene.frame_end): - bpy.context.scene.frame_end = 5 #frame_final + bpy.context.scene.frame_end = frame_final #frame_final bpy.context.scene.render.filepath = tempfile.NamedTemporaryFile().name pyutil.log("Render Video Frames: %i" % (frame_final)) temp_filename = ("%s%0.4i-%0.4i" % (bpy.context.scene.render.filepath, bpy.context.scene.frame_start, bpy.context.scene.frame_end)) @@ -317,7 +322,8 @@ def validate_rotation(bone, endFrame, startFrame = 0): scene.frame_set(endFrame) for k in range(1, len(rotFrames), 1): for i in range(0, 3, 1): - if (math.fabs(rotFrames[k][i] - rotFrames[k-1][i])) > math.pi/3: + delta_rotation = math.fabs(rotFrames[k][i] - rotFrames[k-1][i]) + if (delta_rotation > invalid_rotation_lower_bound and delta_rotation < invalid_rotation_upper_bound): return False return True -- libgit2 0.21.2