예제 #1
0
 def set_light(self, light):
     self.light = light
     self.cmd_init = "light = pynebula.lookup('/sys/servers/entityobject')" \
         ".getentityobject(" + str(light.getid()) + ");"
     self.choice_type.SetSelection( light.getintvariable('lightindex') )
     r, g, b, a = light.getvectoroverride('LightAmbient')
     self.csel_ambient.set_value( format.unit_rgb_2_byte_rgb((r,g,b)) )
     r, g, b, a = light.getvectoroverride('LightDiffuse')
     self.csel_diffuse.set_value( format.unit_rgb_2_byte_rgb((r,g,b)) )
     r, g, b, a = light.getvectoroverride('LightSpecular')
     self.csel_specular.set_value( format.unit_rgb_2_byte_rgb((r,g,b)) )
     self.__update_specific_controls()
     self.__show_specific_controls()
예제 #2
0
 def set_light(self, light):
     self.light = light
     self.cmd_init = "light = pynebula.lookup('/sys/servers/entityobject')" \
         ".getentityobject(" + str(light.getid()) + ");"
     self.choice_type.SetSelection(light.getintvariable('lightindex'))
     r, g, b, a = light.getvectoroverride('LightAmbient')
     self.csel_ambient.set_value(format.unit_rgb_2_byte_rgb((r, g, b)))
     r, g, b, a = light.getvectoroverride('LightDiffuse')
     self.csel_diffuse.set_value(format.unit_rgb_2_byte_rgb((r, g, b)))
     r, g, b, a = light.getvectoroverride('LightSpecular')
     self.csel_specular.set_value(format.unit_rgb_2_byte_rgb((r, g, b)))
     self.__update_specific_controls()
     self.__show_specific_controls()
예제 #3
0
 def get_value(self):
     colour = self.server.getcoloursettingvalue(
                     self.option.module_name, 
                     self.option.name 
                     )
     colour255 = format.unit_rgb_2_byte_rgb(colour)
     return colour255
예제 #4
0
 def set_fog(self, fog):
     self.fog = fog
     self.cmd_init = "fog = pynebula.lookup('/sys/servers/entityobject')" \
         ".getentityobject(" + str(fog.getid()) + ");"
     self.choice_type.SetSelection( fog.getintvariable('fogindex') )
     r, g, b, a = fog.getvectoroverride('fogColor')
     self.color.set_value( format.unit_rgb_2_byte_rgb((r,g,b)) )
예제 #5
0
    def __set_properties(self):
        # Grid
        grid = app.get_grid()
        self.float_grid_cell_size.set_value(grid.getspacing())
        self.int_grid_line_grouping.set_value(grid.getnsubdivision())
        self.color_grid_minor.SetColour(
            format.unit_rgb_2_byte_rgb(grid.getlightcolor()))
        self.color_grid_major.SetColour(
            format.unit_rgb_2_byte_rgb(grid.getdarkcolor()))

        # Angle snapping
        angle_snap = get_repository_setting_value(guisettings.ID_AngleSnapping)
        self.float_angle.set_value(angle_snap['angle'])

        # Size snapping
        size_snap = get_repository_setting_value(guisettings.ID_SizeSnapping)
        self.float_size.set_value(size_snap['size'])
예제 #6
0
 def set_color_mask(self, color):
     material = self.__get_material()
     color = format.byte_rgb_2_unit_rgba(color)
     material.setmaskcolor( color[0], color[1], color[2], color[3] )
     self.color_sel.SetColour(
         format.unit_rgb_2_byte_rgb(
             material.getmaskcolor()
             ) 
         )
예제 #7
0
 def __set_properties(self):
     # Get graph parameters from the monitor server
     graph_index = self.get_graph_index()
     monitor = servers.get_monitor_server()
     frequency, smooth, r,g,b,a = monitor.getgraphparameters( graph_index )
     enabled = monitor.getgraphactive( graph_index )
     # Fill controls with the graph parameters
     self.checkbox_enable.SetValue( enabled )
     self.color.SetValue( format.unit_rgb_2_byte_rgb((r,g,b)) )
     self.int_frequency.set_value( int(frequency*1000) )
     self.slider_smooth.set_value( smooth )
예제 #8
0
    def __set_properties(self):
        # Grid
        grid = app.get_grid()
        self.float_grid_cell_size.set_value( grid.getspacing() )
        self.int_grid_line_grouping.set_value( grid.getnsubdivision() )
        self.color_grid_minor.SetColour(
            format.unit_rgb_2_byte_rgb(grid.getlightcolor()) )
        self.color_grid_major.SetColour(
            format.unit_rgb_2_byte_rgb(grid.getdarkcolor()) )

        # Angle snapping
        angle_snap = get_repository_setting_value(
                                guisettings.ID_AngleSnapping
                                )
        self.float_angle.set_value( angle_snap['angle'] )

        # Size snapping
        size_snap = get_repository_setting_value(
                            guisettings.ID_SizeSnapping
                            )
        self.float_size.set_value( size_snap['size'] )
예제 #9
0
 def __init__(self, parent, material):
     wx.Dialog.__init__(
         self, 
         parent, 
         -1, 
         "Material '" + material.getname() + "'",
         style=wx.DEFAULT_DIALOG_STYLE|wx.RESIZE_BORDER|wx.TAB_TRAVERSAL
         )
     self.material = material
     
     self.color = colorsel.ColorSelector(self, -1, "Material color",
         format.unit_rgb_2_byte_rgb( material.getcolor() ) )
     self.button_ok = wx.Button(self, -1, "&OK")
     self.button_cancel = wx.Button(self, wx.ID_CANCEL, "&Cancel")
     
     self.__set_properties()
     self.__do_layout()
     self.__bind_events()
예제 #10
0
 def __set_properties(self):
     # images
     fileserver = servers.get_file_server()
     self.tog_lock.SetBitmapLabel(
         wx.Bitmap(
             fileserver.manglepath("outgui:images/tools/lock.bmp"), 
             wx.BITMAP_TYPE_ANY
             ) 
         )
     self.tog_lock.SetUseFocusIndicator(False)
     self.tog_show.SetBitmapLabel(
         wx.Bitmap(
             fileserver.manglepath("outgui:images/tools/show.bmp"), 
             wx.BITMAP_TYPE_ANY
             ) 
         )
     self.tog_show.SetUseFocusIndicator(False)
     self.tog_texture.SetBitmapLabel(
         wx.Bitmap(
             fileserver.manglepath("outgui:images/tools/texture.bmp"), 
             wx.BITMAP_TYPE_ANY
             )
         )
     self.tog_texture.SetUseFocusIndicator(False)
     self.btn_zoom.SetBitmapLabel(
         wx.Bitmap(
             fileserver.manglepath("outgui:images/tools/zoom.bmp"), 
             wx.BITMAP_TYPE_ANY
             ) 
         )
     self.btn_zoom.SetUseFocusIndicator(False)
     
     # layer state
     material = self.__get_material()
     self.tog_lock.SetToggle(False)
     self.tog_show.SetToggle(True)
     self.tog_texture.SetToggle(True)
     self.__update_texture_thumbnail(material)
     self.label_name.SetLabel( material.getlabel() )
     self.color_sel.SetColour(
         format.unit_rgb_2_byte_rgb( material.getmaskcolor() )
         )
예제 #11
0
 def set_button_colour_from_material(self):
     bg_colour = format.unit_rgb_2_byte_rgb(
                         self.material.getcolor() 
                         )
     self.button_select_colour.SetBackgroundColour(bg_colour)
예제 #12
0
 def set_button_colour_from_material(self):
     bg_colour = format.unit_rgb_2_byte_rgb(self.material.getcolor())
     self.button_select_colour.SetBackgroundColour(bg_colour)