0
$\begingroup$

I Want to simulate pressure sensitivity based on mouse speed, but need a way to detect a mouse event and call a method to change the brush strength.

something like this:

import bpy

last_mouse_pos

def on_left_mouse_hold ():

    if mode = sculpt
        mouse_pos = bpy.something.mouse_position
        mouse_speed = (mouse_pos - last_mouse_pos) ** 2
        bpy.something.sculpt.brush_strength = 1 / mousespeed
        last_mouse_pos = mouse_pos
$\endgroup$

Your Answer

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

Browse other questions tagged or ask your own question.