For example I want to assign on the checkbox "Wire" hot key F4 Can I do it?
1 Answer
Yes it's possible. Go to your User Preferences, Section Input, and navigate to 3D View, Object Mode:
Then, add a hotkey for Object Mode only, and use these settings:
- Operator Name: wm.context_toggle
- Hotkey: F4
- Context Attribute: object.show_wire
This Operator allows you to toggle many boolean properties if they are accessible reliably via Python. You can test it by going to a Python console and typing in:
bpy.ops.wm.context_toggle(data_path='object.show_wire')
The object.show_wire part is referring to the Active Object, searching for a property called show_wire on it. so if you try this instead, the X-Ray Property will be toggled instead:
bpy.ops.wm.context_toggle(data_path='object.show_x_ray')
If you want to have the operator working for any mode in the 3D View, add the shortcut under the 3D View Global section.
-
$\begingroup$ @R_M_S Apologies for the confusion. A long time ago I had coded my own operator to toggle these properties for all selected objects. I did reset Blender to factory settings before testing my initial answer, but the operator was still around for some reason. I edited my answer for a general working solution which works on the active object only. $\endgroup$ Commented Sep 25, 2016 at 5:33
-
$\begingroup$ aliasguru Thanks A lot . Now It works! Is it possible to do in any way, so that whenI press the F4 automatically is activated function 'Draw All Edges' Or for do it I need to create a individual hotkey? s16.postimg.org/xk4wmznp1/7_M_X_pe_XN.jpg $\endgroup$– R_M_SCommented Sep 25, 2016 at 6:43
-
$\begingroup$ @R_M_S It's better to assign a different shortcut to it. I tried mapping the Wire toggle to 'Press' and the Draw_All_Edges toggle to 'Release', but I get a glitch then. The Draw_All_Edges is activated and Deactivated right after that. However, Draw_All_Edges is something you only need to set once anyways. Maybe it's better if you select all Mesh items in your scene, make one the active object, and Alt+Click on the 'draw all edges' checkbox? This will turn on that mode for every selected object at once. $\endgroup$ Commented Sep 25, 2016 at 19:13