Commit 7357e74e1ed0290db566aa307605db40135e8faf
1 parent
29821cc0
Exists in
master
Corrige função do movimento cicular
Showing
3 changed files
with
12 additions
and
8 deletions
Show diff stats
avatar_Hozana_wikiLibras.blend
No preview for this file type
libras.py
... | ... | @@ -4,6 +4,7 @@ |
4 | 4 | import sys |
5 | 5 | import os |
6 | 6 | |
7 | + | |
7 | 8 | # insere o diretorio atual no path |
8 | 9 | # permite que o código seja executado de qualquer diretório, possibilitando acesso aos modulos locais |
9 | 10 | sys.path.append(os.getcwd()) |
... | ... | @@ -15,12 +16,12 @@ import json |
15 | 16 | # importa modulos locais |
16 | 17 | import util |
17 | 18 | import moves |
18 | -''' | |
19 | + | |
19 | 20 | # verifica a quantidade de argumentos recebidos |
20 | 21 | if (len(sys.argv) != 6): |
21 | 22 | print ("WikiLibras: Invalid number of arguments") |
22 | 23 | exit(1) |
23 | -''' | |
24 | + | |
24 | 25 | # tenta decodificar o argumento JSON recebido |
25 | 26 | try: |
26 | 27 | json_input = json.loads(sys.argv[5]) |
... | ... | @@ -32,7 +33,7 @@ except (ValueError, KeyError, TypeError): |
32 | 33 | util.outconf() |
33 | 34 | |
34 | 35 | # define a posição dos keyframes |
35 | -hands_default_frames = [15, 18] | |
36 | +hands_default_frames = [15,18] | |
36 | 37 | |
37 | 38 | # Carrega o objeto presente no avatar |
38 | 39 | armature = bpy.context.scene.objects.get('Armature.001') |
... | ... | @@ -114,7 +115,8 @@ def configureHands(): |
114 | 115 | generationConfigurations(actions[i], json_input[hands[i]][-3:], hands_default_frames, bones_[i]) |
115 | 116 | if(move == "circular" or move == "semicircular"): |
116 | 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 | 120 | elif(json_input[hands[i]][0] == "retilineo"): |
119 | 121 | pass |
120 | 122 | |
... | ... | @@ -125,10 +127,11 @@ def configureFace(): |
125 | 127 | # Set face |
126 | 128 | faceConfiguration(json_input["facialExp"], [endFrame/2], util.faceBonesConf) |
127 | 129 | |
130 | +# Default Pose | |
131 | +poseDefault([1, endFrame+15], util.allBones) | |
128 | 132 | configureHands() |
129 | 133 | configureFace() |
130 | 134 | |
131 | -# Default Pose | |
132 | -poseDefault([0, endFrame+15], util.allBones) | |
135 | + | |
133 | 136 | |
134 | 137 | util.render_sign(json_input["userId"], json_input["signName"], 1, endFrame + 25) | ... | ... |
moves.py
1 | 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 | 6 | rad2 = (radius/2) |
6 | 7 | currentFrame = initialFrame |
7 | 8 | for l in range(initialPosition, initialPosition + math.floor(8 * laps) + 1): | ... | ... |