From eaa49245a98207241bb770829365c3123e3280de Mon Sep 17 00:00:00 2001 From: Adabriand Furtado Date: Thu, 16 Apr 2015 13:04:16 -0300 Subject: [PATCH] Adicionada a orientação diagonal para o movimento Alisar; e configurados novos parâmetros para otimizar a renderização --- moves.py | 49 +++++++++++++++++++++++++++++++++++++++++-------- util.py | 9 +++++++++ 2 files changed, 50 insertions(+), 8 deletions(-) diff --git a/moves.py b/moves.py index 6081b56..83b0373 100644 --- a/moves.py +++ b/moves.py @@ -2,26 +2,59 @@ import math -def contato(pose, contact_type, orientation, repetition, frameJump = 10, initialFrame = 18, width = 0.5): +def contato(pose, contact_type, orientation, repetition, frameJump = 10, initialFrame = 18, width = 0.25): currentFrame = initialFrame if (contact_type == "alisar"): - currentFrame = alisar(pose, contact_type, orientation, repetition) + currentFrame = alisar(pose, orientation, repetition, frameJump, initialFrame, width) return currentFrame -def alisar(pose, contact_type, orientation, repetition, frameJump = 10, initialFrame = 18, width = 0.5): - center = pose.location.x, pose.location.y, pose.location.z +def alisar(pose, orientation, repetition, frameJump = 10, initialFrame = 18, width = 0.25): currentFrame = initialFrame - + if (orientation == "perpendicular"): + currentFrame = alisarXY(pose, 1, repetition, frameJump, initialFrame, width) + elif (orientation == "paralelo"): + currentFrame = alisarXY(pose, 0, repetition, frameJump, initialFrame, width) + elif (orientation == "diagonal-direita"): + currentFrame = alisar_diagonal(pose, True, repetition, frameJump, initialFrame, width) + elif (orientation == "diagonal-esquerda"): + currentFrame = alisar_diagonal(pose, False, repetition, frameJump, initialFrame, width) + + return currentFrame + +def alisarXY(pose, orientation_index, repetition, frameJump = 10, initialFrame = 18, width = 0.25): + currentFrame = initialFrame + center = pose.location.x, pose.location.y, pose.location.z + for i in range(0, repetition): - pose.location.y = center[1] - width + pose.location[orientation_index] = center[orientation_index] - width pose.keyframe_insert(frame = currentFrame, index = -1, data_path = 'location') currentFrame += frameJump - pose.location.y = center[1] + width + pose.location[orientation_index] = center[orientation_index] + width pose.keyframe_insert(frame = currentFrame, index = -1, data_path = 'location') currentFrame += frameJump - currentFrame -= frameJump + #currentFrame -= frameJump + return currentFrame + +def alisar_diagonal(pose, to_right, repetition, frameJump = 10, initialFrame = 18, width = 0.25): + currentFrame = initialFrame + center = pose.location.x, pose.location.y, pose.location.z + + for i in range(0, repetition): + pose.location[0] = center[0] - width if to_right else center[0] - width + pose.location[1] = center[1] - width if to_right else center[1] + width + + pose.keyframe_insert(frame = currentFrame, index = -1, data_path = 'location') + currentFrame += frameJump + + pose.location[0] = center[0] + width if to_right else center[0] + width + pose.location[1] = center[1] + width if to_right else center[1] - width + pose.keyframe_insert(frame = currentFrame, index = -1, data_path = 'location') + currentFrame += frameJump + #currentFrame -= frameJump + return currentFrame + def circular_or_semiCircular(pose, orientation, direction, radius, laps, intensity = 5, initialFrame = 18, turn = None): center = pose.location.x, pose.location.y, pose.location.z if(orientation == 'perpendicular'): diff --git a/util.py b/util.py index b30dd84..5266123 100644 --- a/util.py +++ b/util.py @@ -36,6 +36,15 @@ def outconf(): bpy.context.scene.render.ffmpeg.format = 'MPEG4' bpy.context.scene.render.ffmpeg.codec = 'H264' # bpy.context.scene.render.filepath = '/tmp/' + + # Otimização da renderização + bpy.context.scene.render.use_shadows = False + bpy.context.scene.render.use_raytrace = False + bpy.context.scene.render.use_envmaps = False + bpy.context.scene.render.use_motion_blur = False + bpy.context.scene.render.use_shadows = False + bpy.context.scene.render.tile_x = 320 + bpy.context.scene.render.tile_y = 240 def render_sign(userId, signName, beginFrame, endFrame): bpy.context.scene.render.filepath = "//users//" + str(userId)+ "//" + signName + "_" -- libgit2 0.21.2