0

I am getting too fancy for my own good and inheriting MlabSceneModel, encapsulating some parameters and interactions that are specific to my application. explicity..

MyScene(MlabSceneModel):

    #This part is just to give a flavor of why I would want to do this, but not part of the problem 
    @on_trait_change('activated')
    def scene_activated(self):
        self.scene.picker.pointpicker.add_observer(...)
    def picker_callback(...)

    #This is where the problem is
    traits_view=View(Item('scene',editor=SceneEditor(scene_class=MayaviScene)))

As far as I can tell, everything works correctly, except for clicking on the top left button with "view the mayavi pipeline" hovertext. (The button is also a picture of the mayavi symbol). When I click this, I get

/tvtk/pyface/ui/qt4/scene_editor.py, line 47, in init:

"The SceneModel may only have one active editor!" AssertionError: The SceneModel may only have one active editor!

user3391229
  • 798
  • 9
  • 17
  • I don't know why you are seeing this error, but can you explain why you want to do this? There's probably no good reason you need it. – aestrivex Nov 09 '15 at 19:08
  • Okay. I'm developing a gui which can have a variable number of scenes, but each one of the scenes has a lot of the same attributes. e.g. The user right click interaction, the format, title etc. So, it made sense to me to encapsulate it right? I had originally placed everything in one Display class, but it had gotten so messy... – user3391229 Nov 10 '15 at 16:56
  • It would anyway obviate the current error to make a Display class and do a bunch of common processing in its `__init__` or similar. As I said, I don't know the source of this error. – aestrivex Nov 10 '15 at 19:06

0 Answers0