Commit eaa49245a98207241bb770829365c3123e3280de
1 parent
37b05e8e
Exists in
master
Adicionada a orientação diagonal para o movimento Alisar; e configurados novos p…
…arâmetros para otimizar a renderização
Showing
2 changed files
with
50 additions
and
8 deletions
Show diff stats
moves.py
| ... | ... | @@ -2,26 +2,59 @@ |
| 2 | 2 | |
| 3 | 3 | import math |
| 4 | 4 | |
| 5 | -def contato(pose, contact_type, orientation, repetition, frameJump = 10, initialFrame = 18, width = 0.5): | |
| 5 | +def contato(pose, contact_type, orientation, repetition, frameJump = 10, initialFrame = 18, width = 0.25): | |
| 6 | 6 | currentFrame = initialFrame |
| 7 | 7 | if (contact_type == "alisar"): |
| 8 | - currentFrame = alisar(pose, contact_type, orientation, repetition) | |
| 8 | + currentFrame = alisar(pose, orientation, repetition, frameJump, initialFrame, width) | |
| 9 | 9 | return currentFrame |
| 10 | 10 | |
| 11 | -def alisar(pose, contact_type, orientation, repetition, frameJump = 10, initialFrame = 18, width = 0.5): | |
| 12 | - center = pose.location.x, pose.location.y, pose.location.z | |
| 11 | +def alisar(pose, orientation, repetition, frameJump = 10, initialFrame = 18, width = 0.25): | |
| 13 | 12 | currentFrame = initialFrame |
| 14 | - | |
| 13 | + if (orientation == "perpendicular"): | |
| 14 | + currentFrame = alisarXY(pose, 1, repetition, frameJump, initialFrame, width) | |
| 15 | + elif (orientation == "paralelo"): | |
| 16 | + currentFrame = alisarXY(pose, 0, repetition, frameJump, initialFrame, width) | |
| 17 | + elif (orientation == "diagonal-direita"): | |
| 18 | + currentFrame = alisar_diagonal(pose, True, repetition, frameJump, initialFrame, width) | |
| 19 | + elif (orientation == "diagonal-esquerda"): | |
| 20 | + currentFrame = alisar_diagonal(pose, False, repetition, frameJump, initialFrame, width) | |
| 21 | + | |
| 22 | + return currentFrame | |
| 23 | + | |
| 24 | +def alisarXY(pose, orientation_index, repetition, frameJump = 10, initialFrame = 18, width = 0.25): | |
| 25 | + currentFrame = initialFrame | |
| 26 | + center = pose.location.x, pose.location.y, pose.location.z | |
| 27 | + | |
| 15 | 28 | for i in range(0, repetition): |
| 16 | - pose.location.y = center[1] - width | |
| 29 | + pose.location[orientation_index] = center[orientation_index] - width | |
| 17 | 30 | pose.keyframe_insert(frame = currentFrame, index = -1, data_path = 'location') |
| 18 | 31 | currentFrame += frameJump |
| 19 | - pose.location.y = center[1] + width | |
| 32 | + pose.location[orientation_index] = center[orientation_index] + width | |
| 20 | 33 | pose.keyframe_insert(frame = currentFrame, index = -1, data_path = 'location') |
| 21 | 34 | currentFrame += frameJump |
| 22 | - currentFrame -= frameJump | |
| 35 | + #currentFrame -= frameJump | |
| 36 | + | |
| 23 | 37 | return currentFrame |
| 38 | + | |
| 39 | +def alisar_diagonal(pose, to_right, repetition, frameJump = 10, initialFrame = 18, width = 0.25): | |
| 40 | + currentFrame = initialFrame | |
| 41 | + center = pose.location.x, pose.location.y, pose.location.z | |
| 42 | + | |
| 43 | + for i in range(0, repetition): | |
| 44 | + pose.location[0] = center[0] - width if to_right else center[0] - width | |
| 45 | + pose.location[1] = center[1] - width if to_right else center[1] + width | |
| 46 | + | |
| 47 | + pose.keyframe_insert(frame = currentFrame, index = -1, data_path = 'location') | |
| 48 | + currentFrame += frameJump | |
| 49 | + | |
| 50 | + pose.location[0] = center[0] + width if to_right else center[0] + width | |
| 51 | + pose.location[1] = center[1] + width if to_right else center[1] - width | |
| 52 | + pose.keyframe_insert(frame = currentFrame, index = -1, data_path = 'location') | |
| 53 | + currentFrame += frameJump | |
| 54 | + #currentFrame -= frameJump | |
| 24 | 55 | |
| 56 | + return currentFrame | |
| 57 | + | |
| 25 | 58 | def circular_or_semiCircular(pose, orientation, direction, radius, laps, intensity = 5, initialFrame = 18, turn = None): |
| 26 | 59 | center = pose.location.x, pose.location.y, pose.location.z |
| 27 | 60 | if(orientation == 'perpendicular'): | ... | ... |
util.py
| ... | ... | @@ -36,6 +36,15 @@ def outconf(): |
| 36 | 36 | bpy.context.scene.render.ffmpeg.format = 'MPEG4' |
| 37 | 37 | bpy.context.scene.render.ffmpeg.codec = 'H264' |
| 38 | 38 | # bpy.context.scene.render.filepath = '/tmp/' |
| 39 | + | |
| 40 | + # Otimização da renderização | |
| 41 | + bpy.context.scene.render.use_shadows = False | |
| 42 | + bpy.context.scene.render.use_raytrace = False | |
| 43 | + bpy.context.scene.render.use_envmaps = False | |
| 44 | + bpy.context.scene.render.use_motion_blur = False | |
| 45 | + bpy.context.scene.render.use_shadows = False | |
| 46 | + bpy.context.scene.render.tile_x = 320 | |
| 47 | + bpy.context.scene.render.tile_y = 240 | |
| 39 | 48 | |
| 40 | 49 | def render_sign(userId, signName, beginFrame, endFrame): |
| 41 | 50 | bpy.context.scene.render.filepath = "//users//" + str(userId)+ "//" + signName + "_" | ... | ... |