change render switches
This commit is contained in:
parent
8bcca04ecc
commit
dc5e2ff28c
5 changed files with 54 additions and 51 deletions
|
@ -79,6 +79,7 @@ class AnimationRenderer:
|
|||
|
||||
display = pyglet.canvas.get_display()
|
||||
screen = display.get_screens()[0]
|
||||
print(display.get_screens())
|
||||
|
||||
if self.streaming_process is not None:
|
||||
self.window = pyglet.window.Window(width=self.frame_size[0], height=self.frame_size[1], config=config, fullscreen=False, screen=screen)
|
||||
|
|
|
@ -336,8 +336,8 @@ render_parser.add_argument("--render-file",
|
|||
render_parser.add_argument("--render-window",
|
||||
help="Render a previewing to a window",
|
||||
action='store_true')
|
||||
render_parser.add_argument("--render-no-preview",
|
||||
help="No preview, but only animation",
|
||||
render_parser.add_argument("--render-animation",
|
||||
help="Render animation (pyglet)",
|
||||
action='store_true')
|
||||
render_parser.add_argument("--render-debug-shapes",
|
||||
help="Lines and points for debugging/mapping",
|
||||
|
|
|
@ -442,7 +442,7 @@ colorset = [
|
|||
# ]
|
||||
|
||||
def get_opacity(track: Track, current_frame: Frame):
|
||||
fade_duration = current_frame.camera.fps * 3
|
||||
fade_duration = current_frame.camera.fps * 1.5
|
||||
diff = current_frame.index - track.history[-1].frame_nr
|
||||
return max(0, 1 - diff / fade_duration)
|
||||
# track.history[-1].frame_nr < (current_frame.index - current_frame.camera.fps * 3)
|
||||
|
|
|
@ -92,13 +92,13 @@ def start():
|
|||
ExceptionHandlingProcess(target=run_tracker, kwargs={'config': args, 'is_running': isRunning}, name='tracker'),
|
||||
]
|
||||
|
||||
if args.render_file or args.render_url or args.render_window:
|
||||
if not args.render_no_preview: #or args.render_file or args.render_url:
|
||||
# if args.render_file or args.render_url or args.render_window:
|
||||
if args.render_window or args.render_file or args.render_url:
|
||||
procs.append(
|
||||
# ExceptionHandlingProcess(target=run_cv_renderer, kwargs={'config': args, 'is_running': isRunning}, name='preview')
|
||||
ExceptionHandlingProcess(target=run_cv_renderer, kwargs={'config': args, 'is_running': isRunning}, name='preview')
|
||||
)
|
||||
if args.render_no_preview:
|
||||
if args.render_animation:
|
||||
procs.append(
|
||||
ExceptionHandlingProcess(target=run_animation_renderer, kwargs={'config': args, 'is_running': isRunning}, name='renderer')
|
||||
)
|
||||
|
|
|
@ -185,6 +185,7 @@ class DrawnTrack:
|
|||
self.shapes = self.shapes[:len(drawn_positions)]
|
||||
|
||||
# for i, pos in drawn_positions.enumerate():
|
||||
if True:
|
||||
for ci in range(1, len(drawn_positions)):
|
||||
x, y = [int(p) for p in drawn_positions[ci-1]]
|
||||
x2, y2 = [int(p) for p in drawn_positions[ci]]
|
||||
|
@ -195,7 +196,7 @@ class DrawnTrack:
|
|||
|
||||
if ci >= len(self.shapes):
|
||||
# TODO: add color2
|
||||
line = self.renderer.gradientLine(x, y, x2, y2, 3, color, color, batch=self.renderer.batch_anim)
|
||||
# line = self.renderer.gradientLine(x, y, x2, y2, 3, color, color, batch=self.renderer.batch_anim)
|
||||
line = pyglet.shapes.Arc(x2, y2, 10, thickness=2, color=color, batch=self.renderer.batch_anim)
|
||||
line.opacity = 20
|
||||
self.shapes.append(line)
|
||||
|
@ -203,7 +204,7 @@ class DrawnTrack:
|
|||
else:
|
||||
line = self.shapes[ci-1]
|
||||
line.x, line.y = x, y
|
||||
line.x2, line.y2 = x2, y2
|
||||
# line.x2, line.y2 = x2, y2
|
||||
line.radius = int(exponentialDecay(line.radius, 1.5, 3, dt))
|
||||
line.color = color
|
||||
line.opacity = int(exponentialDecay(line.opacity, 180, 8, dt))
|
||||
|
@ -216,6 +217,7 @@ class DrawnTrack:
|
|||
self.pred_history_shapes = self.pred_history_shapes[:len(drawn_pred_history)]
|
||||
|
||||
# for i, pos in drawn_pred_history.enumerate():
|
||||
if False:
|
||||
for ci in range(1, len(drawn_pred_history)):
|
||||
x, y = [int(p) for p in drawn_pred_history[ci-1]]
|
||||
x2, y2 = [int(p) for p in drawn_pred_history[ci]]
|
||||
|
|
Loading…
Reference in a new issue