Page MenuHome

Hide grease pencil tools if it is disabled

Authored by Scott Petrovic (scottpetrovic) on Dec 7 2013, 7:28 PM.



If the grease tool option is unchecked, you shouldn't see the tools in the toolbar. It is confusing when you try to use it and it doesn't work. Then find out the option was just unchecked.

Diff Detail

Event Timeline

Brecht Van Lommel (brecht) requested changes to this revision.Dec 7 2013, 10:34 PM

I think the grease pencil operators should have poll functions that check this option, which will then cause the buttons to be greyed out.

The buttons can be hidden still, I don't really have a strong opinion on this, I've added Joshua to give feedback. But only hiding them does not solve the problem when using shortcut keys to launch the operators.

This might need some more thought. The only thing I don't like about greying out buttons is when there isn't a clear way to enable them. The "show grease pencil" option is in another menu to the right that is very separated. It isn't clear that you have to go there to enable it.

The user preferences does it correct by having the enable button right next to the greyed out out areas.

I think of the grease pencil tool as more of an advanced tool that people use when they are doing presentations or creating tutorials. The tool itself has a secondary purpose compared to creating artwork.

For the shortcut key, that is a different use case. I would think it would be the most intuitive for the grease pencil to be force enabled whenever the short cut key is pressed. If someone knows the shortcut key and presses it, they know what they want to do. This would apply to all of the different shortcuts for the grease pen: draw, line, poly, and erase.

You have way more experience in what situations come up with this application. I trust your judgement.


Whatever is decided, I will make the code changes.

I think it could be good to automatically unhide grease pencil when you start drawing. I don't really have a strong opinion on this, either that or poll works for me, probably having it auto unhide is convenient.

But I'm not the grease pencil maintainer so would like some feedback from others.

What's the purpose of disabling grease pencil? This seems like an unnecessary options when you can simply toggle each layer? I realize it'd be nice to disable many layers at once, but it still seems a bit unnecessary.

Also, if work is to be done on the grease pencil, I'd like to open the discussion of moving all of the grease pencil tools and options into a single panel. This is likely for another task, but the separation between the grease pencil tools and the grease pencil tools is wrong in my opinion. If there's strong opinions on this other than my own I'll start another task for it to open the discussion.

I agree with @Jonathan Williamson (carter2422) that having an enable/disable grease pencil tool might be more confusing than helpful. You can always just delete the lines in the settings as well.

I also like the idea of moving all grease pencil functionality into one panel. I would think moving it to the settings would be the better of the two. Like I stated earlier, the grease pencil tool doesn't have nearly the same priority as other tools such as moving, scaling, etc. The grease pencil tool is under Object Tools, but it doesn't affect the object, but the view.

Maybe someone else can weigh in.

Ok, I'll try to address each of the points raised here one by one:

1) It's confusing when Grease Pencil is disabled and users try to activate the tools from the toolbar
Agreed. It's not good that there is no feedback provided about why nothing happened here.

It should be noted though that the ability to disable all Grease Pencil drawing (at least post 2.5) is a relatively new feature, that was introduced long after the conversion to using the operator system. Hence, that's why the tools don't currently take this setting into account. However, the original incarnation of Grease Pencil worked a different way (see point 4)

2) The Grease Pencil tools should be hidden if they don't work
No. As @Brecht Van Lommel (brecht) says, it's better that things don't mysteriously disappear, but rather remain greyed out.

At least then, users have some hunch that they're not crazy trying to look for whatever tools they thought they remembered seeing, and at the same time, seeing the tool disabled, they know that they have to go hunting for something that will fix whatever problem is causing the tool to be disabled. While I do agree with @Scott Petrovic (scottpetrovic)'s point that it's not ideal that the settings to re-enable something are not located directly beside the affected widgets, IMO it's also not such a biggie.

3) Poll Functions, Hotkey Operation, and Drawing Overrides Visibility Setting
We actually have several alternatives here:

  1. Poll function on the operator - This is the simplest option, but also disables hotkey usage completely
  2. Poll function on the layout for those buttons - By setting a " = ..." on the layout used in draw_gpencil_tools() for the Grease Pencil drawing, we could make it so that just trying to use the operator buttons to draw won't work when drawing of Grease Pencil is disabled. That way, using the hotkeys can still work unaffected
  3. Operator usage overrides visibility setting - Instead of setting any poll callbacks, we make it so that anytime the user tries to draw using whatever method, the draw setting gets disabled. This way, the buttons always do as promised. The only downside is that if a user had originally hidden a lot of stuff, then goes to start drawing, they will suddenly be confronted with a lot more than they bargained for suddenly popping up as their first stroke starts.

4) Separation between Tools/Properties Panels
In retrospect, the decision to split the Grease Pencil stuff into two places probably wasn't such a great idea. It stemmed from the original 2.5 design principle of separating "actions" from "settings". IIRC, this mainly came about because a common complaint from many users during the 2.4 series was that they found the old "Buttons Space" too conceptually loaded - it was mainly about settings, but then there were some places where it acted as a kind of command dashboard (noticeably the Mesh Tools panels in the Edit settings) alongside the rest of the settings. Personally, I never found this to be too much of an issue, but that's rather irrelevant here.

Anyways, it's probably ok that these can be integrated together. The main concern would be whether casual users will even find the Grease Pencil tools after doing this though.

In the original 2.4 implementation, all Grease Pencil stuff was located in the same (floating) panel. This was activated from the View menu. On that panel, there was a toggle to show/hide all Grease Pencil stuff in the viewport - when disabled, no drawing could happen at all.

5) Utility of Disabling Grease Pencil
@Jonathan Williamson (carter2422) From personal experience, I can say that a quick toggle to disable all Grease Pencil drawing (instead of having to toggle each layer separately) is quite useful. For example, say you've got a set of 3D guidelines sketched up in your viewport, using several different layers to get different colours for the different lines. Using this show/hide toggle, we can quickly toggle whether all of these are shown to declutter the viewport when working on some fine details, where showing everything is too much. However, if you have to use the layer toggles, it is much slower to do this.

I some time and watched youtube tutorials on how people are using the grease pencil tool from 2.48 through 2.6x - and it appears to be changing a fair amount with its location and functionality.

Most of you have a deeper understanding of this tool than I do. As @Aligorth states, I am leaning towards his direction as he appears to be the subject matter expert with how much time he has spent thinking about this. In terms of being easy for beginners, I think it is better to make the best decision with all of the information we have, not worry too much about a specific audience. Sophisticated doesn't necessarily mean complicated. As Leonardo Di Vinci use to say, "Simplicity is the ultimate sophistication".

1. Location
What section do we want to put all of the grease pencil tools in. Tools, settings, other...

2. Enable/Disable
Leave the enable/disable grease pencil tool as it is. It is useful. If you install a fresh copy of Blender, the grease pencil tool is enabled by default. If the shortcut doesn't work, it is somewhat self-inflicted.

3. Polling
@Aligorth first option seems the simplest to understand for me, so I pick that one (add poll function to operator).

This ties into a number of issues with Grease Pencil:

  • When activating a grease pencil tool, it gets disabled again after you draw one line (Unless you enable 'Sketching Session', which seems unnecessary)
  • The tool settings for grease pencil (View/Surface/Cursor/Stroke + Only Endpoints) are located inside the 3D View properties, far away from the grease pencil tool

Instead I think this is how it should work:

  1. You pick a Grease Pencil tool in the toolbar
  2. The tool settings appear in the Tool Settings area
  3. When any Grease Pencil tool is activated, the user can draw as many lines as he/she wishes, without a need for the 'Sketching Session' option

The current Grease Pencil tool and settings:

Using the new paradigm of the tabbed toolbar and tool settings being in the top bar, here's a mockup of how that might look with the grease pencil:

@Joshua Leung (aligorith), good points and I can agree with each of them. Now that you mention it, having the global toggle for grease pencil layers is really good if you're working with multiple layers. In my workflow I tend to only use one or two, but can definitely see where people would use many more.

@William Reynish (billrey), thanks for the mockup. I think that makes good sense. Once the vertical toolbar tabs are complete, I see no reason not to go ahead and move everything into the toolbar under a Grease Pencil tab, including the layers. Then if the INFO bar gets reworked, like is being discussed, then the layers can get moved to there if it's agreed upon.

Does anyone see any qualms with moving all grease pencil options to a toolbar tab?

I really like @William Reynish (billrey) mockup with putting it in the toolbar. Having a toolbar with settings will always be on screen, so we don't have to worry about the settings being hidden.

If we go that way, this change will have to wait until the 2.7x since the toolbar will be too large of a change for this diff.

Does anyone know if the UI changes are getting there own branch for the 2.7x release, or if we are going to slowly make changes in master? I don't mind doing some of the coding, but I don't want to just start submitting things to master that aren't ready for that large of a chnage. There will be quite a bit of moving things around if we implement a tool settings bar.

@William Reynish (billrey): You've raised a few interesting points here with your mockup. However, unless I'm missing something, there are a few things which don't seem clear to me here.

With this "tool settings" region/pane/bar at the top of the screen (?), do these settings get shown only after you've activated one of the Grease Pencil tools, or does this happen as soon as you activate the tab? If it is the former (i.e. only on tool activation), then there are a few problems with that design.

  • In particular, if you wanted to quickly access the layers (e.g. to change the color, show/hide some layers, or tweak the onion-skinning), you'd end up needing to needlessly activate a tool first. This is particularly an issue if/when you're working on something else, and need to make a quick tweak to your grease pencil settings since the current draw-style conflicts with what you've got in the viewport for whatever reason.
  • Where does the "convert" (layers to curves, etc.) tool go?
  • What happens in other editors? Once again, I get the impression that we're only designing for the 3D view, when there are a few other "sovereign" editors around in Blender (e.g. Sequencer, Nodes, UV/Image Editor, AnimEditors? etc.)

In retrospect, the "sketching sessions" toggle is really a bit of a hack :) Perhaps I really should have implemented this differently as a kind setting on the Grease Pencil paint operator which would only be set for those strokes activated via the buttons (while the hotkey style wouldn't get this set, so that quick one-off strokes would still be possible). It was actually derived from a very ancient feature (known as the "LMB Paint Lock" that existed in the original incarantion which basically made Grease Pencil semi-modal, by taking over the mouse buttons for drawing purposes as long as that toggle was enabled).

@Joshua Leung (aligorith):

Yes, you are right, the layers are a persistent control, not related to tool settings. Best to keep them in 3D view properties.

As for other editors, this all ties in to how the toolbar will work. We are exploring either to have a toolbar in each editor or to have one main one. The tool settings the the active tool, irrespective of editor, goes in the tool settings.

@Joshua Leung (aligorith):

Wanted to answer your questions more thoroughly:

Where to put layers: You are right, they don't go inside the tool settings. Let's keep these in 3D View properties

Where does the "convert" (layers to curves, etc.) tool go? I think Delete Frame and Convert to Curve could both go into the toolbar, inside the Grease Pencil tab, under the regular GP tools. They could also go inside the layers, like the Apply button modifiers

Like so:

What happens in other editors? The tool settings are global, so it always works on the tool last activated, irrespective of editor. But the tool list itself belongs to each editor, which is a bit weak. It's a deep fundamental consequence of Blender's multi-editor design where each editor is almost like its own mini-application.

It means we need toolbars everywhere which I'm not very keen on. Don't know what we can do about that, other than making the toolbar really small, simple and unobtrusive. Seems a bit silly, but this is what it'd look like:

@William Reynish (billrey) Is the top "toolbar settings" something that is in the pipeline? I don't know if it is a good idea to create a top toolbar just for this feature. Is this more "pie in the sky" type stuff?

@Scott Petrovic (scottpetrovic): The top bar is a design for an improved version of tool settings area, being discussed in the other design topics. It's a much larger project than just related to Grease Pencil.

But Grease Pencil is another example of a tool that's work well with this concept.

@William Reynish (billrey) - is there a discussion specifically about the top bar? I created one if not

I accidentally created the task without a reviewer. I can't add anyone after the fact since am not a moderator (which is fine by me). If a task exists for this top bar, let me know. I can't find it.

I think this grease pencil issue is very dependent on what direction the top bar might go. It might be better to close this out and open a new one later when that part of the UI matures a little more.

@Aaron Carlisle (Blendify) The module owner is @Joshua Leung (aligorith), so he is the person to decide if this go or not go to master.

Anyway, this task is very old and I don't think is good to work too much in UI design when the idea is to make a redo for 2.8.