Age | Commit message (Collapse) | Author |
|
Contributed by Valentin (Poulpator).
Differential Revision: https://developer.blender.org/D7027
|
|
This commit is a full refactor of the grease pencil modules including Draw Engine, Modifiers, VFX, depsgraph update, improvements in operators and conversion of Sculpt and Weight paint tools to real brushes.
Also, a huge code cleanup has been done at all levels.
Thanks to @fclem for his work and yo @pepeland and @mendio for the testing and help in the development.
Differential Revision: https://developer.blender.org/D6293
|
|
The old convention was easy to confuse with ScrArea.
Part of https://developer.blender.org/T74432.
This is mostly a batch rename with some manual fixing. Only single word
variable names are changed, no prefixed/suffixed names.
Brecht van Lommel and Campbell Barton both gave me a green light for
this convention change.
Also ran clan clang format on affected files.
|
|
|
|
This adds a utility functions to draw a label highlighted or in red.
Differential Revision: https://developer.blender.org/D6934
|
|
To issues caused this:
* The code to launch the filebrowser from a button didn't respect popup
menus stored in context
* There was actually no popup menu region stored in context for this
case. Doing so *may* introduce other issues, but the way I did things
already fixes all issues I've found.
|
|
`ARegion.alignment` unfortunately is a mixture of value and bitflag
enumerations. When checking for left/right/top/bottom region alignment,
the flags have to be masked out usually.
Most of the fixed cases here probably didn't cause issues in practice,
but could in fact break at any point when surrounding logic changes.
In fact the assert in #region_visible_rect_calc() failed in an older
file from https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=949035. This
fixes it.
|
|
Reviewers: campbellbarton
Differential Revision: https://developer.blender.org/D6589
|
|
Adds a `text` parameter to `bpy.types.uiLayout.template_ID()` which
causes a label to be added, as usual. Adding the label also makes the
template respect the `bpy.types.uiLayout.use_property_split` option.
Also fixes wrong layout being used in the template-ID, although I think
that didn't cause issues in practice.
Sergey requested this for usage in the Movie Clip Editor.
|
|
Without this, boxes are unusable in header layouts as they
add vertical space which shifts the items out of the header.
|
|
Not exposed to Python API yet, this should get more detailed testing with different
layouts before that happens.
Ref T69652
|
|
For operators with dynamic tooltips the tooltip calculation is
deferred until the moment it is actually shown for performance
reasons, with the tooltip field left blank for the time being.
Enum menu code shouldn't jump in and assign a tooltip either.
The menu button itself can't show a dynamic tooltip because it
does not actually call the operator, and has no reference to it.
As a side change, allow returning None from the python callback
as the most natural way to fall back to the default tooltip.
|
|
|
|
|
|
The old layout of `PointerRNA` was confusing for historic reasons:
```
typedef struct PointerRNA {
struct {
void *data;
} id;
struct StructRNA *type;
void *data;
} PointerRNA;
```
This patch updates it to:
```
typedef struct PointerRNA {
struct ID *owner_id;
struct StructRNA *type;
void *data;
} PointerRNA;
```
Throughout the code base `id.data` was replaced with `owner_id`.
Furthermore, many explicit pointer type casts were added which
were implicit before. Some type casts to `ID *` were removed.
Reviewers: brecht, campbellbarton
Differential Revision: https://developer.blender.org/D5558
|
|
This hack would make operator (push down) buttons without icons align
their text to the left in toolbars. Everywhere else in Blender, we
center it by default.
We barely use operator buttons in toolbars anymore. Even if we do and
there's a good reason to make text left aligned, it's better to use
`uiLayout.alignment = 'LEFT'` to achieve the same effect, but without
lowish-level hacks for a specific region type.
Differential Revision: https://developer.blender.org/D5527
|
|
To fully support storing colors as a custom property, it is necessary
to allow switching the property UI to the standard color picker button.
That means in effect supporting custom property subtype values.
Change RNA_property_subtype to look for a 'subtype' string field
in _RNA_UI and parse it as an enum value. To minimize performance
impact, only do it if the property is an array; also, don't use
the custom subtype during RNA path parsing.
On the python side, allow setting some most useful seeming values
from the custom property settings editor.
Also, since some color picker code seems to run into a risk of
buffer overruns if the array size is wrong, check the size in
the UI layout code to be safe.
Reviewers: campbellbarton
Differential Revision: https://developer.blender.org/D5475
|
|
In some rare cases it is convenient to store a short array value
as a custom property, e.g. a vector or color. For example, it may
be helpful when importing/exporting certain formats that support
custom or nonstandard attributes on objects.
The custom property storage already can handle arrays in order to
support properties defined via python. The only thing missing is
UI support (and some bugs), and this patch fixes that:
- Allow editing short array properties via Custom Properties panel.
- Fix a UI layout sizing bug triggered by the previous item.
- Fix a dependency graph bug with drivers using such properties.
- Make RNA_*_get_default_array code robust in case of size mismatch.
- Support custom default values for array properties, allowing
both an array and a scalar value.
Reviewers: campbellbarton
Differential Revision: https://developer.blender.org/D5457
|
|
|
|
|
|
|
|
For now don't show missing quick favorite menu items which are missing.
Once menu editing is supported they could be displayed.
|
|
Previously, if a boolean happened to use an icon there was no way
to make it display as a check-box from Python scripts.
The previous logic meant we ended up having to edit the RNA.
Since booleans with icons don't work well with the split-property layout
(now used for most of the interface).
Icons were being removed from RNA then added back using awkward Python
ternary expressions in the interface scripts.
The toggle argument now has an unset state (-1).
- toggle=True: no checkbox (emboss).
- toggle=False: always use a checkbox (no icon).
- toggle=(unset/-1): depends on the icon status, default as before.
Since toggle=False was default, this isn't used in existing UI logic.
|
|
Also avoids using uninitialized vars.
|
|
The outliner should not be the only way for users to change these settings.
The Python API was extended to keep these properties positive and keyframable.
Differential Revision: https://developer.blender.org/D4889
|
|
This also makes `IDP_CopyProperty` the "opposite"
of `IDP_FreeProperty`, which is what I'd expect.
Two refactoring steps:
* rename IDP_FreeProperty to IDP_FreePropertyContent
* new IDP_FreeProperty function that actually frees the property
Reviewers: brecht
Differential Revision: https://developer.blender.org/D4872
|
|
All buttons will get their own block's `func` by default, this cannot be
considered an error, do not assert in that case either.
Fixes bunch of very annoying asserts e.g. when using FBX exporter...
|
|
As mentioned in the comment, the icon width computation relies on
big enough margins; however in compact mode they aren't big enough
and the label gets truncated.
|
|
Prepare for enabling ReflowComments.
|
|
Differential Revision: https://developer.blender.org/D4682
|
|
|
|
Expanding enum items in a small area would render the names with
dots, what is a bad solution. When you use expand directly on a
`grid_flow` or `column_flow`, it will render the items on multiple
lines, giving more control to the developer.
Reviewers: campbellbarton, brecht, mont29
Differential Revision: https://developer.blender.org/D4698
|
|
|
|
|
|
|
|
Apply clang format as proposed in T53211.
For details on usage and instructions for migrating branches
without conflicts, see:
https://wiki.blender.org/wiki/Tools/ClangFormat
|
|
|
|
Use this for the save confirmation dialog so it has a default action
when pressing enter which draws with a highlight so it's clear what the
default action is (the dialog was just closing before).
Resolves T57686
|
|
|
|
Matches prop_with_popover, supporting menu types,
useful if we want to control behavior of enum switching.
|
|
A version for menu's is going to be added next and we already have
UILayout.prop_menu_enum.
This name indicates the popover is added behavior instead of a
different kind of widget.
|
|
|
|
Support for RNA enum buttons that activate popovers when clicked.
This means we get useful tooltips, shortcuts and Ctrl-Wheel cycling
over enum items.
It also avoids inconvenient & slow access of enum values currently done
via RNA type lookups on the type to get the name & icon to use for a
regular popover button.
Resolves T57738
|
|
|
|
|
|
|
|
Warning/issue introduced on rBcaa357dae70322e.
|
|
|
|
|
|
Use right aligned checkboxes when 'use_property_split' is enabled
instead of a separate label.
|