示例#1
0
    def __start_interactive_render(self, context, depsgraph):
        """
        Start an interactive rendering session.
        """

        # Preconditions.
        assert (self.__interactive_scene_translator is None)
        assert (self.__renderer is None)
        assert (self.__renderer_controller is None)
        assert (self.__tile_callback is None)
        assert (self.__render_thread is None)

        logger.debug("appleseed: Starting interactive rendering")
        
        logger.debug("appleseed: Translating scene for interactive rendering")

        self.__interactive_scene_translator = SceneTranslator.create_interactive_render_translator(depsgraph)
        self.__interactive_scene_translator.translate_scene(self, depsgraph, context)

        project = self.__interactive_scene_translator.as_project

        self.__renderer_controller = InteractiveRendererController()
        self.__tile_callback = asr.BlenderProgressiveTileCallback(self.tag_redraw)

        self.__renderer = asr.MasterRenderer(
            project,
            project.configurations()['interactive'].get_inherited_parameters(),
            [get_stdosl_render_paths()],
            self.__tile_callback)

        self.__restart_interactive_render()
示例#2
0
    def __start_interactive_render(self, context):
        """
        Start an interactive rendering session.
        """

        # Preconditions.
        assert(self.__interactive_scene_translator is None)
        assert(self.__renderer is None)
        assert(self.__renderer_controller is None)
        assert(self.__tile_callback is None)
        assert(self.__render_thread is None)

        logger.debug("Starting interactive rendering")
        self.__is_interactive = True
        RenderAppleseed.__interactive_session = True

        logger.debug("Translating scene for interactive rendering")

        self.__interactive_scene_translator = SceneTranslator.create_interactive_render_translator(context)
        self.__interactive_scene_translator.translate_scene()

        self.__camera = self.__interactive_scene_translator.camera_translator

        project = self.__interactive_scene_translator.as_project

        self.__renderer_controller = InteractiveRendererController(self.__camera)
        self.__tile_callback = asr.BlenderProgressiveTileCallback(self.tag_redraw)

        self.__renderer = asr.MasterRenderer(project,
                                             project.configurations()['interactive'].get_inherited_parameters(),
                                             [],
                                             self.__renderer_controller,
                                             self.__tile_callback)

        self.__restart_interactive_render()