Commit 7357e74e1ed0290db566aa307605db40135e8faf

Authored by gtaaas
1 parent 29821cc0
Exists in master

Corrige função do movimento cicular

avatar_Hozana_wikiLibras.blend
No preview for this file type
@@ -4,6 +4,7 @@ @@ -4,6 +4,7 @@
4 import sys 4 import sys
5 import os 5 import os
6 6
  7 +
7 # insere o diretorio atual no path 8 # insere o diretorio atual no path
8 # permite que o código seja executado de qualquer diretório, possibilitando acesso aos modulos locais 9 # permite que o código seja executado de qualquer diretório, possibilitando acesso aos modulos locais
9 sys.path.append(os.getcwd()) 10 sys.path.append(os.getcwd())
@@ -15,12 +16,12 @@ import json @@ -15,12 +16,12 @@ import json
15 # importa modulos locais 16 # importa modulos locais
16 import util 17 import util
17 import moves 18 import moves
18 -''' 19 +
19 # verifica a quantidade de argumentos recebidos 20 # verifica a quantidade de argumentos recebidos
20 if (len(sys.argv) != 6): 21 if (len(sys.argv) != 6):
21 print ("WikiLibras: Invalid number of arguments") 22 print ("WikiLibras: Invalid number of arguments")
22 exit(1) 23 exit(1)
23 -''' 24 +
24 # tenta decodificar o argumento JSON recebido 25 # tenta decodificar o argumento JSON recebido
25 try: 26 try:
26 json_input = json.loads(sys.argv[5]) 27 json_input = json.loads(sys.argv[5])
@@ -32,7 +33,7 @@ except (ValueError, KeyError, TypeError): @@ -32,7 +33,7 @@ except (ValueError, KeyError, TypeError):
32 util.outconf() 33 util.outconf()
33 34
34 # define a posição dos keyframes 35 # define a posição dos keyframes
35 -hands_default_frames = [15, 18] 36 +hands_default_frames = [15,18]
36 37
37 # Carrega o objeto presente no avatar 38 # Carrega o objeto presente no avatar
38 armature = bpy.context.scene.objects.get('Armature.001') 39 armature = bpy.context.scene.objects.get('Armature.001')
@@ -114,7 +115,8 @@ def configureHands(): @@ -114,7 +115,8 @@ def configureHands():
114 generationConfigurations(actions[i], json_input[hands[i]][-3:], hands_default_frames, bones_[i]) 115 generationConfigurations(actions[i], json_input[hands[i]][-3:], hands_default_frames, bones_[i])
115 if(move == "circular" or move == "semicircular"): 116 if(move == "circular" or move == "semicircular"):
116 orientation, direction, radius, laps = json_input[hands[i]][1:5] 117 orientation, direction, radius, laps = json_input[hands[i]][1:5]
117 - endFrame = circular_or_semiCircular(handRight, pose, orientation, direction, radius, laps, 5) 118 + endFrame = circular_or_semiCircular(pose, orientation, direction, radius, laps, 5)
  119 + generationConfigurations(actions[i], json_input[hands[i]][-3:], [endFrame], bones_[i])
118 elif(json_input[hands[i]][0] == "retilineo"): 120 elif(json_input[hands[i]][0] == "retilineo"):
119 pass 121 pass
120 122
@@ -125,10 +127,11 @@ def configureFace(): @@ -125,10 +127,11 @@ def configureFace():
125 # Set face 127 # Set face
126 faceConfiguration(json_input["facialExp"], [endFrame/2], util.faceBonesConf) 128 faceConfiguration(json_input["facialExp"], [endFrame/2], util.faceBonesConf)
127 129
  130 +# Default Pose
  131 +poseDefault([1, endFrame+15], util.allBones)
128 configureHands() 132 configureHands()
129 configureFace() 133 configureFace()
130 134
131 -# Default Pose  
132 -poseDefault([0, endFrame+15], util.allBones) 135 +
133 136
134 util.render_sign(json_input["userId"], json_input["signName"], 1, endFrame + 25) 137 util.render_sign(json_input["userId"], json_input["signName"], 1, endFrame + 25)
1 # -*- coding: UTF-8 -*- 1 # -*- coding: UTF-8 -*-
  2 +import math
2 3
3 -def locationCircular(self, center, radius, i_axis, j_axis, k_axis, pose, initialPosition, laps, frameJump = 5, initialFrame = 15, turn = None):  
4 - sqrt22 = radius * math.sqrt(2) / 2 4 +def locationCircular(center, radius, i_axis, j_axis, k_axis, pose, initialPosition, laps, frameJump = 10, initialFrame = 15, turn = None):
  5 + sqrt22 = radius * (math.sqrt(2) / 2)
5 rad2 = (radius/2) 6 rad2 = (radius/2)
6 currentFrame = initialFrame 7 currentFrame = initialFrame
7 for l in range(initialPosition, initialPosition + math.floor(8 * laps) + 1): 8 for l in range(initialPosition, initialPosition + math.floor(8 * laps) + 1):