Post #1341: Mighty Pea:
📋 Metadata
- Author: roaoao
- Date: 2018-04-25 10:16:18
- Type:
answer - Quality Score: 8/10
- Reply to: post_01340
- Replies (1): post_01344
🏷️ Tags
pie-menu debugging advanced solved
⚙️ Related PME Features
- Pie Menu Editor
- Modal Editor
- Python Scripting
- Debug Mode
💬 Content
Mighty Pea:
I think I’ve found a bug:
When I set a pie to have a specific radius in it’s settings, and then open another (non-PME) pie menu, it inherits the radius, rather than take it from Blender’s settings.
Moving the viewport a bit resets it, but not always!
Thanks, will fix in the next version. Meanwhile you can set pie menu’s Animation Timeout (User Preferences - Interface tab) to 0.
Mighty Pea:
There’s also another problem I’ve been having where Debug Mode will get enabled, and every click I make in the PME interface will pop up the debug menu (where you add something to the current Pie). Only a full restart of Blender (so not just a new file) fixes this, and I haven’t been able to figure out when or why it happens!
Please let me know if you find a way to reproduce this.
Mighty Pea:
Another thing I can’t get to work:
https://i.imgur.com/EU9Zmb4.pngWhen I add that to a pie menu, it shows up as grayed out, both in edit and object mode
Grayed out button means that the button can’t be used in the current area or mode. Try to use it in Image Editor area.
Mighty Pea:
As for the smoothness problem, I tried adding undo redo, and it doesn’t seem to have worked.
Undo_redo operator works only for active operators. To make an operator active, you need to call it with True positional argument. For example bpy.ops.mesh.subdivide(True).
So, to change smoothness of the active operator in python, you need to use this code:
C.active_operator.smoothness = 0.2; bpy.ops.ed.undo_redo(True)
Note that undo_redo operator should always be called with True positional argument.
Mighty Pea:
How can I get the ‘Smoothness’ control on the mousewheel to function in the following Modal
The tool you want to create is complex but doable if we add some extra variables.
Video and json file: unsubdivide_subdivide.zip (740 Bytes).
Note that:
- We can’t use Mouse Move sub-hotkey with other sub-hotkeys in modals. That’s why I’ve used alt+LMB sub-hotkey to change strength of the tool.
- Key modifier is important in this case. You are using alt+W hotkey for this tool. So you have to use the same key modifier (alt) for all sub-hotkeys.
- The position of OnUpdate slots is important. In this case 6 OnUpdate slots are registered for the Tool sub-hotkey and only 1 for Smoothness sub-hotkey.