Repository: ManimCommunity/manim
File: manim/scene/scene.py (Python)

Code before:
        always_update_mobjects=False,
        random_seed=0,
        **kwargs,
    ):
        self.camera_class = camera_class
        self.always_update_mobjects = always_update_mobjects
        self.random_seed = random_seed

        self.animations = None
        self.stop_condition = None
        self.moving_mobjects = None
        self.static_mobjects = None
        self.time_progression = None
        self.duration = None
        self.last_t = None

        if config["use_opengl_renderer"]:
            # Items associated with interaction
            self.mouse_point = OpenGLPoint()
            self.mouse_drag_point = OpenGLPoint()

        if renderer is None:
            skip_animations = kwargs.get("skip_animations", False)
            # If renderer is unspecified, use the configs for a sensible default.
            if config["use_opengl_renderer"]:
                self.renderer = OpenGLRenderer(skip_animations=skip_animations)
            else:
                self.renderer = CairoRenderer(
                    camera_class=self.camera_class, skip_animations=skip_animations
                )
        else:
            self.renderer = renderer
        self.renderer.init_scene(self)

        self.mobjects = []
        # TODO, remove need for foreground mobjects
        self.foreground_mobjects = []
        if self.random_seed is not None:
            random.seed(self.random_seed)
            np.random.seed(self.random_seed)

        Container.__init__(self, **kwargs)

    @property
    def camera(self):
        return self.renderer.camera

    def __deepcopy__(self, clone_from_id):
        cls = self.__class__
        result = cls.__new__(cls)
        clone_from_id[id(self)] = result

Review comment (suggestion):
Instead of passing `skip_animations` here the renderer can read it from the scene reference it holds. The `skip_animations` kwarg passed to OpenGLRenderer should be removed at some point.

Code after:
        random_seed=0,
        **kwargs,
    ):
        self.camera_class = camera_class
        self.always_update_mobjects = always_update_mobjects
        self.random_seed = random_seed

        self.animations = None
        self.stop_condition = None
        self.moving_mobjects = None
        self.static_mobjects = None
        self.time_progression = None
        self.duration = None
        self.last_t = None

        if config["use_opengl_renderer"]:
            # Items associated with interaction
            self.mouse_point = OpenGLPoint()
            self.mouse_drag_point = OpenGLPoint()

        if renderer is None:
            self.renderer = CairoRenderer(
                camera_class=self.camera_class,
                skip_animations=kwargs.get("skip_animations", False),
            )
        else:
            self.renderer = renderer
        self.renderer.init_scene(self)

        self.mobjects = []
        # TODO, remove need for foreground mobjects
        self.foreground_mobjects = []
        if self.random_seed is not None:
            random.seed(self.random_seed)
            np.random.seed(self.random_seed)

        Container.__init__(self, **kwargs)

    @property
    def camera(self):
        return self.renderer.camera

    def __deepcopy__(self, clone_from_id):
        cls = self.__class__
        result = cls.__new__(cls)
        clone_from_id[id(self)] = result
        for k, v in self.__dict__.items():
            if k in ["renderer", "time_progression"]:
                continue
            if k == "camera_class":
                setattr(result, k, v)