Post #1468:
fj
π Metadata
- Author: roaoao
- Date: 2018-07-12 07:01:23
- Type:
answer - Quality Score: 8/10
- Reply to: post_01467
- Replies (1): post_01469
π·οΈ Tags
βοΈ Related PME Features
- Macro Operator
- Command tab
- Python Scripting
- Hotkey Configuration
π¬ Content
fjg3d:
In sculpt mode with dyntopo, Iβd like to have a hotkey that will
- switch to constant detail mode
- draw wire frame
- bring up the detail sampler
- then turn off wire frame after the detail sampler was used
How could I set something like this up? Iβm guessing modal, but I donβt know enough about them. Setting it up as a macro (without the last part turning the wireframe off) throws an error.
Yes, in this case you need to use Macro Operator. The problem is that Detail Sampler (and macros that uses the sampler) requires Constant Detail Mode. So you need to change Detail Type Mode before calling the macro.
Create a macro with 3 slots:
bpy.context.object.show_wire = True
bpy.ops.sculpt.sample_detail_size()
bpy.context.object.show_wire = False
Use the macro in Command tab:
bpy.context.scene.tool_settings.sculpt.detail_type_method = 'CONSTANT'; open_menu("My Macro Operator")
Or if you want to restore Detail Type Method:
s = bpy.context.scene.tool_settings.sculpt; m = s.detail_type_method; s.detail_type_method = 'CONSTANT'; open_menu("My Macro Operator"); s.detail_type_method = m