Path: Allow GUI Job creation without task panel interaction
These changes allow for a Job object to be created with view provider support, but without the initial task panel interaction at creation. This is useful for scripting and other internal Job creation tasks.
This commit is contained in:
@@ -1631,7 +1631,7 @@ class TaskPanel:
|
||||
self.updateSelection()
|
||||
|
||||
|
||||
def Create(base, template=None):
|
||||
def Create(base, template=None, openTaskPanel=True):
|
||||
"""Create(base, template) ... creates a job instance for the given base object
|
||||
using template to configure it."""
|
||||
FreeCADGui.addModule("PathScripts.PathJob")
|
||||
@@ -1642,7 +1642,10 @@ def Create(base, template=None):
|
||||
obj.ViewObject.addExtension("Gui::ViewProviderGroupExtensionPython")
|
||||
FreeCAD.ActiveDocument.commitTransaction()
|
||||
obj.Document.recompute()
|
||||
obj.ViewObject.Proxy.editObject(obj.Stock)
|
||||
if openTaskPanel:
|
||||
obj.ViewObject.Proxy.editObject(obj.Stock)
|
||||
else:
|
||||
obj.ViewObject.Proxy.deleteOnReject = False
|
||||
return obj
|
||||
except Exception as exc:
|
||||
PathLog.error(exc)
|
||||
|
||||
Reference in New Issue
Block a user