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

enter image description here


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.

  • $\begingroup$ Brilliant answer. Thx a lot gandalf3! I bet it will benefit more people. :) Suprising that this feature hasn't been integrated. $\endgroup$ – 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 = km.keymap_items.new(
            idname = "particle.select_brush",
            type = key,
            value = "PRESS",
        kmi.properties.brush = item[0]

    kmi = km.keymap_items.new(
        idname = "wm.call_menu",
        type = "TAB",
        value = "PRESS",
        ctrl = True
    kmi.properties.name = "VIEW3D_MT_particle_edit_select_brush"

user preferences

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

  • $\begingroup$ That's also nice! $\endgroup$ – Leon Cheung May 4 '14 at 13:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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