Commit 47ea08f7c34d68a8c25ff02ae840c4d96aa3a448

Authored by Adabriand Furtado
1 parent 63807aa9
Exists in master

Adicionado limites (superior e inferior) para rotação inválidaa.

Showing 2 changed files with 9 additions and 3 deletions   Show diff stats
@@ -117,7 +117,7 @@ def cocar(action, mov_param, bones, initialFrame = 18, frameJump = 10): @@ -117,7 +117,7 @@ def cocar(action, mov_param, bones, initialFrame = 18, frameJump = 10):
117 117
118 def alisar(action, mov_param, bones, is_right_hand, initialFrame = 18, frameJump = 10, width = 0.25): 118 def alisar(action, mov_param, bones, is_right_hand, initialFrame = 18, frameJump = 10, width = 0.25):
119 currentFrame = initialFrame 119 currentFrame = initialFrame
120 - plane = mov_param['plano'] if 'plano' in mov_param else "perpendicular" 120 + plane = mov_param['orientacao_movimento'] if 'orientacao_movimento' in mov_param else "perpendicular"
121 repetition = mov_param['repeticoes'] if 'repeticoes' in mov_param else 2 121 repetition = mov_param['repeticoes'] if 'repeticoes' in mov_param else 2
122 handParam = read_hand_param(mov_param) 122 handParam = read_hand_param(mov_param)
123 util.setPose(action, handParam, [currentFrame], bones) 123 util.setPose(action, handParam, [currentFrame], bones)
@@ -61,6 +61,11 @@ left_bones_conf = dict_bones[conf_esquerda_id] + dict_bones[pa_esquerda_id] + di @@ -61,6 +61,11 @@ left_bones_conf = dict_bones[conf_esquerda_id] + dict_bones[pa_esquerda_id] + di
61 61
62 last_keyframe_dict = {} 62 last_keyframe_dict = {}
63 63
  64 +# Invalid rotation lower bound - 60 degree
  65 +invalid_rotation_lower_bound = math.pi/3
  66 +# Invalid rotation upper bound - 330 degree
  67 +invalid_rotation_upper_bound = (11*math.pi)/6
  68 +
64 def pose_default(current_frame, frame_jump): 69 def pose_default(current_frame, frame_jump):
65 setPose(all_actions, [0, 0, 0, 0, 0, 0, 0], [current_frame], all_bones, False) 70 setPose(all_actions, [0, 0, 0, 0, 0, 0, 0], [current_frame], all_bones, False)
66 return current_frame + frame_jump 71 return current_frame + frame_jump
@@ -233,7 +238,7 @@ def configure_output(): @@ -233,7 +238,7 @@ def configure_output():
233 return 238 return
234 239
235 def render_sign(user_id = "", sinal = "", frame_final = bpy.context.scene.frame_end): 240 def render_sign(user_id = "", sinal = "", frame_final = bpy.context.scene.frame_end):
236 - bpy.context.scene.frame_end = 5 #frame_final 241 + bpy.context.scene.frame_end = frame_final #frame_final
237 bpy.context.scene.render.filepath = tempfile.NamedTemporaryFile().name 242 bpy.context.scene.render.filepath = tempfile.NamedTemporaryFile().name
238 pyutil.log("Render Video Frames: %i" % (frame_final)) 243 pyutil.log("Render Video Frames: %i" % (frame_final))
239 temp_filename = ("%s%0.4i-%0.4i" % (bpy.context.scene.render.filepath, bpy.context.scene.frame_start, bpy.context.scene.frame_end)) 244 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): @@ -317,7 +322,8 @@ def validate_rotation(bone, endFrame, startFrame = 0):
317 scene.frame_set(endFrame) 322 scene.frame_set(endFrame)
318 for k in range(1, len(rotFrames), 1): 323 for k in range(1, len(rotFrames), 1):
319 for i in range(0, 3, 1): 324 for i in range(0, 3, 1):
320 - if (math.fabs(rotFrames[k][i] - rotFrames[k-1][i])) > math.pi/3: 325 + delta_rotation = math.fabs(rotFrames[k][i] - rotFrames[k-1][i])
  326 + if (delta_rotation > invalid_rotation_lower_bound and delta_rotation < invalid_rotation_upper_bound):
321 return False 327 return False
322 return True 328 return True
323 329