Take the 2-minute tour ×
Blender Stack Exchange is a question and answer site for people who use Blender to create 3D graphics, animations, or games. It's 100% free, no registration required.

I didn't find a way to set this, even via the right-click menu. Anyone could advise some? Thanks. :)

enter image description here

share|improve this question
add comment

2 Answers 2

up vote 3 down vote accepted

I didn't see an operator for this either, so you will have to write your own:

import bpy

class ParticleSmoothBrushSelect(bpy.types.Operator):
    """Select the smooth brush"""
    bl_idname = "particle.smooth_select"
    bl_label = "Select the smooth particle brush"
    bl_options = {'REGISTER', 'UNDO'}

    def execute(self, context):
        bpy.context.scene.tool_settings.particle_edit.tool = 'SMOOTH'
        return {'FINISHED'}


def register():
    bpy.utils.register_class(ParticleSmoothBrushSelect)


def unregister():
    bpy.utils.unregister_class(ParticleSmoothBrushSelect)

if __name__ == "__main__":
    register()

When run in the text editor, this will register the operator bpy.ops.particle.smooth_select(). You can assign a shortcut to this operator in the user preferences:

  1. Under Input > 3D view > Particle (assuming you want the hotkey to work in the 3D view when in particle edit mode), press Add New at the bottom of the Particle section.

  2. Collapse the new shortcut labeled "none".

  3. Enter the bl_idname into the box.

  4. Click the button and press the key(s) on the keyboard you want to set as the shortcut to set the brush type.

    enter image description here


One way to keep the operator registered so that you don't need to keep running things in the text editor every time you start blender is by including your operator text datablock in the default .blend and enabling Register in the header (see my answer here for more detailed instructions):

enter image description here

Note that your text datablock must have a .py extension.

Aside from that, you might just want to make a complete addon.

share|improve this answer
    
Brilliant answer. Thx a lot gandalf3! I bet it will benefit more people. :) Suprising that this feature hasn't been integrated. –  Leon Cheung May 4 at 11:54
add comment

I expanded gandalf3's example.

user preferences

You can bind keys to call a menu or directly choose a specific brush.

share|improve this answer
    
That's also nice! –  Leon Cheung May 4 at 13:17
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.