mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
commit
79a51cc795
5 changed files with 25 additions and 12 deletions
|
@ -1727,7 +1727,7 @@ class IntroduceDopplerRadar(Scene):
|
||||||
words = ["Original signal", "Echo"]
|
words = ["Original signal", "Echo"]
|
||||||
for graph, word in zip([pulse_graph, echo_graph], words):
|
for graph, word in zip([pulse_graph, echo_graph], words):
|
||||||
arrow = Vector(DOWN)
|
arrow = Vector(DOWN)
|
||||||
arrow.next_to(graph.peak_point, UP, SMALL_BUFF)
|
arrow.next_to(graph.peak_point, UP, MED_SMALL_BUFF)
|
||||||
arrow.match_color(graph)
|
arrow.match_color(graph)
|
||||||
graph.arrow = arrow
|
graph.arrow = arrow
|
||||||
label = TextMobject(word)
|
label = TextMobject(word)
|
||||||
|
@ -2035,7 +2035,9 @@ class IntroduceDopplerRadar(Scene):
|
||||||
sum_graph.background_image_file = "blue_yellow_gradient"
|
sum_graph.background_image_file = "blue_yellow_gradient"
|
||||||
return pulse_graph, echo_graph, sum_graph
|
return pulse_graph, echo_graph, sum_graph
|
||||||
|
|
||||||
|
class MentionPRFNuance(TeacherStudentsScene):
|
||||||
|
def construct(self):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -95,6 +95,7 @@ def get_configuration():
|
||||||
"save_pngs" : args.save_pngs,
|
"save_pngs" : args.save_pngs,
|
||||||
#If -t is passed in (for transparent), this will be RGBA
|
#If -t is passed in (for transparent), this will be RGBA
|
||||||
"saved_image_mode": "RGBA" if args.transparent else "RGB",
|
"saved_image_mode": "RGBA" if args.transparent else "RGB",
|
||||||
|
"movie_file_extension" : ".mov" if args.transparent else ".mp4",
|
||||||
"quiet" : args.quiet or args.write_all,
|
"quiet" : args.quiet or args.write_all,
|
||||||
"ignore_waits" : args.preview,
|
"ignore_waits" : args.preview,
|
||||||
"write_all" : args.write_all,
|
"write_all" : args.write_all,
|
||||||
|
@ -237,6 +238,7 @@ def main():
|
||||||
"write_to_movie",
|
"write_to_movie",
|
||||||
"output_directory",
|
"output_directory",
|
||||||
"save_pngs",
|
"save_pngs",
|
||||||
|
"movie_file_extension",
|
||||||
"start_at_animation_number",
|
"start_at_animation_number",
|
||||||
"end_at_animation_number",
|
"end_at_animation_number",
|
||||||
]
|
]
|
||||||
|
|
|
@ -54,10 +54,14 @@ class VMobject(Mobject):
|
||||||
if fill_opacity is not None:
|
if fill_opacity is not None:
|
||||||
self.fill_opacity = fill_opacity
|
self.fill_opacity = fill_opacity
|
||||||
if family:
|
if family:
|
||||||
kwargs = locals()
|
|
||||||
kwargs.pop("self")
|
|
||||||
for mob in self.submobjects:
|
for mob in self.submobjects:
|
||||||
mob.set_style_data(**kwargs)
|
mob.set_style_data(
|
||||||
|
stroke_color = stroke_color,
|
||||||
|
stroke_width = stroke_width,
|
||||||
|
fill_color = fill_color,
|
||||||
|
fill_opacity = fill_opacity,
|
||||||
|
family = family
|
||||||
|
)
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def set_fill(self, color = None, opacity = None, family = True):
|
def set_fill(self, color = None, opacity = None, family = True):
|
||||||
|
|
|
@ -380,7 +380,7 @@ class Scene(Container):
|
||||||
animations.pop()
|
animations.pop()
|
||||||
#method should already have target then.
|
#method should already have target then.
|
||||||
else:
|
else:
|
||||||
mobject.target = mobject.deepcopy()
|
mobject.generate_target()
|
||||||
#
|
#
|
||||||
if len(state["method_args"]) > 0 and isinstance(state["method_args"][-1], dict):
|
if len(state["method_args"]) > 0 and isinstance(state["method_args"][-1], dict):
|
||||||
method_kwargs = state["method_args"].pop()
|
method_kwargs = state["method_args"].pop()
|
||||||
|
@ -570,18 +570,23 @@ class Scene(Container):
|
||||||
FFMPEG_BIN,
|
FFMPEG_BIN,
|
||||||
'-y', # overwrite output file if it exists
|
'-y', # overwrite output file if it exists
|
||||||
'-f', 'rawvideo',
|
'-f', 'rawvideo',
|
||||||
'-vcodec','rawvideo',
|
|
||||||
'-s', '%dx%d'%(width, height), # size of one frame
|
'-s', '%dx%d'%(width, height), # size of one frame
|
||||||
'-pix_fmt', 'rgba',
|
'-pix_fmt', 'rgba',
|
||||||
'-r', str(fps), # frames per second
|
'-r', str(fps), # frames per second
|
||||||
'-i', '-', # The imput comes from a pipe
|
'-i', '-', # The imput comes from a pipe
|
||||||
'-an', # Tells FFMPEG not to expect any audio
|
'-an', # Tells FFMPEG not to expect any audio
|
||||||
'-vcodec', 'mpeg',
|
'-loglevel', 'error',
|
||||||
|
]
|
||||||
|
if self.movie_file_extension == ".mov":
|
||||||
|
# This is if the background of the exported video
|
||||||
|
# should be transparent.
|
||||||
|
command += ['-vcodec', 'png']
|
||||||
|
else:
|
||||||
|
command += [
|
||||||
'-c:v', 'libx264',
|
'-c:v', 'libx264',
|
||||||
'-pix_fmt', 'yuv420p',
|
'-pix_fmt', 'yuv420p',
|
||||||
'-loglevel', 'error',
|
|
||||||
temp_file_path,
|
|
||||||
]
|
]
|
||||||
|
command += [temp_file_path]
|
||||||
# self.writing_process = sp.Popen(command, stdin=sp.PIPE, shell=True)
|
# self.writing_process = sp.Popen(command, stdin=sp.PIPE, shell=True)
|
||||||
self.writing_process = sp.Popen(command, stdin=sp.PIPE)
|
self.writing_process = sp.Popen(command, stdin=sp.PIPE)
|
||||||
|
|
||||||
|
|
|
@ -537,7 +537,7 @@ class Spotlight(VMobject):
|
||||||
new_submob = self.new_sector(submob.inner_radius,dr,lower_angle,upper_angle)
|
new_submob = self.new_sector(submob.inner_radius,dr,lower_angle,upper_angle)
|
||||||
submob.points = new_submob.points
|
submob.points = new_submob.points
|
||||||
submob.set_fill(opacity = 10 * self.opacity_function(submob.outer_radius))
|
submob.set_fill(opacity = 10 * self.opacity_function(submob.outer_radius))
|
||||||
print "new opacity:", self.opacity_function(submob.outer_radius)
|
# print "new opacity:", self.opacity_function(submob.outer_radius)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue