Exemplo n.º 1
0
 def __init__(self):
     """ Creates a new pipeline with a given showbase instance. This should
     be done before intializing the ShowBase, the pipeline will take care of
     that. If the showbase has been initialized before, have a look at
     the alternative initialization of the render pipeline (the first sample)."""
     RPObject.__init__(self)
     self.debug("Using Python {}.{} with architecture {}".format(
         sys.version_info.major, sys.version_info.minor,
         PandaSystem.get_platform()))
     self.debug("Using Panda3D {} built on {}".format(
         PandaSystem.get_version_string(), PandaSystem.get_build_date()))
     if PandaSystem.get_git_commit():
         self.debug("Using git commit {}".format(
             PandaSystem.get_git_commit()))
     else:
         self.debug("Using custom Panda3D build")
     if not self._check_version():
         self.fatal(
             "Your Panda3D version is outdated! Please update to the newest \n"
             "git version! Checkout https://github.com/panda3d/panda3d to "
             "compile panda from source, or get a recent buildbot build.")
     self.mount_mgr = MountManager(self)
     self.settings = {}
     self._pre_showbase_initialized = False
     self._first_frame = None
     self.set_loading_screen_image("/$$rp/data/gui/loading_screen_bg.txo")
Exemplo n.º 2
0
    def __init__(self):

        # Init mounts
        self._mount_mgr = MountManager(None)
        self._mount_mgr.mount()

        self._plugin_mgr = PluginManager(None)
        self._plugin_mgr.requires_daytime_settings = False

        QMainWindow.__init__(self)
        Ui_MainWindow.__init__(self)
        self.setupUi(self)

        self._current_plugin = None
        self._current_plugin_instance = None
        self.lbl_restart_pipeline.hide()
        self._set_settings_visible(False)
        self._update_queue = list()

        qt_connect(self.lst_plugins, "itemSelectionChanged()",
                   self.on_plugin_selected)
        qt_connect(self.lst_plugins, "itemChanged(QListWidgetItem*)",
                   self.on_plugin_state_changed)
        qt_connect(self.btn_reset_plugin_settings, "clicked()",
                   self.on_reset_plugin_settings)

        self._load_plugin_list()

        # Adjust column widths
        self.table_plugin_settings.setColumnWidth(0, 140)
        self.table_plugin_settings.setColumnWidth(1, 105)
        self.table_plugin_settings.setColumnWidth(2, 160)

        update_thread = Thread(target=self.update_thread, args=())
        update_thread.start()
Exemplo n.º 3
0
    def __init__(self):

        # Init mounts
        self._mount_mgr = MountManager(None)
        self._mount_mgr.mount()

        self._plugin_mgr = PluginManager(None)
        self._plugin_mgr.load()

        QtGui.QMainWindow.__init__(self)
        self.setupUi()
        self._tree_widgets = []
        self._cmd_queue = set()

        self._update_settings_list()

        self._selected_setting_handle = None
        self._selected_setting = None
        self._selected_plugin = None
        self._current_time = 0.5
        self._on_time_changed(self.time_slider.value())
        self.set_settings_visible(False)

        self._bg_thread = Thread(target=self.updateThread)
        self._bg_thread.start()
Exemplo n.º 4
0
    def __init__(self, outdated_parameter=None):
        """ Creates a new pipeline with a given showbase instance. This should
        be done before intializing the ShowBase, the pipeline will take care of
        that. """
        RPObject.__init__(self)
        if outdated_parameter is not None:
            self.fatal(
                "The render pipeline no longer takes the ShowBase argument "
                "as constructor parameter. Please have a look at the "
                "00-Loading the pipeline sample to see how to initialize "
                "the pipeline properly.")
        self.debug("Using Python {}.{} with architecture {}".format(
            sys.version_info.major, sys.version_info.minor,
            PandaSystem.get_platform()))
        self.debug("Using Panda3D {} built on {}".format(
            PandaSystem.get_version_string(), PandaSystem.get_build_date()))
        if PandaSystem.get_git_commit():
            self.debug("Using git commit {}".format(
                PandaSystem.get_git_commit()))
        else:
            self.debug("Using custom Panda3D build")
        self.mount_mgr = MountManager(self)
        self.settings = {}
        self._pre_showbase_initialized = False
        self._first_frame = None
        self.set_default_loading_screen()

        # Check for the right Panda3D version
        if not self._check_version():
            self.fatal(
                "Your Panda3D version is outdated! Please update to the newest \n"
                "git version! Checkout https://github.com/panda3d/panda3d to "
                "compile panda from source, or get a recent buildbot build.")
Exemplo n.º 5
0
 def __init__(self):
     """ Creates a new pipeline with a given showbase instance. This should
     be done before intializing the ShowBase, the pipeline will take care of
     that. If the showbase has been initialized before, have a look at
     the alternative initialization of the render pipeline (the first sample)."""
     RPObject.__init__(self)
     self._analyze_system()
     self.mount_mgr = MountManager(self)
     self.settings = {}
     self._applied_effects = []
     self._pre_showbase_initialized = False
     self._first_frame = None
     self.set_loading_screen_image("/$$rp/data/gui/loading_screen_bg.txo")
Exemplo n.º 6
0
    print("Querying api ..")
    handle = urllib.request.urlopen(url)
    data = handle.read().decode("utf-8")
    handle.close()

    # Extract data
    print("Extracting data ..")
    lines = data.replace("\r", "").split("\n")[1:]

    # Load render pipeline api
    print("Loading plugin api ..")
    sys.path.insert(0, "../../")
    from rpcore.pluginbase.manager import PluginManager
    from rpcore.mount_manager import MountManager

    mount_mgr = MountManager(None)
    mount_mgr.mount()

    plugin_mgr = PluginManager(None)
    plugin_mgr.load()

    convert_to_linear = plugin_mgr.day_settings["scattering"][
        "sun_intensity"].get_linear_value

    hour, minutes = 0, 0

    data_points_azimuth = []
    data_points_altitude = []
    data_points_intensity = []

    for line in lines: