Code Monkey home page Code Monkey logo

gpencil_draw_switcher's Introduction

Features

Blender_Render16-07-2024_06 49 40AM_1384x279x Once you've set a binding for gpencil.draw_switcher, you can hold it (or press once and release if you enable 'toggle') whenever you're using your standard gpencil.draw bind to switch to whatever brush/material you'd like.

You can also add a TriggerBrush to only trigger the switching if you're on that brush name. Otherwise, it will use the draw mode specified in the keymap, default: Eraser.

โš  Notes (mostly blender faults)

  • If you let go of the switcher key without first lifting your pen, the release key will never be given to the addon and the switched-mode will stay until you hit the switcher button again. This is because blender suppresses the release notification to the addon while the drawing key is held down. There's nothing I can do to fix it on blenders' side, but if you really want to use this without this hitch, you can do what I did to fix it with an external mouse-message intercepting program called XBMC.

    If I had added another operator to wrap gpencil.draw and give me the keystroke messages, it would either always require a pen press to start drawing or never end because gpencil.draw() when cast from an addon never ends if "wait for input" is off. And there's no way to early-end it from Python either.

    This bug actually happens on the normal gpencil.draw too if you have it activated by button instead of by the eraser signal from your drawing tablet (which blender uses even without a keymap because it gets its own special API and I get nothing.)


  • Setting the keybind to an 'eraser key' like shown below probably won't work.

    Blender_Render12-07-2024_11 55 23PM_860x157x

    The addon listens for any key type and state, so if you can't set the eraser keybind with a physical press, you should probably bind the eraser button on your pen to something different, like a mouse button or key press.

    I use F13 to not absorb limited free key space (F13 is indeed a real thing, they go up to 25 I think.) For some Eraser isn't a typical key for blender, or at least my wacom tablet doesn't send it as such, and I've never been able to set it by actually pressing an eraser. Using a python key testing script I can't even seem to get it to detect the 'key' at all. I always have to select it in keymaps' mouse dropdown menu. I'm on windows, so I don't know if it would be any different on other OSes. Good luck if your pen driver/software doesn't have per-app keybindings. I'm sorry.


  • If you clear the entry on any field with the X button it may linger and continue switching/acting on trigger as if it was still there. Just manually specify an empty entry (the text box won't be grayed out if you did this right) and that should fix it. You can X it again after if you really want to, it stays fixed after one attempt.

    image Look for INK Pen. (Case-sensitive) image Still looking for it, because X was used to clear it. image Looking for " ". Not good enough. image Won't do any switching, truly empty. The default. Finally.

    Blender moment.

Installation

Install by going to Preferences > Addons > Install. Install the .zip file directly, you can't install it extracted. You can delete the original .zip after installing it, blender makes its own copy in its files somewhere. You'll have to redownload to install it again though.

gpencil_draw_switcher's People

Contributors

splits285 avatar

Watchers

 avatar

gpencil_draw_switcher's Issues

Materials can sometimes not switch back

I'm not sure what the conditions are that cause this since it seems to happen at random but it does happen to me. It has nothing to do with brush pins at least

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.