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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
up vote 4 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():

def unregister():

if __name__ == "__main__":

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 '14 at 11:54

I expanded gandalf3's example:

import bpy

items = [
    ("NONE"  , "None"  , "Don’t use any brush"         , 0),
    ("COMB"  , "Comb"  , "Comb hairs"                  , 1),
    ("SMOOTH", "Smooth", "Smooth hairs"                , 2),
    ("ADD"   , "Add"   , "Add hairs"                   , 3),
    ("LENGTH", "Length", "Make hairs longer or shorter", 4),
    ("PUFF"  , "Puff"  , "Make hairs stand up"         , 5),
    ("CUT"   , "Cut"   , "Cut hairs"                   , 6),
    ("WEIGHT", "Weight", "Weight hair particles"       , 7)

class PARTICLE_OT_select_brush(bpy.types.Operator):
    """Select a particle brush"""
    bl_idname = "particle.select_brush"
    bl_label  = "Particle Select Brush"

    brush = bpy.props.EnumProperty(
                name = "brush",
                default = "NONE",
                items = items

    def execute(self, context):
        context.scene.tool_settings.particle_edit.tool = self.brush
        for region in context.area.regions:
            if region.type == "TOOLS":
        return {'FINISHED'}

class VIEW3D_MT_particle_edit_select_brush(bpy.types.Menu):
    bl_label = "Particle Select Brush"

    def draw(self, context):
        layout = self.layout

        layout.operator_context = "INVOKE_REGION_WIN"

        for item in items:
                operator = "particle.select_brush",
                text = item[1],
                ).brush = item[0]

def register():

def unregister():

if __name__ == "__main__":

    #register keys via script
    #might be better done via user preferences
    #see image below

    wm = bpy.context.window_manager
    km = wm.keyconfigs['Blender User'].keymaps['Particle']

    keys = ("ONE","TWO","THREE","FOUR","FIVE","SIX","SEVEN","EIGHT")
    for item, key in zip(items, keys):
        kmi =
            idname = "particle.select_brush",
            type = key,
            value = "PRESS",
            )           = item[0]

    kmi =
        idname = "wm.call_menu",
        type = "TAB",
        value = "PRESS",
        ctrl = True
        ) = "VIEW3D_MT_particle_edit_select_brush"

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 '14 at 13:17

Your Answer


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.