def OnSettingChange(self, e): for panel in self.panelList: idx = self.panelList.index(panel) for k in panel.paramCtrls.keys(): self.pluginConfig[idx]['params'][k] = panel.paramCtrls[k].GetValue() profile.setPluginConfig(self.pluginConfig) self.callback()
def main(): parser = OptionParser(usage="usage: %prog [options] <filename>.stl") parser.add_option("-i", "--ini", action="store", type="string", dest="profileini", help="Load settings from a profile ini file") parser.add_option("-r", "--print", action="store", type="string", dest="printfile", help="Open the printing interface, instead of the normal cura interface.") parser.add_option("-p", "--profile", action="store", type="string", dest="profile", help="Internal option, do not use!") parser.add_option("-s", "--slice", action="store_true", dest="slice", help="Slice the given files instead of opening them in Cura") (options, args) = parser.parse_args() if options.profile is not None: profile.loadGlobalProfileFromString(options.profile) if options.profileini is not None: profile.loadGlobalProfile(options.profileini) if options.printfile is not None: from Cura.gui import printWindow printWindow.startPrintInterface(options.printfile) elif options.slice is not None: from Cura.util import sliceRun sliceRun.runSlice(args) else: #Place any unused arguments as last file, so Cura starts with opening those files. if len(args) > 0: profile.putPreference('lastFile', ';'.join(args)) profile.putProfileSetting('model_matrix', '1,0,0,0,1,0,0,0,1') profile.setPluginConfig([]) #Do not import anything from Cura.gui before this spot, as the above code also needs to run in pypy. from Cura.gui import app app.CuraApp().MainLoop()
def OnSettingChange(self, e): for panel in self.panelList: idx = self.panelList.index(panel) for k in panel.paramCtrls.keys(): self.pluginConfig[idx]['params'][k] = panel.paramCtrls[ k].GetValue() profile.setPluginConfig(self.pluginConfig)
def OnAdd(self, e): if self.listbox.GetSelection() < 0: return plugin = self.pluginList[self.listbox.GetSelection()] newConfig = {'filename': plugin['filename'], 'params': {}} if not self._buildPluginPanel(newConfig): return self.pluginConfig.append(newConfig) profile.setPluginConfig(self.pluginConfig)
def OnResetAll(self, e = None): profile.putProfileSetting('model_scale', '1.0') profile.putProfileSetting('model_rotate_base', '0') profile.putProfileSetting('flip_x', 'False') profile.putProfileSetting('flip_y', 'False') profile.putProfileSetting('flip_z', 'False') profile.putProfileSetting('swap_xz', 'False') profile.putProfileSetting('swap_yz', 'False') profile.setPluginConfig([]) self.GetParent().updateProfileToControls()
def OnAdd(self, e): if self.listbox.GetSelection() < 0: wx.MessageBox('You need to select a plugin before you can add anything.', 'Error: no plugin selected', wx.OK | wx.ICON_INFORMATION) return plugin = self.pluginList[self.listbox.GetSelection()] newConfig = {'filename': plugin['filename'], 'params': {}} if not self._buildPluginPanel(newConfig): return self.pluginConfig.append(newConfig) profile.setPluginConfig(self.pluginConfig)
def main(): parser = OptionParser(usage="usage: %prog [options] <filename>.stl") parser.add_option("-i", "--ini", action="store", type="string", dest="profileini", help="Load settings from a profile ini file") parser.add_option( "-r", "--print", action="store", type="string", dest="printfile", help= "Open the printing interface, instead of the normal cura interface.") parser.add_option("-p", "--profile", action="store", type="string", dest="profile", help="Internal option, do not use!") parser.add_option( "-s", "--slice", action="store_true", dest="slice", help="Slice the given files instead of opening them in Cura") (options, args) = parser.parse_args() if options.profile is not None: profile.loadGlobalProfileFromString(options.profile) if options.profileini is not None: profile.loadGlobalProfile(options.profileini) if options.printfile is not None: from Cura.gui import printWindow printWindow.startPrintInterface(options.printfile) elif options.slice is not None: from Cura.util import sliceRun sliceRun.runSlice(args) else: #Place any unused arguments as last file, so Cura starts with opening those files. if len(args) > 0: profile.putPreference('lastFile', ';'.join(args)) profile.putProfileSetting('model_matrix', '1,0,0,0,1,0,0,0,1') profile.setPluginConfig([]) #Do not import anything from Cura.gui before this spot, as the above code also needs to run in pypy. from Cura.gui import app app.CuraApp().MainLoop()
def OnAdd(self, e): if self.listbox.GetSelection() < 0: wx.MessageBox( "You need to select a plugin before you can add anything.", "Error: no plugin selected", wx.OK | wx.ICON_INFORMATION, ) return plugin = self.pluginList[self.listbox.GetSelection()] newConfig = {"filename": plugin["filename"], "params": {}} if not self._buildPluginPanel(newConfig): return self.pluginConfig.append(newConfig) profile.setPluginConfig(self.pluginConfig)
def OnRem(self, e): panel = e.GetEventObject().GetParent() sizer = self.pluginEnabledPanel.GetSizer() idx = self.panelList.index(panel) panel.Show(False) for p in self.panelList: sizer.Detach(p) self.panelList.pop(idx) for p in self.panelList: sizer.Add(p, flag=wx.EXPAND) self.pluginEnabledPanel.Layout() self.pluginEnabledPanel.SetSize((1,1)) self.Layout() self.pluginConfig.pop(idx) profile.setPluginConfig(self.pluginConfig)
def OnRem(self, e): panel = e.GetEventObject().GetParent() sizer = self.pluginEnabledPanel.GetSizer() idx = self.panelList.index(panel) panel.Show(False) for p in self.panelList: sizer.Detach(p) self.panelList.pop(idx) for p in self.panelList: sizer.Add(p, flag=wx.EXPAND) self.pluginEnabledPanel.Layout() self.pluginEnabledPanel.SetSize((1, 1)) self.Layout() self.pluginConfig.pop(idx) profile.setPluginConfig(self.pluginConfig)
def OnDropFiles(self, files): profile.putProfileSetting('model_matrix', '1,0,0,0,1,0,0,0,1') profile.setPluginConfig([]) self.updateProfileToControls() self._loadModels(files)
def OnDropFiles(self, files): if len(files) > 0: profile.setPluginConfig([]) self.updateProfileToAllControls() self.scene.loadFiles(files)
def OnResetAll(self, e = None): profile.putProfileSetting('model_matrix', '1,0,0,0,1,0,0,0,1') profile.setPluginConfig([]) self.updateProfileToControls()
def OnDropFiles(self, files): if len(files) > 0: profile.setPluginConfig([]) self.updateProfileToControls() self.scene.loadScene(files)
def OnResetAll(self, e=None): profile.putProfileSetting('model_matrix', '1,0,0,0,1,0,0,0,1') profile.setPluginConfig([]) self.updateProfileToControls()