diff --git a/libras.py b/libras.py index 013ae06..d024062 100644 --- a/libras.py +++ b/libras.py @@ -79,7 +79,7 @@ def get_endFrame(): initialFrame, endFrame = 15, get_endFrame() -def circular_or_semiCircular(pose, orientation, direction, radius, laps, intensity = 5, initialFrame = 15): +def circular_or_semiCircular(pose, orientation, direction, radius, laps, intensity = 10, initialFrame = 18): center = pose.location.x, pose.location.y, pose.location.z if(orientation == 'perpendicular'): if(direction == 'horario'): @@ -91,6 +91,11 @@ def circular_or_semiCircular(pose, orientation, direction, radius, laps, intensi endFrame = moves.locationCircular(center, radius, 1, 2, 0, pose, 0, laps, intensity, initialFrame) else: endFrame = moves.locationCircular(center, radius, 2, 1, 0, pose, 0, laps, intensity, initialFrame) + elif(orientation == 'plano'): + if(direction == 'horario'): + endFrame = moves.locationCircular(center, radius, 2, 0, 1, pose, 0, laps, intensity, initialFrame) + else: + endFrame = moves.locationCircular(center, radius, 0, 2, 1, pose, 0, laps, intensity, initialFrame) return endFrame @@ -125,9 +130,10 @@ def configureFace(): global endFrame if(json_input["facialExp"] != []): # Set face - faceConfiguration(json_input["facialExp"], [endFrame/2], util.faceBonesConf) + faceConfiguration(json_input["facialExp"], [endFrame/4], util.faceBonesConf) # Default Pose + poseDefault([1, endFrame+15], util.allBones) configureHands() configureFace() diff --git a/moves.py b/moves.py index c4098a0..dc47ab2 100644 --- a/moves.py +++ b/moves.py @@ -1,109 +1,109 @@ # -*- coding: UTF-8 -*- import math -def locationCircular(center, radius, i_axis, j_axis, k_axis, pose, initialPosition, laps, frameJump = 10, initialFrame = 15, turn = None): - sqrt22 = radius * (math.sqrt(2) / 2) - rad2 = (radius/2) - currentFrame = initialFrame - for l in range(initialPosition, initialPosition + math.floor(8 * laps) + 1): - if ((l % 8) == 0 ): - pose.location[i_axis] = center[i_axis] + radius - pose.location[j_axis] = center[j_axis] - pose.location[k_axis] = center[k_axis] - pose.keyframe_insert(frame = currentFrame, index = -1, data_path = 'location') - currentFrame += frameJump - if ((l % 8) == 1): +def locationCircular(center, radius, i_axis, j_axis, k_axis, pose, initialPosition, laps, frameJump = 10, initialFrame = 18, turn = None): + sqrt22 = radius * (math.sqrt(2) / 2) + rad2 = (radius/2) + currentFrame = initialFrame + for l in range(initialPosition, initialPosition + math.floor(8 * laps) + 1): + if ((l % 8) == 0 ): + pose.location[i_axis] = center[i_axis] + radius + pose.location[j_axis] = center[j_axis] + pose.location[k_axis] = center[k_axis] + pose.keyframe_insert(frame = currentFrame, index = -1, data_path = 'location') + currentFrame += frameJump + if ((l % 8) == 1): + pose.location[i_axis] = center[i_axis] + sqrt22 + pose.location[j_axis] = center[j_axis] + sqrt22 + pose.location[k_axis] = center[k_axis] + if(turn == 1): pose.location[i_axis] = center[i_axis] + sqrt22 + pose.location[j_axis] = center[j_axis] + rad2 + pose.location[k_axis] = center[k_axis] - rad2 + elif(turn == -1): + pose.location[i_axis] = center[i_axis] + sqrt22 + pose.location[j_axis] = center[j_axis] + rad2 + pose.location[k_axis] = center[k_axis] + rad2 + pose.keyframe_insert(frame = initialPosition, index = -1, data_path = 'location') + currentFrame += frameJump + if ((l % 8) == 2): + pose.location[i_axis] = center[i_axis] + pose.location[j_axis] = center[j_axis] + radius + pose.location[k_axis] = center[k_axis] + if(turn == 1): pose.location[j_axis] = center[j_axis] + sqrt22 - pose.location[k_axis] = center[k_axis] - if(turn == 1): - pose.location[i_axis] = center[i_axis] + sqrt22 - pose.location[j_axis] = center[j_axis] + rad2 - pose.location[k_axis] = center[k_axis] - rad2 - elif(turn == -1): - pose.location[i_axis] = center[i_axis] + sqrt22 - pose.location[j_axis] = center[j_axis] + rad2 - pose.location[k_axis] = center[k_axis] + rad2 - pose.keyframe_insert(frame = initialPosition, index = -1, data_path = 'location') - currentFrame += frameJump - if ((l % 8) == 2): - pose.location[i_axis] = center[i_axis] - pose.location[j_axis] = center[j_axis] + radius - pose.location[k_axis] = center[k_axis] - if(turn == 1): - pose.location[j_axis] = center[j_axis] + sqrt22 - pose.location[k_axis] = center[k_axis] - sqrt22 - elif(turn == -1): - pose.location[j_axis] = center[j_axis] + sqrt22 - pose.location[k_axis] = center[k_axis] + sqrt22 - pose.keyframe_insert(frame = initialPosition, index = -1, data_path = 'location') - currentFrame += frameJump - if ((l % 8) == 3): - pose.location[i_axis] = center[i_axis] - sqrt22 + pose.location[k_axis] = center[k_axis] - sqrt22 + elif(turn == -1): pose.location[j_axis] = center[j_axis] + sqrt22 - pose.location[k_axis] = center[k_axis] - if(turn == 1): - pose.location[i_axis] = center[i_axis] - sqrt22 - pose.location[j_axis] = center[j_axis] + rad2 - pose.location[k_axis] = center[k_axis] - rad2 - elif(turn == -1): - pose.location[i_axis] = center[i_axis] - sqrt22 - pose.location[j_axis] = center[j_axis] + rad2 - pose.location[k_axis] = center[k_axis] + rad2 - pose.keyframe_insert(frame = currentFrame, index = -1, data_path = 'location') - currentFrame += frameJump - - if ((l % 8) == 4): - pose.location[i_axis] = center[i_axis] - radius - pose.location[j_axis] = center[j_axis] - pose.location[k_axis] = center[k_axis] - pose.keyframe_insert(frame = currentFrame, index = -1, data_path = 'location') - currentFrame += frameJump - - if ((l % 8) == 5): + pose.location[k_axis] = center[k_axis] + sqrt22 + pose.keyframe_insert(frame = initialPosition, index = -1, data_path = 'location') + currentFrame += frameJump + if ((l % 8) == 3): + pose.location[i_axis] = center[i_axis] - sqrt22 + pose.location[j_axis] = center[j_axis] + sqrt22 + pose.location[k_axis] = center[k_axis] + if(turn == 1): + pose.location[i_axis] = center[i_axis] - sqrt22 + pose.location[j_axis] = center[j_axis] + rad2 + pose.location[k_axis] = center[k_axis] - rad2 + elif(turn == -1): + pose.location[i_axis] = center[i_axis] - sqrt22 + pose.location[j_axis] = center[j_axis] + rad2 + pose.location[k_axis] = center[k_axis] + rad2 + pose.keyframe_insert(frame = currentFrame, index = -1, data_path = 'location') + currentFrame += frameJump + + if ((l % 8) == 4): + pose.location[i_axis] = center[i_axis] - radius + pose.location[j_axis] = center[j_axis] + pose.location[k_axis] = center[k_axis] + pose.keyframe_insert(frame = currentFrame, index = -1, data_path = 'location') + currentFrame += frameJump + + if ((l % 8) == 5): + pose.location[i_axis] = center[i_axis] - sqrt22 + pose.location[j_axis] = center[j_axis] - sqrt22 + pose.location[k_axis] = center[k_axis] + if(turn == 1): pose.location[i_axis] = center[i_axis] - sqrt22 + pose.location[j_axis] = center[j_axis] - rad2 + pose.location[k_axis] = center[k_axis] + rad2 + elif(turn == -1): + pose.location[i_axis] = center[i_axis] - sqrt22 + pose.location[j_axis] = center[j_axis] - ray2 + pose.location[k_axis] = center[k_axis] - ray2 + pose.keyframe_insert(frame = currentFrame, index = -1, data_path = 'location') + currentFrame += frameJump + + if ((l % 8) == 6): + pose.location[i_axis] = center[i_axis] + pose.location[j_axis] = center[j_axis] - radius + pose.location[k_axis] = center[k_axis] + if(turn == 1): pose.location[j_axis] = center[j_axis] - sqrt22 - pose.location[k_axis] = center[k_axis] - if(turn == 1): - pose.location[i_axis] = center[i_axis] - sqrt22 - pose.location[j_axis] = center[j_axis] - rad2 - pose.location[k_axis] = center[k_axis] + rad2 - elif(turn == -1): - pose.location[i_axis] = center[i_axis] - sqrt22 - pose.location[j_axis] = center[j_axis] - ray2 - pose.location[k_axis] = center[k_axis] - ray2 - pose.keyframe_insert(frame = currentFrame, index = -1, data_path = 'location') - currentFrame += frameJump - - if ((l % 8) == 6): - pose.location[i_axis] = center[i_axis] - pose.location[j_axis] = center[j_axis] - radius - pose.location[k_axis] = center[k_axis] - if(turn == 1): - pose.location[j_axis] = center[j_axis] - sqrt22 - pose.location[k_axis] = center[k_axis] + sqrt22 - elif(turn == -1): - pose.location[j_axis] = center[j_axis] - sqrt22 - pose.location[k_axis] = center[k_axis] - sqrt22 - pose.keyframe_insert(frame = currentFrame, index = -1, data_path = 'location') - currentFrame += frameJump - - if ((l % 8) == 7): - pose.location[i_axis] = center[i_axis] + sqrt22 + pose.location[k_axis] = center[k_axis] + sqrt22 + elif(turn == -1): pose.location[j_axis] = center[j_axis] - sqrt22 - pose.location[k_axis] = center[k_axis] - if(turn == 1): - pose.location[i_axis] = center[i_axis] + sqrt22 - pose.location[j_axis] = center[j_axis] - ray2 - pose.location[k_axis] = center[k_axis] + ray2 - elif(turn == -1): - pose.location[i_axis] = center[i_axis] + sqrt22 - pose.location[j_axis] = center[j_axis] - ray2 - pose.location[k_axis] = center[k_axis] - ray2 - pose.keyframe_insert(frame = currentFrame, index = -1, data_path = 'location') - currentFrame += frameJump - currentFrame -= frameJump - return currentFrame + pose.location[k_axis] = center[k_axis] - sqrt22 + pose.keyframe_insert(frame = currentFrame, index = -1, data_path = 'location') + currentFrame += frameJump + + if ((l % 8) == 7): + pose.location[i_axis] = center[i_axis] + sqrt22 + pose.location[j_axis] = center[j_axis] - sqrt22 + pose.location[k_axis] = center[k_axis] + if(turn == 1): + pose.location[i_axis] = center[i_axis] + sqrt22 + pose.location[j_axis] = center[j_axis] - ray2 + pose.location[k_axis] = center[k_axis] + ray2 + elif(turn == -1): + pose.location[i_axis] = center[i_axis] + sqrt22 + pose.location[j_axis] = center[j_axis] - ray2 + pose.location[k_axis] = center[k_axis] - ray2 + pose.keyframe_insert(frame = currentFrame, index = -1, data_path = 'location') + currentFrame += frameJump + currentFrame -= frameJump + return currentFrame # testing . . . diff --git a/param.json b/param.json index 89f2bf2..64c88e7 100644 --- a/param.json +++ b/param.json @@ -3,3 +3,7 @@ '{"userId": 4,"rightHand": ["pontual","conf_20","Ori_4","Pa_6"],"leftHand":["circular","perpendicular","horario",0.6,1,"conf_20","Ori_4","Pa_6"],"facialExp": "Exp_6","signName":"pontual_direita"}' '{"userId": 4,"rightHand": ["semicircular","perpendicular","horario",0.6,0.5,"conf_20","Ori_4","Pa_6"],"leftHand":["pontual","conf_10","Ori_3","Pa_3"],"facialExp": "Exp_6","signName":"SemiCircular"}' + + +'{"userId": 4,"rightHand":[],"leftHand":["circular","perpendicular","horario",1,2,10,24,10],"facialExp":[6],"signName":"circular mão esquerda"}' + -- libgit2 0.21.2