Commit Graph

17 Commits

Author SHA1 Message Date
Campbell Barton
0e80e3d20c No need to count layers to check empty 2015-08-07 00:00:28 +10:00
Joshua Leung
b9ce21fd0f GPencil UI: Streamline the data panel workflow
Restored the "New Layer" button in the NKEY Grease Pencil panel (as was found
pre-2.73) for two cases:
 1) When no Grease Pencil datablock is active - This shortcut makes it possible to
    add a new layer to start drawing in with a single click again (instead of two
    clicks - one to add a datablock, and a second to add the layer)

 2) When there are no layers - There is no need to display the UI list in this case,
    thus saving a bit more space in the rare cases where this applies.
2015-08-07 01:48:27 +12:00
Joshua Leung
5f6b958e96 Fix: "show_points" setting for Grease Pencil drawing didn't work
As reported by zeffi, the "show_points" option was not working in master.
It probably broke recently, after some changes meant that the point sizes
weren't geting set prior to drawing these points anymore. Since this was
originally added as a debugging tool (though it is now somewhat redundant
due to the stroke editing functionality, which uses/exposes the same points),
this option wasn't really that important. I have decided to add back a toggle
for this to the UI though, since it can be used for some interesting effects...
2015-04-20 17:27:55 +12:00
Campbell Barton
af2f4724d5 Cleanup: don't use single sets for comparisons 2015-04-14 10:34:32 +10:00
Joshua Leung
d92d8c3768 GPencil: Some tweaks to make GPencil UI more compact when there are 0 or 1 layer(s) only
As brought up in T43595, the Grease Pencil layers list could sometimes end up
taking up too much space when there are no layers. Another issue raised there
was that the up/down buttons are redundant when there is only a single layer.
This commit makes some changes to get these a bit more compact for the case where
you have an empty GPencil datablock left over from previous work.
2015-02-13 02:48:49 +13:00
Campbell Barton
7095f47665 cleanup: pep8
also remove empty class parenthesis
2015-01-29 15:35:06 +11:00
Joshua Leung
c24b694986 Add GPencil Copy/Paste to secondary pie + toolshelf 2015-01-01 12:50:00 +13:00
Joshua Leung
d5f3aee41f Operator to duplicate the active Grease Pencil layer
TODO: this needs a proper "duplicate" icon, without the "ID" label
2014-12-31 14:20:44 +13:00
Joshua Leung
155bb058f4 GPencil UI: Color swatches for both Stroke and Fill colors are now shown
The layers list and the Dopesheet channels now show color swatches for both the
stroke and fill colours now. This is useful when you've got layers that only
use either/or.

* Currently, these only get shown if the relevant opacity setting is high enough
  for that aspect to contribute to the result.

* The sizing of these items could do with some more tweaking (especially in the
  Dopesheet), as these may now be too small to accurately see and/or interact with.

* There are some potential issues when using near-gray (or actually, colours similar
  to the list backgrounds, but that issue exists in other areas of Blender anyway.


(NOTE: At this stage, these changes are still experimental, and not for 2.73 yet)
2014-12-28 03:05:11 +13:00
Campbell Barton
9783d9297c cleanup: pep8 2014-12-09 21:49:46 +01:00
Joshua Leung
fe4d0c234e Bugfix T42774: BSurface addon doesn't work on new builds
It turns out that several important modelling addons depend on the assumption
that Grease Pencil data gets created on the active object instead of on scene
level. This commit adds a toggle for setting whether new Grease Pencil data
is created on scene or object level.

These work as follows:
* "Scene" = The behaviour originally introduced as part of the GPencil_EditStrokes
  changes. New strokes are added to the scene instead of the active object, making
  it easier to manage things when working with Grease Pencil in general.
* "Object" = The previous behaviour (from 2.50 to 2.72), where new strokes are added
  to the active object. This is now being reintroduced to soften the transition
  for addons out there which have been doing this in a lazy/lax way so far.


Now, what may be slightly confusing are the "fallback" measures in place:
* "Scene" - To ensure that loading old files goes ok without needing a version patch,
   if the active object has GPencil data, that will be used in place of the scene's
   own GPencil data.
* "Object" - If there was no active object at the time of creating strokes
  (for instance, if you delete the active object immediately before drawing),
  GPencil data gets attached to the current scene instead.

Since some tweaks may still be needed here, I've decided to bump the subversion
number so that we have a reference point when doing version patches.
2014-12-08 02:42:45 +13:00
Joshua Leung
367204a063 Lasso Select for GPencil Strokes 2014-12-02 13:52:48 +13:00
Joshua Leung
14b951747f Grease Pencil - Storyboarding Features (merge from GPencil_EditStrokes branch)
This merge-commit brings in a number of new features and workflow/UI improvements for
working with Grease Pencil. While these were originally targetted at improving
the workflow for creating 3D storyboards in Blender using the Grease Pencil,
many of these changes should also prove useful in other workflows too.

The main highlights here are:
1) It is now possible to edit Grease Pencil strokes
   - Use D Tab, or toggle the "Enable Editing" toggles in the Toolbar/Properties regions
     to enter "Stroke Edit Mode". In this mode, many common editing tools will
     operate on Grease Pencil stroke points instead.
   - Tools implemented include Select, Select All/Border/Circle/Linked/More/Less,
     Grab, Rotate, Scale, Bend, Shear, To Sphere, Mirror, Duplicate, Delete.
   - Proportional Editing works when using the transform tools

2) Grease Pencil stroke settings can now be animated
   NOTE: Currently drivers don't work, but if time allows, this may still be
         added before the release.

3) Strokes can be drawn with "filled" interiors, using a separate set of
   colour/opacity settings to the ones used for the lines themselves.

   This makes use of OpenGL filled polys, which has the limitation of only
   being able to fill convex shapes. Some artifacts may be visible on concave
   shapes (e.g. pacman's mouth will be overdrawn)

4) "Volumetric Strokes" - An alternative drawing technique for stroke drawing
   has been added which draws strokes as a series of screen-aligned discs.

   While this was originally a partial experimental technique at getting better
   quality 3D lines, the effects possible using this technique were interesting
   enough to warrant making this a dedicated feature. Best results when partial
   opacity and large stroke widths are used.

5) Improved Onion Skinning Support
   - Different colours can be selected for the before/after ghosts. To do so,
     enable the "colour wheel" toggle beside the Onion Skinning toggle, and set
     the colours accordingly.
   - Different numbers of ghosts can be shown before/after the current frame

6) Grease Pencil datablocks are now attached to the scene by default instead of
   the active object.
   - For a long time, the object-attachment has proved to be quite problematic
     for users to keep track of. Now that this is done at scene level, it is
     easier for most users to use.
   - An exception for old files (and for any addons which may benefit from object
     attachment instead), is that if the active object has a Grease Pencil datablock,
     that will be used instead.
   - It is not currently possible to choose object-attachment from the UI, but
     it is simple to do this from the console instead, by doing:
     context.active_object.grease_pencil = bpy.data.grease_pencil["blah"]

7) Various UI Cleanups
   - The layers UI has been cleaned up to use a list instead of the nested-panels
     design. Apart from saving space, this is also much nicer to look at now.

   - The UI code is now all defined in Python. To support this, it has been necessary
     to add some new context properties to make it easier to access these settings.
     e.g. "gpencil_data" for the datablock
          "active_gpencil_layer" and "active_gpencil_frame" for active data,
          "editable_gpencil_strokes" for the strokes that can be edited

   - The "stroke placement/alignment" settings (previously "Drawing Settings" at the
     bottom of the Grease Pencil panel in the Properties Region) is now located in
     the toolbar. These were more toolsettings than properties for how GPencil got drawn.

   - "Use Sketching Sessions" has been renamed "Continuous Drawing", as per a
     suggestion for an earlier discussion on developer.blender.org

   - By default, the painting operator will wait for a mouse button to be pressed
     before it starts creating the stroke. This is to make it easier to include
     this operator in various toolbars/menus/etc.   To get it immediately starting
     (as when you hold down DKEy to draw), set "wait_for_input" to False.

   - GPencil Layers can be rearranged in the "Grease Pencil" mode of the Action Editor

   - Toolbar panels have been added to all the other editors which support these.

8) Pie menus for quick-access to tools
   A set of experimental pie menus has been included for quick access to many
   tools and settings. It is not necessary to use these to get things done,
   but they have been designed to help make certain common tasks easier.

   - Ctrl-D = The main pie menu. Reveals tools in a context sensitive and
              spatially stable manner.
   - D Q    = "Quick Settings" pie. This allows quick access to the active
              layer's settings. Notably, colours, thickness, and turning
              onion skinning on/off.
2014-12-01 01:52:06 +13:00
Campbell Barton
0e0e528ea4 Cleanup: pep8 2014-09-17 18:36:17 +10:00
Thomas Dinges
a3202e434a Code cleanup: Re-use Grease Pencil panel for 3D view as well. 2014-02-24 20:53:37 +01:00
Campbell Barton
b7fa08f88a Code cleanup: style 2014-02-22 11:14:15 +11:00
Antony Riakiotakis
eb7485389b Use tabs for image editor.
For initial discussion see T38371

This commit organized panels for image editor to new tab categories dependent
on the image editor mode:

View Mode:
Tools - contains UV tools (currently only transform and UV Sculpting)
Scopes - contains scopes
Grease Pencil - contains Grease Pencil operators

Paint Mode:
Tools - contains brush options
Scopes - as above
Grease Pencil - as above

Mask Mode
Mask - contains mask tools
Scopes - as above
Grease Pencil - as above

Grease Pencil panel/tab now includes operators, not view options which have been
moved to the UI region on the right.
To make this work better, image editor toolbar now is of type TOOLS instead
of PREVIEW as was the case previously. A nice version patch makes sure all
works predictably, but opening newer files with older blender executables
could backfire.

This commit does not address which UV Tools will be included in the
Tools tab for the view mode, but does include some basic tools (transform)
and provides a class to inherit from to avoid conflicts with UV Sculpting.

Reviewers: brecht, dingto, sergey

Differential Revision: https://developer.blender.org/D315
2014-02-19 17:22:01 +02:00