Fix T38145: python error popup when pressing shift+Z in blender game mode.
This commit is contained in:
@@ -347,11 +347,16 @@ class WM_OT_context_toggle_enum(Operator):
|
|||||||
if context_path_validate(context, data_path) is Ellipsis:
|
if context_path_validate(context, data_path) is Ellipsis:
|
||||||
return {'PASS_THROUGH'}
|
return {'PASS_THROUGH'}
|
||||||
|
|
||||||
exec("context.%s = ('%s', '%s')[context.%s != '%s']" %
|
# failing silently is not ideal, but we don't want errors for shortcut
|
||||||
(data_path, self.value_1,
|
# keys that some values that are only available in a particular context
|
||||||
self.value_2, data_path,
|
try:
|
||||||
self.value_2,
|
exec("context.%s = ('%s', '%s')[context.%s != '%s']" %
|
||||||
))
|
(data_path, self.value_1,
|
||||||
|
self.value_2, data_path,
|
||||||
|
self.value_2,
|
||||||
|
))
|
||||||
|
except:
|
||||||
|
return {'PASS_THROUGH'}
|
||||||
|
|
||||||
return operator_path_undo_return(context, data_path)
|
return operator_path_undo_return(context, data_path)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user