[Draft] Enable Transform context menu item
The "Transform" and "Set Colors..." context menu items did not work on most Draft objects because the View Provider has a setEdit() function, which overrides any edit action provided at a higher level (e.g. by Part). This commit checks the mode of the edit, and if it is not zero, behaves as though the setEdit() function does not exist, allowing Part to provide the required context menu behavior.
This commit is contained in:
@@ -383,13 +383,19 @@ class ViewProviderDraft(object):
|
||||
|
||||
Returns
|
||||
-------
|
||||
bool
|
||||
bool or None
|
||||
It is `True` if `mode` is 0, and `Draft_Edit` ran successfully.
|
||||
None if mode is not zero.
|
||||
It is `False` otherwise.
|
||||
"""
|
||||
if mode == 0 and App.GuiUp: #remove guard after splitting every viewprovider
|
||||
Gui.runCommand("Draft_Edit")
|
||||
return True
|
||||
elif mode != 0:
|
||||
# Act like this function doesn't even exist, so the command falls back to Part (e.g. in the
|
||||
# case of an unrecognized context menu action)
|
||||
return None
|
||||
|
||||
return False
|
||||
|
||||
def unsetEdit(self, vobj, mode=0):
|
||||
|
||||
Reference in New Issue
Block a user