Post #4970: Hey there!
📋 Metadata
- Author: Adam_Szalai
- Date: 2023-12-12 14:02:31
- Type:
bug_report - Quality Score: 7/10
- Replies (1): post_04971
🏷️ Tags
v1-20-x macro modal hotkeys intermediate unsolved
⚙️ Related PME Features
- Modal Operator
- Macro Editor
- Python Scripting
- Hotkey Configuration
💬 Content
Hey there!
I’m trying to use modal operator to execute more py files ‘On Invoke’, and then execute other py file ‘On Confirm’ and ‘On Cancel’
But it now works for me at all, and especially not working as in this video:
what i want to achive is:
i have an object already selected, and
-i want to select an object with certain name, and want to do mesh edit transformations on it
-after i finished transforming the object i want to go back to the initially selected object
i tried to do this with:
On Invoke - call external script: py 01 (selects a certain mesh)
On Invoke - call pie macro (enters resize tool in edit mode)
On Confirm - : py 03 (goes back to intially selected object)
On Cancel - : py 03 (goes back to intially selected object)
i’m not sure why but i can’t assign hotkeys for the On Confirm, and On Cancel, and if i execute the modal, it select and get to resize tool, but as soon as i start scaling the initially selected mesh is also scaled.
After a few modal call, it gives this error and can’t call the modal anymore:
Python: Traceback (most recent call last):
File "C:\Users\adam.szalai\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\pie_menu_editor\operators.py", line 2164, in invoke
return self.execute_menu(context, event)
File "C:\Users\adam.szalai\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\pie_menu_editor\operators.py", line 1978, in execute_menu
bpy.ops.pme.modal_grab('INVOKE_DEFAULT', pm_name=pm.name)
File "C:\Program Files\Blender Foundation\Blender 3.2\3.2\scripts\modules\bpy\ops.py", line 113, in __call__
ret = _op_call(self.idname_py(), C_dict, kw, C_exec, C_undo)
RuntimeError: Error: Python: Traceback (most recent call last):
File "C:\Users\adam.szalai\AppData\Roaming\Blender Foundation\Blender\3.2\scripts\addons\pie_menu_editor\operators.py", line 1294, in invoke
self.overlay = Overlay(context.area.type)
AttributeError: 'NoneType' object has no attribute 'type'
Location: C:\Program Files\Blender Foundation\Blender 3.2\3.2\scripts\modules\bpy\ops.py:113
The py files are working fine if i execute them with a shortcut, so they are working in 3dview workspace