def set_layout_2rows(): vps = ['viewport0', 'viewport1'] make_selected_viewport_first(vps) unset_layout() vui = servers.get_viewport_ui() vui.dockviewport(vps[0], 'h0', 'up') vui.dockviewport(vps[1], 'h0', 'down') vui.setdragbarknob('h0', 0.5) app.get_viewport(vps[0]).setvisible(True) app.get_viewport(vps[1]).setvisible(True)
def set_layout_2cols(): vps = ['viewport0', 'viewport1'] make_selected_viewport_first(vps) unset_layout() vui = servers.get_viewport_ui() vui.dockviewport(vps[0], 'v0', 'left') vui.dockviewport(vps[1], 'v0', 'right') vui.setdragbarknob('v0', 0.5) app.get_viewport(vps[0]).setvisible(True) app.get_viewport(vps[1]).setvisible(True)
def unset_layout(): vui = servers.get_viewport_ui() vui.undockviewport('viewport0') vui.undockviewport('viewport1') vui.undockviewport('viewport2') vui.undockviewport('viewport3') app.get_viewport('viewport0').setvisible(False) app.get_viewport('viewport1').setvisible(False) app.get_viewport('viewport2').setvisible(False) app.get_viewport('viewport3').setvisible(False)
def refresh(self): """Update some checkmarks""" self.Check(ID_SnapToGrid, cfg.Repository.getsettingvalue(cfg.ID_Grid)['snap enabled']) self.Check( ID_AngleSnap, cfg.Repository.getsettingvalue(cfg.ID_AngleSnapping)['enabled']) self.Check( ID_SizeSnap, cfg.Repository.getsettingvalue(cfg.ID_SizeSnapping)['enabled']) self.Check(ID_SingleViewport, servers.get_viewport_ui().getsingleviewport()) pynebula.pyBindSignal(app.get_object_state(), 'lockedmodechanged', self, 'on_locked_mode_changed', 0)
def refresh( self ): """Update some checkmarks""" self.Check( ID_SnapToGrid, cfg.Repository.getsettingvalue(cfg.ID_Grid)['snap enabled'] ) self.Check( ID_AngleSnap, cfg.Repository.getsettingvalue(cfg.ID_AngleSnapping)['enabled'] ) self.Check( ID_SizeSnap, cfg.Repository.getsettingvalue(cfg.ID_SizeSnapping)['enabled'] ) self.Check( ID_SingleViewport, servers.get_viewport_ui().getsingleviewport() ) pynebula.pyBindSignal( app.get_object_state(), 'lockedmodechanged', self, 'on_locked_mode_changed', 0 )
def set_layout_4view(): vps = ['viewport0', 'viewport1', 'viewport2', 'viewport3'] # make_selected_viewport_first(vps) unset_layout() vui = servers.get_viewport_ui() vui.dockviewport(vps[0], 'v0', 'left') vui.dockviewport(vps[0], 'h0', 'up') vui.dockviewport(vps[1], 'v0', 'right') vui.dockviewport(vps[1], 'h0', 'up') vui.dockviewport(vps[2], 'v0', 'left') vui.dockviewport(vps[2], 'h0', 'down') vui.dockviewport(vps[3], 'v0', 'right') vui.dockviewport(vps[3], 'h0', 'down') vui.setdragbarknob('h0', 0.5) vui.setdragbarknob('v0', 0.5) app.get_viewport(vps[0]).setvisible(True) app.get_viewport(vps[1]).setvisible(True) app.get_viewport(vps[2]).setvisible(True) app.get_viewport(vps[3]).setvisible(True)
def set_single_viewport(enabled): servers.get_viewport_ui().setsingleviewport(enabled)