Example #1
0
    def __init__(self, objects):
        self.model_list = []
        for each_object in objects:
            self.model_list.append(
                scriptingmodel.new_scripting_model_for_object(each_object))

        self.properties = self.get_properties_list()
        self.commands = self.build_commands_list()
    def __init__(self, objects):
        self.model_list = []       
        for each_object in objects:
            self.model_list.append(
                scriptingmodel.new_scripting_model_for_object(each_object)
                )

        self.properties = self.get_properties_list()
        self.commands = self.build_commands_list()
Example #3
0
 def __set_properties(self):
     self.SetSize( (380, 400) )
     # Inspected object
     object = self.__get_object()
     # check object is valid before doing 
     # anything else - it may have been deleted
     if object is None:
         return False
     # General editors
     model = scriptingmodelsingleobject.new_scripting_model_for_object(
                     object
                     )
     self.class_tab = inspectorcmdstab.ClassCommandsTab(
                             self.notebook, 
                             object
                             )
     self.property_tab = propertyview.PropertyView(
                                 self.notebook, 
                                 model
                                 )
     self.state_tab = inspectorstatetab.StateTab(
                             self.notebook, 
                             object
                             )
     self.signals_tab = inspectorsignalstab.SignalEmitterTab(
                                 self.notebook, 
                                 object
                                 )
     self.notebook.AddPage(self.property_tab, "Properties" )
     self.notebook.AddPage(self.state_tab, "State" )
     self.notebook.AddPage(self.class_tab, "Commands")
     self.notebook.AddPage(self.signals_tab, "Signals")
     # Specific editors
     self.editors = self.factory.create_editors(
                     object, 
                     self.notebook
                     )
     for editor in self.editors:
         self.notebook.InsertPage(
             0, 
             editor[1], 
             editor[0] 
             )
     # Select first page
     self.notebook.SetSelection(0)
     # Append object name to the dialog title
     name = nutils.get_detailed_object_description(
                 object, 
                 self.object_id
                 )
     self.SetTitle( name )
Example #4
0
 def on_edit_brush(self, event):
     brush_id = self.__currently_selected_brush_id()
     if brush_id == None:
         cjr.show_error_message(
             "No brush selected. Please choose a brush from the list."
             )
     else:
         brush = self.material.getgrowthbrush( brush_id )
         model = scriptingmodelsingleobject.new_scripting_model_for_object(
                         brush 
                         )
         dlg = propertyview.PropertyViewDialog(
                     self, 
                     "Brush '%s'" % brush.getname(), 
                     model 
                     )
         dlg.ShowModal()
         dlg.Destroy()
Example #5
0
 def __get_inputs_formats(self):
     # create a temporary object so the model can know about its init command
     action = self.__get_action()
     class_name = action.getactionclass()
     model_obj = pynebula.new( str(class_name) )
     model = scriptingmodelsingleobject.new_scripting_model_for_object( model_obj )
     
     # get the init command inputs' format
     try:
         inputs = model.get_command('init')['input']
     except:
         inputs = []
     
     # destroy the temporary model object
     pynebula.delete( model_obj )
     model_obj = None
     
     # return the inputs' format, discarding the first one, which is
     # reserved for internal usage (the entity owning the action)
     return inputs[1:]