1
1

Compare commits

...

153 Commits

Author SHA1 Message Date
f0731bd5ac Merge branch 'master' into temp-ui-tweaks 2021-10-04 16:21:26 +02:00
2c5661682b Merge branch 'master' into temp-ui-tweaks
# Conflicts:
#	source/blender/editors/animation/time_scrub_ui.c
2021-10-04 12:59:53 +02:00
4e50c5f4fb Merge branch 'master' into temp-ui-tweaks
# Conflicts:
#	source/blender/editors/animation/time_scrub_ui.c
2021-10-04 12:58:42 +02:00
20c27a5151 Merge branch 'master' into temp-ui-tweaks 2021-09-27 16:11:27 +02:00
150b879969 Merge branch 'master' into temp-ui-tweaks 2021-09-22 16:40:14 +02:00
76c49d5884 GPencil: Fix error in previous commit
By error I commited the previous version.
2021-09-22 15:54:11 +02:00
71072a904f GPencil: Change Rotation tooltip
The tooltip was not clear about in what shading modes  works.

Related to T91467
2021-09-22 15:54:11 +02:00
cb0ab7bccc Cleanup: spelling (correct c5c8c68eec)
"iff" was intended as "if and only if". while exact use of abbreviations
isn't clear cut, I assumed this was a typo & it's not used anywhere
else in source/, expand to "only if" (suggested by Sybren).
2021-09-22 15:54:11 +02:00
7ae6f9dede Build: change make update to not print errors regarding submodule branches
Instead of trying to checkout non-existent branches and getting confusing fatal
error prints, check if the branch exists first.

Ref D12560
2021-09-22 15:54:11 +02:00
52fb64024b Geometry Nodes: support Noise Texture node
This makes the Noise Texture node available in geometry nodes.
It should behave the same as in shader node, with the exception
that it does not have an implicit position input yet. That will
be added separately.

Differential Revision: https://developer.blender.org/D12467
2021-09-22 15:54:11 +02:00
c2ab184162 Geometry Nodes: support Set Position node on instances
Previously, the node would always realize instances implicitly.
Now it can change the position of entire instances.
The Realize Instances node can be used before if the old
behavior is required.

Differential Revision: https://developer.blender.org/D12555
2021-09-22 15:54:11 +02:00
3107db97e2 make_update: Fix case where a sub-module would not have required branch.
Issue revealed by rB546314fc9669 change, also error itself exited before
that commit.

Now we do accept git command to fail when trying to checkout the
specified branch from sub-modules, and only actually error in case the
fall-back branch (aka master) cannot be properly checked out.

Thanks fot Ray molenkamp (@LazyDodo) for report and initial patch
(D12560).
2021-09-22 15:54:11 +02:00
3ea201bfa6 Geometry Nodes: new Realize Instances node
This node has a simple geometry input and output.
If the input geometry contains instances, they will be realized
into actual geometry. When there are many instances, this can
be very slow and memory intensive. Generally, instances should
only be made real when necessary, e.g. when every instance
should be deformed independently.

Differential Revision: https://developer.blender.org/D12556
2021-09-22 15:54:11 +02:00
f1f3552b9b UUID: add nil value for UUIDs
Add `BLI_uuid_nil()` that returns the nil UUID (used to indicate "not
set") and `BLI_uuid_is_nil(uuid)` to do an equality test with the nil
value.
2021-09-22 15:54:11 +02:00
03a10c31d6 UUID: fix seeding the RNG clock on macOS
On Apple machines, call `clock_gettime()` instead of `timespec_get()`.

macOS only introduced `timespec_get()` in version 10.15 (introduced
approx two years ago, so in 2019), even though the function is from C11.
2021-09-22 15:54:11 +02:00
3486a23b1e Cleanup: UUID, prevent "missing braces" warning on macOS
Add braces around initialization of sub-objects, as per the warning
suggestion on macOS.

No functional changes.
2021-09-22 15:54:11 +02:00
03fa0ef033 UUID: include 'seconds' field of current time in RNG seed
XOR the 'seconds' and 'nanoseconds' fields of the current time to seed the
RNG used for generating random UUIDs. This ensures a better seed just in
case the clock as no sub-second resolution.
2021-09-22 15:54:11 +02:00
9f576b7db8 Fix T91511: GPencil weight_get and Vertex Groups not working at expected
The API was checking the number of total weights with the first point of the stroke and this was not valid because each point can have different number of weight elemnts,
2021-09-22 15:54:11 +02:00
451d734f80 UI: rename "Save Screenshot (Area => Editor)"
The term "area" isn't normally exposed in the UI.
2021-09-22 15:54:11 +02:00
3dc53b1a29 Cleanup: spelling 2021-09-22 15:54:11 +02:00
db70f583a2 Fix: Incorrect default values for the curve trim node
The default end factor should be 1. The proper value for the default end
length is somewhat arbitrary, but it shouldn't be zero.
2021-09-22 15:54:10 +02:00
5d4ca28f8c Fix: Spline length calculation fails with no evaluated points
The case that checked whether there were evaluated edges was incorrect,
since two points are needed for an edge. Then also avoid running the
accumulation for an empty span.
2021-09-22 15:54:10 +02:00
de5b91205a Fix build error after previous commit
Incorrect renaming and use of enum after search and replace.
2021-09-22 15:54:10 +02:00
bd67caa872 Cleanup: Fix/improve variable names and comments 2021-09-22 15:54:10 +02:00
a7e75b855e Compositor: Add OIDN prefiltering option to Denoise node
It's equivalent to the OpenImageDenoise prefiltering option in Cycles.
See D12043.

Prefilter modes:
- None: No prefiltering, use when guiding passes are noise-free.
- Fast: Denoise image and guiding passes together. Improves quality when
guiding passes are noisy using least amount of extra processing time.
- Accurate: Prefilter noisy guiding passes before denoising image.
Improves quality when guiding passes are noisy using extra
processing time.

Reviewed By: #compositing, jbakker, sergey

Differential Revision: https://developer.blender.org/D12342
2021-09-22 15:54:10 +02:00
f60420116c Compositor: Fix crash exporting buffers on debug
ImBuf allocates 4 channels, use copying to support buffers
with 1 and 3 channels.
2021-09-22 15:54:10 +02:00
0d206598f7 Compositor: Fix Alpha Over node ignoring emissive colors
It was an issue on Full Frame mode only.
2021-09-22 15:54:10 +02:00
b44b39d581 Cleanup: Rename curve node enums
The enum called "interpolate" was really a choice of methods for mapping
inputs to positions on the curve, whereas the "sample" enum was used to
define a way to create a whole set of new points from the curve, without
any input parameters. The "re-sample" vs. "sample" naming makes that
distinction better.
2021-09-22 15:54:10 +02:00
638f972453 Revert "GPencil: Curvature support for length modifier."
Reason for revert: accidental push of a intermediate change locally.

This reverts commit 25e548c96b.
2021-09-22 15:54:10 +02:00
24902401ba GPencil: Curvature support for length modifier. 2021-09-22 15:54:10 +02:00
fc406830f7 Audaspace: added audio file streams functionality.
On the blender side this commit fixes importing video files with audio
and video streams that do not share the same start time and duration.

Differential Revision: https://developer.blender.org/D12353
2021-09-22 15:54:10 +02:00
c9259808a1 Py API Docs: Fix audio docs example
After new AUD API changes from 2.8x what "buffer" function used to do
has now become "cache" function (it caches a sound into RAM). Therefore,
the basic aud example should call this new "cache" function instead of
"buffer" function.

Thanks to Michael-Z-Freeman for pointing out.
2021-09-22 15:54:10 +02:00
c3045118b3 Cleanup: add missing includes 2021-09-22 15:54:10 +02:00
68e229feea Cleanup: typo 2021-09-22 15:54:10 +02:00
ea6838ec6d Fix T91461: Pose Library name filter not working
since `AssetHandle` does not have a `name_property`
(`RNA_def_struct_name_property`), and the UIList is just using the
default `uilist_filter_items_default` it simply cannot filter on names
(`RNA_struct_name_get_alloc` wont succeed).

Adding a name_property also wont work since `AssetHandle` inherits
`PropertyGroup` (which already sets name_property).

So this adds a (temporary) hack exception for RNA_AssetHandle in
uilist_filter_items_default until the design of `AssetHandle` progresses
further.

thx @Severin for additional feedback

Maniphest Tasks: T91461

Differential Revision: https://developer.blender.org/D12541
2021-09-22 15:54:10 +02:00
d612181827 UI: Always Create Asset Previews
This patch allows Asset Browser previews to be made regardless
of the setting of the (unrelated) "File Preview Type" Preference.

See D12484 for more details.

Differential Revision: https://developer.blender.org/D12484

Reviewed by Julian Eisel
2021-09-22 15:54:10 +02:00
7b1a1bc8eb Geometry Nodes: hide Attribute Remove node when fields are enabled 2021-09-22 15:54:10 +02:00
6092fa3702 Fix (harmless) mistake in recent new Append code.
This code path is not yet used so no harm, but that was a fairly nasty
potential crash-generator.
2021-09-22 15:54:10 +02:00
a17e895d7d Cleanup: clang-tidy warnings in UUID code
Use C++ version of C headers, and avoid static function call on instance.

No functional changes.
2021-09-22 15:54:10 +02:00
5e5a98e51a Cleanup: fix memory leak 2021-09-22 15:54:10 +02:00
Henrik Dick
8129dd3189 Fix T91481: Grease Pencil Layer Double Transformations
Use the inverse of the grease pencil object. This patch fixes the issue for bones and objects.

Maniphest Tasks: T91481

Differential Revision: https://developer.blender.org/D12539
2021-09-22 15:54:10 +02:00
e831f41d0b Blenlib: introduce a UUID type
Add `BLI_uuid` and `DNA_uuid_types.h` with a UUID implementation
following RFC4122 (https://datatracker.ietf.org/doc/html/rfc4122.html).

The following features are implemented:
- A struct of 128 bits that can be used in DNA definitions.
- Generation of version 4 UUIDs, that is, purely random ones.
- UUID equality function.
- String to UUID and UUID to string conversion functions that are
  compatible with RFC4122.
- C++ stream operator that outputs the UUID as string.

This UUID will be used by the asset system, to uniquely identify asset
catalogs.

Reviewed By: Severin, jacqueslucke

Differential Revision: https://developer.blender.org/D12475
2021-09-22 15:54:10 +02:00
fe2efb6866 Fix T91448: GPencil Fill simplify not working in render
The simplify was hardcode to be disabled in render.
2021-09-22 15:54:10 +02:00
2f06f35513 Fix T85564: FCurve modifier zero influence on restrict range borders
When using FModifier `Restrict Frame Range`, the resulting influence was
zero being exactly on `Start` / `End` range borders (so borders were
**exclusive**).
This made it impossible to chain FModifers together (forcing the user to
specify values slightly below the desired border in following
FModifiers).
This is now corrected to be **inclusive** on Start / End range borders.

Before
{F10234864}
After
{F10234865}
Testfile
{F10234866}

In the case of touching open borders (so [frame A frame B] followed by
[frame B frame C]) both modifiers are evaluated (in stack order).
If the later modifier has full influence (and is not additive) this simply
means the result is the same as the later modifier's value.
If influences below 1 are used (or modifiers are additive) both modifier's
values are interpolated/added accordingly.

technical notes:
- this was caused by the introduction of FModifier Influence/BlendIn-Out
in rB185663b52b61.
- for comparison, see other occurrences of
`FMODIFIER_FLAG_RANGERESTRICT`.
- the following conditions in `eval_fmodifier_influence` for blend in/
out have been changed accordingly.

Maniphest Tasks: T85564

Differential Revision: https://developer.blender.org/D10401
2021-09-22 15:54:10 +02:00
f91718bdd9 WM: expose the "any" state of KeyMapItem modifiers
Change KeyMapItem.alt/ctrl/shift/oskey to integer types,
where -1 is used to ignore the modifier when matching key-map items.

It was only possible to set all modifiers to -1 at once from RNA
using the 'any' property.
Afterwards individual modifiers could be set back to true/false.
Although these key-map items could not be exported/imported.

Exposing the values directly avoids the need for cumbersome workarounds.
2021-09-22 15:54:10 +02:00
c0fb68a93d Cleanup: remove KM_MOD_SECOND & KM_SHIFT2, KM_CTRL2.. etc
These were added in a1c8543f2a (2007)
but never used.
Nor did they have any meaning in practice.

Note that versioning keymap items isn't needed as these values were
never set. The code-paths that set these values also set KM_MOD_FIRST
causing `keymap_event_set` to only ever assign values of 0 or 1.

These flags complicate further exposing KM_ANY (-1)
which is also a valid value for modifiers.
2021-09-22 15:54:10 +02:00
13a0a0d592 UI: expose "Lasso Select" & "Extrude to Cursor" in menus
- Show "Lasso Select" in menus (along with Box & Circle select)
- Show "Extrude to Cursor" (along with other extrude actions).
- Rename operators that add/extrude on Ctrl-Click
  since their names were inconsistent.

This is mainly for discoverability.
2021-09-22 15:54:10 +02:00
ff3345a554 UI: enable the depend-on-cursor flag for some operators
- Bend (Transform).
- Extrude to Cursor.
- Lasso Select (related operators such as node-cut links, mask.. etc).
- Rip Mesh / UV's.
- Vertex/Edge Slide.
2021-09-22 15:54:10 +02:00
9ec46174a0 UI: split screenshot area into a separate operator
While the screenshot operator showed an "Area" option,
it wasn't usable from the main menu (unless accessed via menu search).

Split screenshot area into an operator that depends on cursor.
2021-09-22 15:54:10 +02:00
500d0e1fda UI: wait for input for operators that depend on cursor location
Support waiting for input so operators that depend on the
cursor location are usable from menus / buttons.

Use an operator type flag which the user interface code checks for,
waiting for input when run from a menu item.

This patch only supports this feature, there are no functional changes.

The motivation for this change is discoverability since some actions
were either hidden or broken when accessed from menus
(where the behavior of the operator depended on the menu location).

In general, waiting for input is *not* an efficient way to access tools,
however there are over 50 operators with a "wait_for_input" property
so this isn't introducing a new kind of interaction,
rather exposing this in a way that does not need to be hard-coded into
each operator, or having modal callbacks added for the sole purpose
of waiting for input.

Besides requiring boiler plate code using a "wait_for_input" property
has the added down-side of preventing key shortcuts from showing.
Only the menu items will enable the property,
causing them not to match key-map items.

Reviewed By: Severin

Ref D12255
2021-09-22 15:54:10 +02:00
711673caff Fix: Nodes modifier ignores input value with new property missing
An issue with the previous commit-- the default value of the type was
used instead of the property value when the "use_attribute" property
was missing.
2021-09-22 15:54:10 +02:00
2e309eb86a Geometry Nodes: Add a toggle to use attributes as input values
This adds a toggle to node group inputs exposed in the modifier to use
an attribute instead of a single value. When the toggle is pressed, the
button switches to a text button to choose an attribute name. Attribute
search isn't implemented here yet.

One confusing thing is that some values can't be driven by attributes
at all, like the size of a primitive node. In that case, we should have
a node warning, but that will be separate since it's more general.
We can also have an option to turn off this toggle in node group
input settings.

The two new properties for each input are stored with the same name
as the value, but with `"_use_attribute"` and `"_attribute_name"``
suffixes. The properties are not added for socket types that don't
support attribute input, like object sockets.

Differential Revision: https://developer.blender.org/D12504
2021-09-22 15:54:10 +02:00
f4ee2de310 UI: Automatic Blend Thumbnail Selection
Adds an "Auto" option to blend thumbnail types that will automatically
use Screenshot if there is no camera and 3dview, or workbench render
with shading settings from the largest 3dview.

See D12407 for more details.

Differential Revision: https://developer.blender.org/D12407

Reviewed by Campbell Barton
2021-09-22 15:54:10 +02:00
a241b69982 Cleanup: Pass const mesh argument
Also remove unnecessary parantheses.
2021-09-22 15:54:10 +02:00
b4a6d70789 Cleanup: Move mesh_convert.c to C++
This should allow easier changes when it's helpful to use C++ types.
The diff is for a test on the buildbot.

Differential Revision: https://developer.blender.org/D12528
2021-09-22 15:54:10 +02:00
89fe4220bc UI: Remove Menus & Show Wait Cursor When Saving
When saving blend files close any menus that might be open, show
"waiting" mouse cursor right away, before creating preview.

See D12507 for more details.

Differential Revision: https://developer.blender.org/D12507

Reviewed by Campbell Barton
2021-09-22 15:54:10 +02:00
2ea4b17c95 Cleanup: Remove unnecessary manual of move constructor
Turns out this isn't actually necessary.
2021-09-22 15:54:10 +02:00
f25c1f29b0 Geometry Nodes: Transfer attributes in the curve to mesh node
This patch allows point and spline attributes to be transferred to the
mesh generated by the curve to mesh node. All dynamic named and
anonymous attributes are transferred. So a user-created attribute will
be transferred, but "radius", "tilt" or the handle position attributes
won't be transferred by default and will need to be copied first.
This trade-off is made for performance, since most of the time, users
won't need these attributes copied.

Generally, attributes are transferred to the point/vertex domain.
However, if they have the same name as a built-in mesh attribute that
only exists on a different domain, like "shade_smooth", then they can
be transferred directly to that domain as well. Conversion directly to
the face corner domain is not necessary because there are no builtin
face corner attributes. I see this conversion directly to other domains
as an optimization we could use behind the scenes in the future as well,
when named attributes are less common.

For performance, I haven't tested which of the following is better:
```
for each spline combination:
    for each attribute:

for each attribute:
    for each spline combination:
```
For now I used the existing loop to avoid more threading overhead.

Differential Revision: https://developer.blender.org/D12363
2021-09-22 15:54:10 +02:00
084719ff1b Geometry Nodes: Simplify using OutputAttribute in a vector
Store the optional temporary span storage as a unique_ptr and move
it in the move constructor, to avoid the need to add a special move
constructor that clears the "show_warning" fields from it. Maybe this
is very slightly slower, but we'll need this class less often in the future
anyway.
2021-09-22 15:54:10 +02:00
23feb6770a Cleanup: Add built-in check for an attribute ID 2021-09-22 15:54:10 +02:00
7f8ba9dbb4 Rename App Menu to Blender Menu
"App" is a name reserved for the application templates at the moment.
It may become its own term in the near future if Templates are separated
from "Apps".

So since this is a name not exposed to the users we should renamed it
sooner than later.

Note that this will require scripts to update since the name of the
class is renamed here.

This also requires an update in the User Manual.

Differential Revision: https://developer.blender.org/D12523
2021-09-22 15:54:10 +02:00
fa165fc19e Assets: Recursive reading of asset libraries
With this, asset libraries can be directory structures and all assets in
sub-directories will show up in an Asset Browser.

With complex directory structures and many .blend files inside, asset
library reading will be quite slow for now. There's initial work being
done to introduce indexing for this (T82979), other optimizations are
being discussed as well.

Addresses T91406.

Differential Revision: https://developer.blender.org/D12139
2021-09-22 15:54:10 +02:00
1cf11da339 Hide empty keymap warnings when running a template 2021-09-22 15:54:10 +02:00
301c0c247c App Settings: Edge Resize
This prevents both editor resize as well as regions (e.g., the toolbar).

Note: This option is not visible in the UI.

Differential Revision: D12516
2021-09-22 15:54:10 +02:00
66e0182b80 App Settings: Regions Visbility Toggle
The toggle that allow users to "show" the region (header, toolbar, ...)
when it is collapsed can now be configured for the apps.

Note: This option is not visibile in the UI.

Differential Revision: D12516
2021-09-22 15:54:10 +02:00
4a538f0add Rename show_layout_ui > show_corner_split and remove from UI
This breaks API compatibility. However we are now grouping this setting
in the proper section (preferences.apps), so scripts had to update anyways.

So they may as well do it for the final name.

The reason to remove from the UI is that this is intended for app setup,
and as such it should not be exposed to final users until we have apps
better presented (for 3.1 hopefully).

Differential Revision: D12516
2021-09-22 15:54:10 +02:00
15acdf04d9 Cleanup: Rename USER_APP_LOCK_UI_LAYOUT
There will be other settings that lock other aspects of the
UI layout (e.g., resizing of editors). So better to name
this setting what it actually handles (the corners).

New name: USER_APP_LOCK_CORNER_SPLIT

Differential Revision: D12516
2021-09-22 15:54:10 +02:00
b4100bfa59 Cleanup: WM append code: de-duplicate post-make-local process a bit. 2021-09-22 15:54:10 +02:00
d82a73c67a Fix: properly implement the 'only append' execption case for WorkSpaces.
Add needed extra flag and utils to IDType to mark and check an ID type
as only appendable.

Note that this is only a loose user-level enforcement currently, in any
case you need to be able to link an ID to append it currently, so for
low-level code this does not really matter.

Currently only WorkSpace and Screen ID types are marked with the new
`IDTYPE_FLAGS_ONLY_APPEND` flag.
2021-09-22 15:54:09 +02:00
05b2ed822d Cleanup/Fix outliner 'make local' code.
While likely harmless, this code was doing extremely bad thing,
by-passing the whole lower-level `BKE_lib_id_make_local` call in case it
would fail and deciding by itself to forcefully make the given ID local.
Bad. Very, very, very bad.
2021-09-22 15:54:09 +02:00
71e29bf0b0 Cleanup: no need to clear new flags and pointers from whole Main when making a single ID local. 2021-09-22 15:54:09 +02:00
83449ab7d0 Cleanup: Comment about shpaekey being treated as embedded IDs in BKE_id_newptr_and_tag_clear. 2021-09-22 15:54:09 +02:00
9cee00621e Cleanup: Add comment about 'make_local' callback of Brush doing bad thing.
Callbacks in IDTypeInfo should never affect other IDs if they are not
embedded.

We break this rule in some cases, at least each of those should be
clearly commented about and get some security checks to try to avoid
unexpected issues as much as possible.
2021-09-22 15:54:09 +02:00
7df30bb5f6 Cleanup: Rename BKE_id_clear_newpoin to BKE_id_newptr_and_tag_clear. 2021-09-22 15:54:09 +02:00
abd31665dd Fix/refactor BKE_id_clear_newpoin and BKE_main_id_newptr_and_tag_clear.
Those were not clearing embdeed IDs flags and `newid` pointers at all...
2021-09-22 15:54:09 +02:00
68b306156c IDManagement: refactor: Remove 'test' part from BKE_lib_id_make_local.
Mixing testing and actual action in a single function is just not a good
way to do things, and the 'testing' feature is not used anywhere
anymore, time to get rid of it.
2021-09-22 15:54:09 +02:00
05cdd5f177 IDType: Add BKE_idtype_idcode_is_localizable.
This is the same as `BKE_idtype_idcode_is_linkable` currently, used only
in one place in UI code of IDtemplate.
2021-09-22 15:54:09 +02:00
a0949f0c30 IDType: Cleanup: Remove useless IDTYPE_FLAGS_NO_MAKELOCAL.
This flag became a full duplicate of `IDTYPE_FLAGS_NO_LIBLINKING`, which
is a good thing (don't think we ever want to be able to link some data,
without being able to make it local...).

So we can now remove it and use `IDTYPE_FLAGS_NO_LIBLINKING` instead.
2021-09-22 15:54:09 +02:00
a81e121d8d Fix ID-property UI versioning skipping nested meta-strips 2021-09-22 15:54:09 +02:00
5d3d2d839d Fix security popup re-displaying after undo
Don't reset these flags when loading a file (or undoing)
rely on BPY_python_reset to reset the flags.
2021-09-22 15:54:09 +02:00
5be80aea08 Fix memory leak if an error occurred assigning id-property sequence 2021-09-22 15:54:09 +02:00
081dc2cc92 Fix bisect gizmo offset while dragging 2021-09-22 15:54:09 +02:00
2923409795 GPencil: Fix dash modifier reading error.
The reference for parent modifier in segment data is not assigned. Now fixed.
2021-09-22 15:54:09 +02:00
14a9a3687b Cleanup: Use function to mark mesh normals dirty 2021-09-22 15:54:09 +02:00
0e1270ea9f Cleanup: Remove duplicate warning from subdivision surface node 2021-09-22 15:54:09 +02:00
5839e55295 Geometry Nodes: Hide values for selection inputs
Toggling the selection off in the node is the same as muting it,
so exposing it there doesn't help, and makes it less clear that it's
meant to be used as a field.
2021-09-22 15:54:09 +02:00
3f0d9a89d3 Fix: Division by zero in curve spiral primitive node 2021-09-22 15:54:09 +02:00
Johnny Matthews
0706f7a08a Splines: Add a method for reversing a Spline
This moved the spline reversing logic out of the Curve Reverse geometry
node and into the spline class. This allows a spline to reverse itself
with a call to `my_spline.reverse()`

The base class will reverse position, radii & tilt, while specialized
versions are created for Bezier and Nurbs splines to reverse the
additional data that these classes encapsulate.

Differential Revision: https://developer.blender.org/D12501
2021-09-22 15:54:09 +02:00
a969417f37 Tests: Updated test message for Directory Not Found 2021-09-22 15:54:09 +02:00
52bbd01895 Fix broken WorkSpace use after recent refactor of append code.
Essentially, Workspace (and Screen) types were defined as not
localizable.

In previous code it happended to work by mere chance (code path taken in
`BKE_library_make_local` was conviniently skipping the call to
`BKE_lib_id_make_local` in that case, hence not checking for
`IDTYPE_FLAGS_NO_MAKELOCAL` flag of the localized ID type).

This is a total abuse of this IDType flag, for now removing it.

That specific case (IDtype appendable but nor linkable) requires its own
proper flag, this will be tackled in a later commit.

Issue introduced in rB3be5ce4aad5e.
2021-09-22 15:54:09 +02:00
7e87a6963c Fix missing passes result when rendering multiple views
Caused by the lazily pass pixels allocation which didn't reset
allocation state of the render result.

Demo file: XXX
2021-09-22 15:54:09 +02:00
ba5859a5d7 Fix crash in 'drag asset' case in new append code from yesterday.
Scene and related pointer parameter can be NULL in link/append code, in
which case there is no instantiation of new objects/collections/obdata.

Link code in blendloader was already checking that, new instantiation
code in WM area from yesterday did not.

Issue introduced by rB3be5ce4aad5e.
2021-09-22 15:54:09 +02:00
Johnny Matthews
149501c774 BLI: Add a reverse method to MutableSpan
Add a method that allows a MutableSpan to reverse itself. This reverses
the data in the original span object. This is a first step in extracting
some functionality from nodes and making it more general.

Differential Revision: https://developer.blender.org/D12485
2021-09-22 15:54:09 +02:00
8ec6b1fc4c Geometry Nodes: Add fields version of material nodes
This commit moves the old material nodes to a "legacy" folder and adds
versions of the nodes that work with fields.

The "Select by Material" node is a field node now, so it doesn't have
a geometry output. This is an improvement because there are fewer links
to connect, and it's more easily usable in different situations.
It's also called "Material Selection", since it's more of an input
than an action now.

It's sometimes necessary to use the attribute capture node to get a
more predictable interpolation to mesh faces. This is because the
selection field input is always evaluated on the face domain, so
attribute inputs are interpolated before they are booleans, so they
cannot use the new interpolations from rB5841f8656d9580d7b9.

Differential Revision: https://developer.blender.org/D12456
2021-09-22 15:54:09 +02:00
f3241b8e34 Geometry Nodes: Add special domain interpolation for selections
The generic domain interpolation algorithms didn't quite work for
selections. The interpolation would do unexpected things that
were different than the results in edit mode. The new behavior
is supposed to be the same as edit mode, although we also have
to handle face corner selections here.

Currently the code assumes that all boolean attributes should be
handled that way. I'm not sure of why that wouldn't be the case,
but if we ever need non-selection boolean attributes, that could
be supported too.

Differential Revision: https://developer.blender.org/D12488
2021-09-22 15:54:09 +02:00
83bdfba499 Cleanup: avoid passing redundant parameter 2021-09-22 15:54:09 +02:00
e31d6560a2 Nodes: refactor socket declarations
This commits adds a few common flags to `SocketDeclaration`
so that they are available for all socket types (hide label, hide
value, is multi input). This allows porting over the remaining
geometry nodes to the new declaration system.

Furthermore, this commit separates the concepts of the socket
declaration and corresponding builders. The builders are used
by nodes to declare which sockets they have (e.g. `FloatBuilder`).
The ready build socket declarations can then be consumed by
other systems such as the versioning code. Both use cases
need different APIs and those will change for independent reasons,
so it makes sense to separate the classes.
2021-09-22 15:54:09 +02:00
aeeb7c82c6 Gizmo: add flag to hide the gizmo group during interaction
This allows a hack to be removed that temporarily overwrote
the 3D views gizmo display flag.

Also reverse change from fb27a9bb98
that runs poll on modal gizmo groups as there is some risk
that the poll function unlinks the gizmo.
2021-09-22 15:54:09 +02:00
bb310ff14e Cleanup: unused variable 2021-09-22 15:54:09 +02:00
9d63273bf8 Fix T91421: Length modifier bake influence check.
Reviewed By: Antonio Vazquez (antoniov)

Differential Revision: https://developer.blender.org/D12496
2021-09-22 15:54:09 +02:00
1a677512b7 Fix Asset Browser cannot open containing file anymore
In {rB9cff9f9f5df0} asset_library was renamed → asset_library_ref.

Missed to update this in assets.py.

Differential Revision: https://developer.blender.org/D12497
2021-09-22 15:54:09 +02:00
6312f82324 Geometry Nodes: multi threaded field evaluation
This adds a new `ParallelMultiFunction` which wraps another multi-function
and evaluates it with multiple threads. The speeds up field evaluation
quite a bit (the effect is most noticeable when the number of evaluations
and the field is large).

There are still other single-threaded performance bottlenecks in field
evaluation that will need to be solved separately. Most notably here
is the process of copying the computed data into the position attribute
in the Set Position node.

Differential Revision: https://developer.blender.org/D12457
2021-09-22 15:54:09 +02:00
1f8eab534d Gizmo: show groups flagged with SHOW_MODAL_ALL during interaction
Follow up to fix for T73684,
which allowed some modal gizmos to hide all others.

Also resolve an issue from 917a972b56
where shear the shear gizmo would be visible during interaction.

Internally there are some changes to gizmo behavior

- The gizmo with modal interaction wont draw if it's poll function fails.
- The WM_GIZMOGROUPTYPE_DRAW_MODAL_ALL flag now causes these gizmo
  groups to draw when another group is being interacted with.
2021-09-22 15:54:09 +02:00
dea0dbc5ef Cleanup: replace defines with functions 2021-09-22 15:54:09 +02:00
0b8524c578 Cleanup: correct tracker ID in comment 2021-09-22 15:54:09 +02:00
8c61473869 GPencil: Dot dash modifier.
Create dot-dash effect for grease pencil strokes. User can manually edit the length, gap and styles for each segment of dashed lines.

The values in each segment can all be key-framed to make animations.

Reviewed By: Hans Goudey (HooglyBoogly), Antonio Vazquez (antoniov)

Differential Revision: http://developer.blender.org/D11876
2021-09-22 15:54:09 +02:00
4f65ad890b LineArt: Automatic crease with flat/smooth faces.
This allows crease lines to be automatically hidden on smooth surfaces, also provided options for:

- Showing crease on marked sharp edges.
- Force crease detection on smooth surfaces.

Reviewed By: Antonio Vazquez (antoniov)

Differential Revision: http://developer.blender.org/D12051
2021-09-22 15:54:09 +02:00
584b8a0def PyDocs: Update theme to latest version 2021-09-22 15:54:09 +02:00
47a7f02339 UI: Addition Changes to Freestyle Properties
- Material Properties: Use split column layout
- Remove the redundent term 'Options'
- Remove the redundent term 'Freesttle'
2021-09-22 15:54:09 +02:00
c0aa938931 Fix T89241: Scale to fit overflows into a second line 2021-09-22 15:54:09 +02:00
2aca22d60f Cleanup: spelling 2021-09-22 15:54:09 +02:00
926e839f80 Cleanup: doxy sections, parameter syntax 2021-09-22 15:54:09 +02:00
4ddce5f1c4 Fix: Use after free in spreadsheet attribute column ID
A temporary string was created in the attribute_foreach callback
and used in a map at a higher scope. When the callback finished,
the string went out of scope, was freed, then the elements in the
set pointed to freed memory.
2021-09-22 15:54:09 +02:00
Christoph Lendenfeld
7a373ecbf5 Fix T89027: "factor" field in pose breakdowner not updated
After applying the pose breakdowner,
the "factor" slider in the redo panel wasn't set to the correct value
This would cause the pose to jump around
once you start dragging the slider

Reviewed by: Sybren A. Stüvel
Differential Revision: https://developer.blender.org/D12187
Ref: D12187
2021-09-22 15:54:09 +02:00
5a8766180d LibLink: Enable unittest that was previously failing in append case.
Previous commit fixed it.
2021-09-22 15:54:09 +02:00
cef3d4225c LibLink: New Append code.
This commit fully refactors the way linked IDs are made local when
appended.

Previously, `BKE_library_make_local` was (ab)used for this task, but it
was missing some contextual data and doing complex processing to try to
work around this, with limited sucess. Further more, it was nearly
impossibe to extend (e.g. to get new append behaviors necessary for the
asset project).

The new code is a dedicated append step in WM linking process.

NOTE: BPY API (`libray.load()` context manager) uses its own code here,
which still relies on `BKE_library_make_local` for appending.
Unfortunately, merging those two different code paths is not trivial so
for now this API will remain unchanged.

Fix T55629: Append already linked Data is impossible.
2021-09-22 15:54:09 +02:00
abe1665569 ID management: Add new version of relink_to_newid using proper new remapping code.
Current `BKE_libblock_relink_to_newid` is using its own simplistic,
limited and not really correct version of ID remapping.

While doing a full replacement would have been ideal, this is
risky/time-constrained for Blender 3.0 release, so for now we'll have
both versions co-existing.
2021-09-22 15:54:09 +02:00
86761e4950 Cleanup: fix inconsistent parameter name
Found by clang-tidy.
2021-09-22 15:54:09 +02:00
494469897c Nodes: cache node declaration on node
Previously, it was necessary to rebuild the node declaration
every time it was used. Now it is cached per node for easy
and fast access.

For more details on what this is, look at the comment in
`DNA_node_types.h`.

Differential Revision: https://developer.blender.org/D12471
2021-09-22 15:54:09 +02:00
205ccb8bbe Cleanup: simplify resource scope methods
Previously, a debug name had to be passed to all methods
that added a resource to the `ResourceScope`. The idea was
that this would make it easier to find certain bugs. In reality
I never found this to be useful, and it was mostly annoying.
The thing is, something that is in a resource scope never leaks
(unless the resource scope is not destructed of course).

Removing the name parameter makes the structure easier to use.
2021-09-22 15:54:09 +02:00
cbd43cedc3 Fix: use type name instead of variable name
That was a typo in rBfd60f6713a9d9e6f7d706b53bf1311f2f1cd9031.
2021-09-22 15:54:09 +02:00
975d21a1a2 Functions: support optional outputs in multi-function
Sometimes not all outputs of a multi-function are required by the
caller. In those cases it would be a waste of compute resources
to calculate the unused values anyway. Now, the caller of a
multi-function can specify when a specific output is not used.
The called function can check if an output is unused and may
ignore it. Multi-functions can still computed unused outputs as
before if they don't want to check if a specific output is unused.

The multi-function procedure system has been updated to support
ignored outputs in call instructions. An ignored output just has no
variable assigned to it.

The field system has been updated to generate a multi-function
procedure where unused outputs are ignored.
2021-09-22 15:54:08 +02:00
14af051591 Geometry Nodes: fix memory leak for multi input sockets 2021-09-22 15:54:08 +02:00
52ee98859d Fix T90862: Texts in Outliner can have wrong icon
In contrast to the Filebrowser, the Outliner (Blender File view) did not
distinguish icons for text-based formats (if they have a filepath this
can be done though).

Maniphest Tasks: T90862

Differential Revision: https://developer.blender.org/D12347
2021-09-22 15:54:08 +02:00
c1e21847b9 Doc: expand on comment for why bound-box access could cause issues 2021-09-22 15:54:08 +02:00
296814ab92 UI: keep navigation gizmos visible during modal operators
Hiding viewport navigation gizmos caused the UI to "flicker"
unnecessarily, the axis could also be useful as a reference.

Resolves T73684
2021-09-22 15:54:08 +02:00
0da8a60a37 Update RNA to User Manual Mappings 2021-09-22 15:54:08 +02:00
667e24d8a0 Asset Template: Extra UI options
This allow users to show/hide:
* Library name / refresh.
* Assets names.
* Filter.

To set them in Python use:
display_options={'NO_NAMES', 'NO_FILTER', 'NO_LIBRARY'}

With contributions by Julian Eisel.

Differential Revision: https://developer.blender.org/D12476
2021-09-22 15:54:08 +02:00
84d5be6993 Cleanup: Remove duplicate code
Class SEQUENCER_PT_overlay as defined twice.
2021-09-22 15:54:08 +02:00
Germano Cavalcante
42aaff79db Fix T90736: Problem applying scale to curves
Curve Points of handle of type `Auto` on curves not uniformly scaled
cause the shape of the curve to be modified after applying the scale.

So change these handles to `Aligned` in these cases.

Reviewed By: campbellbarton

Maniphest Tasks: T90736

Differential Revision: https://developer.blender.org/D12281
2021-09-22 15:54:08 +02:00
0647f4f511 Cleanup: Remove unused variable 2021-09-15 01:50:42 +02:00
a4b39da6c7 UI: Use right-arrow icon for sub menus 2021-09-15 01:47:47 +02:00
ae42e4be1d UI: Match subpanels look with regular panels
By having coloured headers and offset the background.

TODO: Add margin to the bottom on the last subpanel.
2021-09-15 01:47:35 +02:00
8085f1e320 Merge branch 'master' into temp-ui-tweaks 2021-09-13 16:54:18 +02:00
cb23adf94b Merge branch 'master' into temp-ui-tweaks 2021-09-06 14:06:25 +02:00
ba7f03c1bb UI: Align panel titles
WIP: Experiment with shifting the panel titles slightly to the right
matching panels with checkboxes/icons in the header.
2021-09-03 20:06:43 +02:00
e262b00918 UI: Make panel titles text size same as labels
With panels now being more defined boxes, having a different size for the
panel title adds considerable noise.
2021-09-03 20:04:57 +02:00
48c2c7b1b4 UI: Dim collapse/expand icon on panels 2021-09-03 20:03:29 +02:00
83b342fd91 UI: Less prominent drag widget on panels
* Use 2 rows of 3 boxes per row, instead of 4.
* Slightly smaller
* Dimmer
2021-09-03 20:02:50 +02:00
18a3b9b238 Merge branch 'master' into temp-ui-tweaks 2021-09-03 16:39:01 +02:00
870404455b UI: Add margin to panels
Add some breathing space between the panel boundaries and properties/regions.

Make use of the style->panelouter property that hasn't been used in a while.
Also slight tweaks to boxspace and templatespace style properties so they
are multiples of 2 and operations on them round better.
2021-08-28 02:21:07 +02:00
323997ace3 UI: Disable emboss on box widgets
These are meant to be contour for an area flush with the background,
having emboss hardcoded on the widget prevents this.
2021-08-28 01:48:55 +02:00
72003be8fb Fix stack buffer overflow asan warning 2021-08-27 14:59:55 -05:00
82323cafb9 UI: Fix dark and light themes
Mainly so it doesn't look broken to people testing out the branch, namely
the background of radio buttons was pure white, and separator in menus pure black.

Also minor tweaks to the default theme.
2021-08-27 20:57:26 +02:00
7e4af18960 UI: Use rounded corners for panels and subpanels 2021-08-24 19:27:25 +02:00
f3b2cbcb81 UI: Separate each choice inside radio buttons
Add some room between the choices. This way we can give the background and
non-active options the same color and make it look more like only one choice
can be active at a time.

This is in an effort to make the radio buttons and toggle buttons look different.
Currently in Blender they looked the same even though radio buttons only allow
one active option at a time, while toggles can be have multiple.
2021-08-24 18:54:20 +02:00
811dc12e34 UI: Make use of menu item theme roundness
Use theme preference instead of hardcoded square corners.
2021-08-24 02:48:43 +02:00
1cba89572f UI: Use Outline color of menu item for separator
Instead of forcing a transparent shadeof the text color.
2021-08-24 02:46:43 +02:00
ad12ff5376 UI: Adjust outline color of active default buttons
Simply darken slightly the already used outline color. On light themes it prevents too bright outlines on hover.
2021-08-24 02:31:27 +02:00
49777cb729 UI: Support alpha in Value Slider widget
The alpha value was being ignored even though the item property could be set.
2021-08-24 02:13:32 +02:00
a64d281528 UI: Do not rotate vertical scale indicators
In animation editors with vertical scale indicators, such as Graph Editor
or Drivers, display the values aligned to the view.
2021-08-24 02:03:07 +02:00
b9fa39c8e9 UI: Improve contrast on playhead
Add a dark (background coloured) outline around it.
2021-08-20 03:13:24 +02:00
a62ca11d7f UI: Use arrow icon to collapse/expand panels 2021-08-20 00:48:26 +02:00
13 changed files with 284 additions and 184 deletions

View File

@@ -62,11 +62,11 @@ const bTheme U_theme_default = {
.roundness = 0.2f,
},
.wcol_radio = {
.outline = RGBA(0x373737ff),
.inner = RGBA(0x595959ff),
.inner_sel = RGBA(0x5680c2e6),
.item = RGBA(0xffffffff),
.text = RGBA(0xe6e6e6ff),
.outline = RGBA(0x2c2c2cff),
.inner = RGBA(0x2c2c2cff),
.inner_sel = RGBA(0x476da3ff),
.item = RGBA(0x2c2c2cff),
.text = RGBA(0xccccccff),
.text_sel = RGBA(0xffffffff),
.shadetop = 5,
.shadedown = -5,
@@ -74,9 +74,9 @@ const bTheme U_theme_default = {
},
.wcol_option = {
.outline = RGBA(0x373737ff),
.inner = RGBA(0x666666ff),
.inner_sel = RGBA(0x5680c2e6),
.item = RGBA(0xffffffff),
.inner = RGBA(0x1f1f1fff),
.inner_sel = RGBA(0x71a8ffe6),
.item = RGBA(0x1f1f1fff),
.text = RGBA(0xe6e6e6ff),
.text_sel = RGBA(0xffffffff),
.shadedown = -15,
@@ -84,8 +84,8 @@ const bTheme U_theme_default = {
},
.wcol_toggle = {
.outline = RGBA(0x373737ff),
.inner = RGBA(0x595959ff),
.inner_sel = RGBA(0x5680c2e6),
.inner = RGBA(0x2c2c2cff),
.inner_sel = RGBA(0x476da3ff),
.item = RGBA(0x191919ff),
.text = RGBA(0xe6e6e6ff),
.text_sel = RGBA(0xffffffff),
@@ -93,8 +93,8 @@ const bTheme U_theme_default = {
},
.wcol_num = {
.outline = RGBA(0x444444ff),
.inner = RGBA(0x595959ff),
.inner_sel = RGBA(0x505050ff),
.inner = RGBA(0x4f4f4fff),
.inner_sel = RGBA(0x1f1f1fff),
.item = RGBA(0x191919ff),
.text = RGBA(0xe6e6e6ff),
.text_sel = RGBA(0xffffffff),
@@ -102,9 +102,9 @@ const bTheme U_theme_default = {
},
.wcol_numslider = {
.outline = RGBA(0x444444ff),
.inner = RGBA(0x595959ff),
.inner = RGBA(0x2c2c2cff),
.inner_sel = RGBA(0x505050ff),
.item = RGBA(0x5680c2e6),
.item = RGBA(0x5680c2ff),
.text = RGBA(0xe6e6e6ff),
.text_sel = RGBA(0xffffffff),
.shaded = 1,
@@ -112,9 +112,9 @@ const bTheme U_theme_default = {
.roundness = 0.2f,
},
.wcol_tab = {
.outline = RGBA(0x202020ff),
.inner = RGBA(0x2b2b2bff),
.inner_sel = RGBA(0x424242ff),
.outline = RGBA(0x1a1a1aff),
.inner = RGBA(0x1a1a1aff),
.inner_sel = RGBA(0x2e2e2eff),
.item = RGBA(0x2d2d2dff),
.text = RGBA(0x989898ff),
.text_sel = RGBA(0xffffffff),
@@ -123,7 +123,7 @@ const bTheme U_theme_default = {
.wcol_menu = {
.outline = RGBA(0x444444ff),
.inner = RGBA(0x2c2c2cff),
.inner_sel = RGBA(0x696e76ff),
.inner_sel = RGBA(0x476da3ff),
.item = RGBA(0xd9d9d9ff),
.text = RGBA(0xd9d9d9ff),
.text_sel = RGBA(0xffffffff),
@@ -133,8 +133,8 @@ const bTheme U_theme_default = {
},
.wcol_pulldown = {
.outline = RGBA(0x4d4d4dff),
.inner = RGBA(0x2e2e2ecc),
.inner_sel = RGBA(0x5680c2e6),
.inner = RGBA(0x00000033),
.inner_sel = RGBA(0x476da3ff),
.item = RGBA(0x727272ff),
.text = RGBA(0xd9d9d9ff),
.text_sel = RGBA(0xffffffff),
@@ -144,7 +144,7 @@ const bTheme U_theme_default = {
},
.wcol_menu_back = {
.outline = RGBA(0x19191aff),
.inner = RGBA(0x1f1f1fef),
.inner = RGBA(0x1a1a1aff),
.inner_sel = RGBA(0x585858ff),
.item = RGBA(0x727272ff),
.text = RGBA(0xa5a5a5ff),
@@ -154,7 +154,8 @@ const bTheme U_theme_default = {
.roundness = 0.2f,
},
.wcol_menu_item = {
.inner_sel = RGBA(0x5680c2e6),
.outline = RGBA(0x37373700),
.inner_sel = RGBA(0x476da3ff),
.item = RGBA(0xffffff8f),
.text = RGBA(0xe6e6e6ff),
.text_sel = RGBA(0xffffffff),
@@ -173,7 +174,7 @@ const bTheme U_theme_default = {
.roundness = 0.2f,
},
.wcol_box = {
.outline = RGBA(0x444444ff),
.outline = RGBA(0x262626ff),
.inner = RGBA(0x00000033),
.inner_sel = RGBA(0x696e76ff),
.item = RGBA(0x191919ff),
@@ -237,7 +238,7 @@ const bTheme U_theme_default = {
.widget_emboss = RGBA(0x00000026),
.menu_shadow_fac = 0.3f,
.menu_shadow_width = 4,
.editor_outline = RGBA(0x1f1f1fff),
.editor_outline = RGBA(0x1a1a1aff),
.transparent_checker_primary = RGBA(0x333333ff),
.transparent_checker_secondary = RGBA(0x262626ff),
.transparent_checker_size = 8,
@@ -262,11 +263,11 @@ const bTheme U_theme_default = {
.icon_folder = RGBA(0xe3c16eff),
},
.space_properties = {
.back = RGBA(0x42424200),
.back = RGBA(0x2e2e2e00),
.title = RGBA(0xd4d4d4ff),
.text = RGBA(0xe6e6e6ff),
.text_hi = RGBA(0xffffffff),
.header = RGBA(0x424242ff),
.header = RGBA(0x2e2e2eff),
.header_text = RGBA(0xeeeeeeff),
.header_text_hi = RGBA(0xffffffff),
.tab_active = RGBA(0x4b4b4bff),
@@ -277,24 +278,24 @@ const bTheme U_theme_default = {
.button_title = RGBA(0xffffffff),
.button_text = RGBA(0xe5e5e5ff),
.button_text_hi = RGBA(0xffffffff),
.navigation_bar = RGBA(0x232323ff),
.navigation_bar = RGBA(0x1a1a1aff),
.panelcolors = {
.header = RGBA(0x424242ff),
.header = RGBA(0x383838ff),
.back = RGBA(0x383838ff),
.sub_back = RGBA(0x00000024),
.sub_back = RGBA(0x0000003e),
},
.active = RGBA(0x5680c2ff),
.vertex_size = 3,
.outline_width = 1,
.facedot_size = 4,
.match = RGBA(0x5680c2ff),
.active = RGBA(0x5680c2ff),
},
.space_view3d = {
.back = RGBA(0x393939ff),
.back = RGBA(0x2c2c2cff),
.title = RGBA(0xeeeeeeff),
.text = RGBA(0xe6e6e6ff),
.text_hi = RGBA(0xffffffff),
.header = RGBA(0x42424200),
.header = RGBA(0x2e2e2e00),
.header_text = RGBA(0xeeeeeeff),
.header_text_hi = RGBA(0xffffffff),
.tab_active = RGBA(0x4b4b4bff),
@@ -306,8 +307,8 @@ const bTheme U_theme_default = {
.button_text = RGBA(0xe5e5e5ff),
.button_text_hi = RGBA(0xffffffff),
.panelcolors = {
.header = RGBA(0x424242e6),
.back = RGBA(0x333333f0),
.header = RGBA(0x383838ff),
.back = RGBA(0x383838ff),
.sub_back = RGBA(0x0000003e),
},
.grid = RGBA(0x6666664d),
@@ -398,8 +399,8 @@ const bTheme U_theme_default = {
.button_text_hi = RGBA(0xffffffff),
.execution_buts = RGBA(0x444444ff),
.panelcolors = {
.header = RGBA(0x4b4b4bff),
.back = RGBA(0x404040ff),
.header = RGBA(0x383838ff),
.back = RGBA(0x383838ff),
.sub_back = RGBA(0x0000003e),
},
.hilite = RGBA(0x4f76b3ff),
@@ -429,8 +430,8 @@ const bTheme U_theme_default = {
.list_text = RGBA(0xb8b8b8ff),
.list_text_hi = RGBA(0xffaf29ff),
.panelcolors = {
.header = RGBA(0x424242cc),
.back = RGBA(0x333333b3),
.header = RGBA(0x383838ff),
.back = RGBA(0x383838ff),
.sub_back = RGBA(0x0000003e),
},
.shade1 = RGBA(0x96969600),
@@ -480,8 +481,8 @@ const bTheme U_theme_default = {
.button_text = RGBA(0xe5e5e5ff),
.button_text_hi = RGBA(0xffffffff),
.panelcolors = {
.header = RGBA(0x424242cc),
.back = RGBA(0x333333b3),
.header = RGBA(0x383838ff),
.back = RGBA(0x383838ff),
.sub_back = RGBA(0x0000003e),
},
.vertex_size = 3,
@@ -523,8 +524,8 @@ const bTheme U_theme_default = {
.list_text = RGBA(0xb8b8b8ff),
.list_text_hi = RGBA(0xffaf29ff),
.panelcolors = {
.header = RGBA(0x424242cc),
.back = RGBA(0x333333b3),
.header = RGBA(0x383838ff),
.back = RGBA(0x383838ff),
.sub_back = RGBA(0x0000003e),
},
.shade1 = RGBA(0xc0c0c000),
@@ -583,8 +584,8 @@ const bTheme U_theme_default = {
.list_text = RGBA(0xb8b8b8ff),
.list_text_hi = RGBA(0xffaf29ff),
.panelcolors = {
.header = RGBA(0x424242cc),
.back = RGBA(0x333333b3),
.header = RGBA(0x383838ff),
.back = RGBA(0x383838ff),
.sub_back = RGBA(0x0000003e),
},
.shade1 = RGBA(0x96969600),
@@ -633,8 +634,8 @@ const bTheme U_theme_default = {
.button_text = RGBA(0xe5e5e5ff),
.button_text_hi = RGBA(0xffffffff),
.panelcolors = {
.header = RGBA(0x424242cc),
.back = RGBA(0x333333b3),
.header = RGBA(0x383838ff),
.back = RGBA(0x383838ff),
.sub_back = RGBA(0x0000003e),
},
.shade1 = RGBA(0xa0a0a000),
@@ -663,16 +664,16 @@ const bTheme U_theme_default = {
.selected_strip = RGBA(0xff8f0dff),
.gp_vertex_size = 3,
.gp_vertex_select = RGBA(0xff8500ff),
.row_alternate = RGBA(0xffffff0d),
.anim_preview_range = RGBA(0xa14d0066),
.metadatatext = RGBA(0xffffffff),
.row_alternate = RGBA(0xffffff0d),
},
.space_image = {
.back = RGBA(0x44444400),
.back = RGBA(0x2e2e2e00),
.title = RGBA(0xeeeeeeff),
.text = RGBA(0xe6e6e6ff),
.text_hi = RGBA(0xffffffff),
.header = RGBA(0x424242ff),
.header = RGBA(0x2e2e2eff),
.header_text = RGBA(0xeeeeeeff),
.header_text_hi = RGBA(0xffffffff),
.tab_active = RGBA(0x4b4b4bff),
@@ -684,8 +685,8 @@ const bTheme U_theme_default = {
.button_text = RGBA(0xe5e5e5ff),
.button_text_hi = RGBA(0xffffffff),
.panelcolors = {
.header = RGBA(0x424242cc),
.back = RGBA(0x333333b3),
.header = RGBA(0x383838ff),
.back = RGBA(0x383838ff),
.sub_back = RGBA(0x0000003e),
},
.grid = RGBA(0x505050ff),
@@ -738,8 +739,8 @@ const bTheme U_theme_default = {
.button_text = RGBA(0xe5e5e5ff),
.button_text_hi = RGBA(0xffffffff),
.panelcolors = {
.header = RGBA(0x42424200),
.back = RGBA(0x333333b3),
.header = RGBA(0x383838ff),
.back = RGBA(0x383838ff),
.sub_back = RGBA(0x0000003e),
},
.shade2 = RGBA(0x5680c2e6),
@@ -759,11 +760,11 @@ const bTheme U_theme_default = {
.line_numbers = RGBA(0xd0d0d0ff),
},
.space_outliner = {
.back = RGBA(0x28282800),
.back = RGBA(0x25252500),
.title = RGBA(0xffffffff),
.text = RGBA(0xc3c3c3ff),
.text_hi = RGBA(0xffffffff),
.header = RGBA(0x454545ff),
.header = RGBA(0x282828ff),
.header_text = RGBA(0xeeeeeeff),
.header_text_hi = RGBA(0xffffffff),
.tab_active = RGBA(0x4b4b4bff),
@@ -775,34 +776,34 @@ const bTheme U_theme_default = {
.button_text = RGBA(0xe5e5e5ff),
.button_text_hi = RGBA(0xffffffff),
.panelcolors = {
.header = RGBA(0x424242cc),
.back = RGBA(0x333333b3),
.header = RGBA(0x383838ff),
.back = RGBA(0x383838ff),
.sub_back = RGBA(0x0000003e),
},
.active = RGBA(0x3b5689ff),
.active = RGBA(0x4d341fff),
.vertex_size = 3,
.outline_width = 1,
.facedot_size = 4,
.match = RGBA(0x337f334c),
.selected_highlight = RGBA(0x223a5bff),
.match = RGBA(0x1466144c),
.selected_highlight = RGBA(0x4d433eff),
.selected_object = RGBA(0xe96a00ff),
.active_object = RGBA(0xffaf29ff),
.edited_object = RGBA(0x00806266),
.row_alternate = RGBA(0xffffff07),
.row_alternate = RGBA(0xffffff05),
},
.space_node = {
.back = RGBA(0x23232300),
.title = RGBA(0xeeeeeeff),
.text = RGBA(0xe6e6e6ff),
.text_hi = RGBA(0xffffffff),
.header = RGBA(0x424242ff),
.header = RGBA(0x2e2e2eff),
.header_text = RGBA(0xeeeeeeff),
.header_text_hi = RGBA(0xffffffff),
.tab_active = RGBA(0x4b4b4bff),
.tab_inactive = RGBA(0x2b2b2bff),
.tab_back = RGBA(0x232323ff),
.tab_outline = RGBA(0x232323ff),
.button = RGBA(0x42424200),
.button = RGBA(0x232323ff),
.button_title = RGBA(0xffffffff),
.button_text = RGBA(0xe5e5e5ff),
.button_text_hi = RGBA(0xffffffff),
@@ -811,8 +812,8 @@ const bTheme U_theme_default = {
.list_text = RGBA(0xccccccff),
.list_text_hi = RGBA(0xffffffff),
.panelcolors = {
.header = RGBA(0x424242cc),
.back = RGBA(0x333333b3),
.header = RGBA(0x383838ff),
.back = RGBA(0x383838ff),
.sub_back = RGBA(0x0000003e),
},
.shade2 = RGBA(0x7f707064),
@@ -851,11 +852,11 @@ const bTheme U_theme_default = {
.gp_vertex_select = RGBA(0xff8500ff),
},
.space_preferences = {
.back = RGBA(0x42424200),
.title = RGBA(0xeeeeeeff),
.back = RGBA(0x2e2e2e00),
.title = RGBA(0xd4d4d4ff),
.text = RGBA(0xe6e6e6ff),
.text_hi = RGBA(0xffffffff),
.header = RGBA(0x424242ff),
.header = RGBA(0x2e2e2eff),
.header_text = RGBA(0xeeeeeeff),
.header_text_hi = RGBA(0xffffffff),
.tab_active = RGBA(0x4b4b4bff),
@@ -866,11 +867,11 @@ const bTheme U_theme_default = {
.button_title = RGBA(0xffffffff),
.button_text = RGBA(0xe5e5e5ff),
.button_text_hi = RGBA(0xffffffff),
.navigation_bar = RGBA(0x4b4b4bff),
.execution_buts = RGBA(0x4b4b4bff),
.navigation_bar = RGBA(0x383838ff),
.execution_buts = RGBA(0x383838ff),
.panelcolors = {
.header = RGBA(0x42424200),
.back = RGBA(0x333333b3),
.header = RGBA(0x383838ff),
.back = RGBA(0x383838ff),
.sub_back = RGBA(0x0000003e),
},
.vertex_size = 3,
@@ -894,8 +895,8 @@ const bTheme U_theme_default = {
.button_text = RGBA(0xe5e5e5ff),
.button_text_hi = RGBA(0xffffffff),
.panelcolors = {
.header = RGBA(0x424242cc),
.back = RGBA(0x333333b3),
.header = RGBA(0x383838ff),
.back = RGBA(0x383838ff),
.sub_back = RGBA(0x0000003e),
},
.console_output = RGBA(0x71a8ffff),
@@ -928,8 +929,8 @@ const bTheme U_theme_default = {
.list_text = RGBA(0x000000ff),
.list_text_hi = RGBA(0xffffffff),
.panelcolors = {
.header = RGBA(0x424242cc),
.back = RGBA(0x333333b3),
.header = RGBA(0x383838ff),
.back = RGBA(0x383838ff),
.sub_back = RGBA(0x0000003e),
},
.grid = RGBA(0x424242ff),
@@ -961,11 +962,11 @@ const bTheme U_theme_default = {
.metadatatext = RGBA(0xffffffff),
},
.space_topbar = {
.back = RGBA(0x42424200),
.back = RGBA(0x1a1a1a00),
.title = RGBA(0xffffffff),
.text = RGBA(0xe6e6e6ff),
.text_hi = RGBA(0xffffffff),
.header = RGBA(0x232323ff),
.header = RGBA(0x1a1a1aff),
.header_text = RGBA(0xeeeeeeff),
.header_text_hi = RGBA(0xffffffff),
.tab_active = RGBA(0x4b4b4bff),
@@ -977,8 +978,8 @@ const bTheme U_theme_default = {
.button_text = RGBA(0xe5e5e5ff),
.button_text_hi = RGBA(0xffffffff),
.panelcolors = {
.header = RGBA(0x424242cc),
.back = RGBA(0x333333b3),
.header = RGBA(0x383838ff),
.back = RGBA(0x383838ff),
.sub_back = RGBA(0x0000003e),
},
.vertex_size = 3,
@@ -987,12 +988,12 @@ const bTheme U_theme_default = {
.gp_vertex_size = 3,
},
.space_statusbar = {
.back = RGBA(0x2e2e2e00),
.back = RGBA(0x1a1a1a00),
.title = RGBA(0xffffffff),
.text = RGBA(0x838383ff),
.text_hi = RGBA(0xffffffff),
.header = RGBA(0x303030ff),
.header_text = RGBA(0xaaaaaaff),
.header = RGBA(0x1a1a1aff),
.header_text = RGBA(0x696969ff),
.header_text_hi = RGBA(0xffffffff),
.tab_active = RGBA(0x4b4b4bff),
.tab_inactive = RGBA(0x2b2b2bff),
@@ -1001,8 +1002,8 @@ const bTheme U_theme_default = {
.button = RGBA(0x353535ff),
.button_text_hi = RGBA(0xffffffff),
.panelcolors = {
.header = RGBA(0x424242cc),
.back = RGBA(0x333333b3),
.header = RGBA(0x383838ff),
.back = RGBA(0x383838ff),
.sub_back = RGBA(0x0000003e),
},
.vertex_size = 3,
@@ -1026,11 +1027,16 @@ const bTheme U_theme_default = {
.button_title = RGBA(0xffffffff),
.button_text = RGBA(0xe5e5e5ff),
.button_text_hi = RGBA(0xffffffff),
.list = RGBA(0x424242ff),
.list_title = RGBA(0xc3c3c3ff),
.list_text = RGBA(0xc3c3c3ff),
.list_text_hi = RGBA(0x00ffffff),
.panelcolors = {
.header = RGBA(0x424242cc),
.back = RGBA(0x333333b3),
.header = RGBA(0x383838ff),
.back = RGBA(0x383838ff),
.sub_back = RGBA(0x0000003e),
},
.hilite = RGBA(0x80808080),
.active = RGBA(0x3b5689ff),
.vertex_size = 3,
.outline_width = 1,
@@ -1041,11 +1047,6 @@ const bTheme U_theme_default = {
.active_object = RGBA(0xffaf29ff),
.edited_object = RGBA(0x00806266),
.row_alternate = RGBA(0xffffff07),
.list = RGBA(0x424242ff),
.list_title = RGBA(0xc3c3c3ff),
.list_text = RGBA(0xc3c3c3ff),
.list_text_hi = RGBA(0xffffff),
.hilite = RGBA(0x80808080),
},
.tarm = {
{

View File

@@ -77,10 +77,10 @@
</wcol_toolbar_item>
<wcol_radio>
<ThemeWidgetColors
outline="#434343"
outline="#3b3b3b"
inner="#3b3b3bff"
inner_sel="#5680c2e6"
item="#ffffffff"
item="#3b3b3bff"
text="#d9d9d9"
text_sel="#ffffff"
show_shaded="FALSE"
@@ -257,7 +257,7 @@
</wcol_tooltip>
<wcol_menu_item>
<ThemeWidgetColors
outline="#000000"
outline="#a6a6a6"
inner="#00000000"
inner_sel="#5680c2e6"
item="#ffffff8f"
@@ -879,7 +879,7 @@
>
<panelcolors>
<ThemePanelColors
header="#b3b3b300"
header="#a3a3a3cc"
back="#a3a3a3cc"
sub_back="#00000024"
>
@@ -1054,17 +1054,17 @@
<ThemeInfo
info_selected="#6080ff"
info_selected_text="#000000"
info_error="#FF0038ff"
info_error="#ff0038ff"
info_error_text="#000000"
info_warning="#FFE900ff"
info_warning="#ffe900ff"
info_warning_text="#000000"
info_info="#0068B3ff"
info_info="#0068b3ff"
info_info_text="#000000"
info_debug="#B30095ff"
info_debug="#b30095ff"
info_debug_text="#000000"
info_property="#44B300ff"
info_property="#44b300ff"
info_property_text="#000000"
info_operator="#44B300ff"
info_operator="#44b300ff"
info_operator_text="#000000"
>
<space>
@@ -1350,6 +1350,15 @@
</panelcolors>
</ThemeSpaceGeneric>
</space>
<space_list>
<ThemeSpaceListGeneric
list="#424242"
list_title="#c3c3c3"
list_text="#c3c3c3"
list_text_hi="#00ffff"
>
</ThemeSpaceListGeneric>
</space_list>
</ThemeSpreadsheet>
</spreadsheet>
<bone_color_sets>

View File

@@ -101,6 +101,7 @@ static void draw_current_frame(const Scene *scene,
float text_width = UI_fontstyle_string_width(fstyle, frame_str);
float box_width = MAX2(text_width + 8 * UI_DPI_FAC, 24 * UI_DPI_FAC);
float box_padding = 3 * UI_DPI_FAC;
float outline = 1 * UI_DPI_FAC;
float bg_color[4];
UI_GetThemeColorShade4fv(TH_CFRAME, -5, bg_color);

View File

@@ -241,7 +241,7 @@ enum {
#define UI_DEFAULT_TEXT_POINTS 11
/* Larger size used for title text. */
#define UI_DEFAULT_TITLE_POINTS 12
#define UI_DEFAULT_TITLE_POINTS 11
#define UI_PANEL_WIDTH 340
#define UI_COMPACT_PANEL_WIDTH 160
@@ -252,6 +252,7 @@ enum {
#define UI_PANEL_CATEGORY_MARGIN_WIDTH (U.widget_unit * 1.0f)
#define UI_PANEL_BOX_STYLE_MARGIN (U.widget_unit * 0.2f)
#define UI_PANEL_LABEL_OFFSET (U.widget_unit * 2.0f)
/* but->drawflag - these flags should only affect how the button is drawn. */
/* NOTE: currently, these flags *are not passed* to the widget's state() or draw() functions

View File

@@ -2015,7 +2015,7 @@ static void ui_but_to_pixelrect(rcti *rect, const ARegion *region, uiBlock *bloc
/* uses local copy of style, to scale things down, and allow widgets to change stuff */
void UI_block_draw(const bContext *C, uiBlock *block)
{
uiStyle style = *UI_style_get_dpi(); /* XXX pass on as arg */
const uiStyle *style = UI_style_get_dpi(); /* XXX pass on as arg */
/* get menu region or area region */
ARegion *region = CTX_wm_menu(C);
@@ -2031,10 +2031,10 @@ void UI_block_draw(const bContext *C, uiBlock *block)
GPU_blend(GPU_BLEND_ALPHA);
/* scale fonts */
ui_fontscale(&style.paneltitle.points, block->aspect);
ui_fontscale(&style.grouplabel.points, block->aspect);
ui_fontscale(&style.widgetlabel.points, block->aspect);
ui_fontscale(&style.widget.points, block->aspect);
ui_fontscale(&style->paneltitle.points, block->aspect);
ui_fontscale(&style->grouplabel.points, block->aspect);
ui_fontscale(&style->widgetlabel.points, block->aspect);
ui_fontscale(&style->widget.points, block->aspect);
/* scale block min/max to rect */
rcti rect;
@@ -2052,10 +2052,10 @@ void UI_block_draw(const bContext *C, uiBlock *block)
ui_draw_pie_center(block);
}
else if (block->flag & UI_BLOCK_POPOVER) {
ui_draw_popover_back(region, &style, block, &rect);
ui_draw_popover_back(region, style, block, &rect);
}
else if (block->flag & UI_BLOCK_LOOP) {
ui_draw_menu_back(&style, block, &rect);
ui_draw_menu_back(style, block, &rect);
}
else if (block->panel) {
bool show_background = region->alignment != RGN_ALIGN_FLOAT;
@@ -2070,8 +2070,14 @@ void UI_block_draw(const bContext *C, uiBlock *block)
show_background = region->overlap != 0;
}
}
if (block->panel->type->parent != NULL) {
rect.xmin += style->panelouter;
}
rect.xmin += style->panelouter;
}
ui_draw_aligned_panel(&style,
ui_draw_aligned_panel(style,
block,
&rect,
UI_panel_category_is_visible(region),
@@ -2091,7 +2097,7 @@ void UI_block_draw(const bContext *C, uiBlock *block)
/* XXX: figure out why invalid coordinates happen when closing render window */
/* and material preview is redrawn in main window (temp fix for bug T23848) */
if (rect.xmin < rect.xmax && rect.ymin < rect.ymax) {
ui_draw_but(C, region, &style, but, &rect);
ui_draw_but(C, region, style, but, &rect);
}
}
}

View File

@@ -116,7 +116,8 @@ extern const char ui_radial_dir_to_numpad[8];
extern const short ui_radial_dir_to_angle[8];
/* internal panel drawing defines */
#define PNL_HEADER (UI_UNIT_Y * 1.2) /* 24 default */
#define PNL_HEADER (UI_UNIT_Y * 1.25) /* 24 default */
#define PNL_CNR_RAD (UI_UNIT_Y * 0.25f)
/* bit button defines */
/* Bit operations */

View File

@@ -1075,13 +1075,14 @@ void UI_panels_draw(const bContext *C, ARegion *region)
void UI_panel_label_offset(const uiBlock *block, int *r_x, int *r_y)
{
Panel *panel = block->panel;
const uiStyle *style = UI_style_get();
const bool is_subpanel = (panel->type && panel->type->parent);
*r_x = UI_UNIT_X * 1.0f;
*r_x = UI_UNIT_X * 1.0f + style->panelouter + U.pixelsize;
*r_y = UI_UNIT_Y * 1.5f;
if (is_subpanel) {
*r_x += (0.7f * UI_UNIT_X);
*r_x += style->panelouter;
}
}
@@ -1119,15 +1120,15 @@ static void panel_draw_highlight_border(const Panel *panel,
}
float radius;
UI_draw_roundbox_corner_set(UI_CNR_ALL);
if (draw_box_style) {
/* Use the theme for box widgets. */
const uiWidgetColors *box_wcol = &UI_GetTheme()->tui.wcol_box;
UI_draw_roundbox_corner_set(UI_CNR_ALL);
radius = box_wcol->roundness * U.widget_unit;
}
else {
UI_draw_roundbox_corner_set(UI_CNR_NONE);
radius = 0.0f;
radius = PNL_CNR_RAD;
}
float color[4];
@@ -1160,15 +1161,17 @@ static void panel_draw_aligned_widgets(const uiStyle *style,
/* Offset triangle and text to the right for subpanels. */
const rcti widget_rect = {
.xmin = header_rect->xmin + (is_subpanel ? scaled_unit * 0.7f : 0),
.xmin = header_rect->xmin,
.xmax = header_rect->xmax,
.ymin = header_rect->ymin,
.ymax = header_rect->ymax,
};
uchar title_color[4];
uchar collapse_icon_color[4];
panel_title_color_get(panel, show_background, region_search_filter_active, title_color);
title_color[3] = 255;
copy_v4_uchar(collapse_icon_color, *title_color);
collapse_icon_color[3] = 100;
/* Draw collapse icon. */
{
@@ -1180,16 +1183,22 @@ static void panel_draw_aligned_widgets(const uiStyle *style,
};
BLI_rctf_scale(&collapse_rect, 0.25f);
float triangle_color[4];
rgba_uchar_to_float(triangle_color, title_color);
ui_draw_anti_tria_rect(&collapse_rect, UI_panel_is_closed(panel) ? 'h' : 'v', triangle_color);
GPU_blend(GPU_BLEND_ALPHA);
UI_icon_draw_ex(collapse_rect.xmin - 5.0f,
collapse_rect.ymin - 6.0f / aspect,
UI_panel_is_closed(panel) ? ICON_RIGHTARROW : ICON_DOWNARROW_HLT,
aspect * U.inv_dpi_fac,
0.5f,
0.0f,
collapse_icon_color,
false);
GPU_blend(GPU_BLEND_NONE);
}
/* Draw text label. */
if (panel->drawname[0] != '\0') {
const rcti title_rect = {
.xmin = widget_rect.xmin + (panel->labelofs / aspect) + scaled_unit * 1.1f,
.xmin = widget_rect.xmin + (panel->labelofs / aspect),
.xmax = widget_rect.xmax,
.ymin = widget_rect.ymin - 2.0f / aspect,
.ymax = widget_rect.ymax,
@@ -1224,12 +1233,12 @@ static void panel_draw_aligned_widgets(const uiStyle *style,
/* The magic numbers here center the widget vertically and offset it to the left.
* Currently this depends on the height of the header, although it could be independent. */
GPU_matrix_translate_2f(widget_rect.xmax - scaled_unit * 1.15,
widget_rect.ymin + (header_height - drag_widget_size) * 0.5f);
widget_rect.ymin + (header_height - drag_widget_size) * 0.33f);
const int col_tint = 84;
const int col_tint = 40;
float color_high[4], color_dark[4];
UI_GetThemeColorShade4fv(TH_PANEL_HEADER, col_tint, color_high);
UI_GetThemeColorShade4fv(TH_PANEL_BACK, -col_tint, color_dark);
UI_GetThemeColorShade4fv(TH_PANEL_HEADER, (-col_tint / 2), color_dark);
GPUBatch *batch = GPU_batch_preset_panel_drag_widget(
U.pixelsize, color_high, color_dark, drag_widget_size);
@@ -1246,11 +1255,6 @@ static void panel_draw_aligned_backdrop(const Panel *panel,
const bool draw_box_style = panel->type->flag & PANEL_TYPE_DRAW_BOX;
const bool is_subpanel = panel->type->parent != NULL;
const bool is_open = !UI_panel_is_closed(panel);
if (is_subpanel && !is_open) {
return;
}
const uint pos = GPU_vertformat_attr_add(
immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
@@ -1317,20 +1321,53 @@ static void panel_draw_aligned_backdrop(const Panel *panel,
}
}
else {
/* Regular (non box style) panels. */
const float margin_y = 2.5f;
float panel_backcolor[4];
float panel_headercolor[4];
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
GPU_blend(GPU_BLEND_ALPHA);
/* Panel backdrop. */
if (is_open || panel->type->flag & PANEL_TYPE_NO_HEADER) {
immUniformThemeColor(is_subpanel ? TH_PANEL_SUB_BACK : TH_PANEL_BACK);
immRectf(pos, rect->xmin, rect->ymin, rect->xmax, rect->ymax);
UI_draw_roundbox_corner_set(is_open ? UI_CNR_BOTTOM_RIGHT | UI_CNR_BOTTOM_LEFT : UI_CNR_ALL);
UI_GetThemeColor4fv((is_subpanel ? TH_PANEL_SUB_BACK : TH_PANEL_BACK), panel_backcolor);
/* Change the width a little bit to line up with the sides. */
UI_draw_roundbox_4fv(
&(const rctf){
.xmin = rect->xmin,
.xmax = rect->xmax,
.ymin = rect->ymin,
.ymax = rect->ymax,
},
true,
PNL_CNR_RAD,
panel_backcolor);
}
/* Panel header backdrops for non sub-panels. */
if (!is_subpanel) {
immUniformThemeColor(UI_panel_matches_search_filter(panel) ? TH_MATCH : TH_PANEL_HEADER);
immRectf(pos, rect->xmin, header_rect->ymin, rect->xmax, header_rect->ymax);
if (is_subpanel) {
UI_GetThemeColor4fv(UI_panel_matches_search_filter(panel) ? TH_MATCH : TH_PANEL_SUB_BACK,
panel_headercolor);
}
else {
UI_GetThemeColor4fv(UI_panel_matches_search_filter(panel) ? TH_MATCH : TH_PANEL_HEADER,
panel_headercolor);
}
UI_draw_roundbox_corner_set(is_open ? UI_CNR_TOP_RIGHT | UI_CNR_TOP_LEFT : UI_CNR_ALL);
UI_draw_roundbox_4fv(
&(const rctf){
.xmin = rect->xmin,
.xmax = rect->xmax,
.ymin = header_rect->ymin,
.ymax = header_rect->ymax - margin_y,
},
true,
PNL_CNR_RAD,
panel_headercolor);
GPU_blend(GPU_BLEND_NONE);
immUnbindProgram();

View File

@@ -113,12 +113,12 @@ static uiStyle *ui_style_new(ListBase *styles, const char *name, short uifont_id
style->widget.shadowcolor = 0.0f;
style->columnspace = 8;
style->templatespace = 5;
style->boxspace = 5;
style->templatespace = 4;
style->boxspace = 4;
style->buttonspacex = 8;
style->buttonspacey = 2;
style->panelspace = 8;
style->panelouter = 4;
style->panelouter = 8;
return style;
}

View File

@@ -1478,23 +1478,23 @@ static void widget_draw_submenu_tria(const uiBut *but,
const uiWidgetColors *wcol)
{
const float aspect = but->block->aspect * U.inv_dpi_fac;
const int tria_height = (int)(ICON_DEFAULT_HEIGHT / aspect);
const int tria_width = (int)(ICON_DEFAULT_WIDTH / aspect) - 2 * U.pixelsize;
const int xs = rect->xmax - tria_width;
const int ys = (rect->ymin + rect->ymax - tria_height) / 2.0f;
const int icon_height = (int)(ICON_DEFAULT_HEIGHT / aspect);
const int icon_width = (int)(ICON_DEFAULT_WIDTH / aspect) * U.pixelsize;
const int xs = rect->xmax - icon_width;
const int ys = (rect->ymin + rect->ymax - icon_height) / 2.0f;
float col[4];
rgba_uchar_to_float(col, wcol->text);
col[3] *= 0.8f;
rctf tria_rect;
BLI_rctf_init(&tria_rect, xs, xs + tria_width, ys, ys + tria_height);
BLI_rctf_scale(&tria_rect, 0.4f);
rctf icon_rect;
BLI_rctf_init(&icon_rect, xs, xs + icon_width, ys, ys + icon_height);
BLI_rctf_scale(&icon_rect, 0.4f);
GPU_blend(GPU_BLEND_ALPHA);
UI_widgetbase_draw_cache_flush();
UI_icon_draw_ex(xs, ys, ICON_RIGHTARROW, aspect * U.inv_dpi_fac, 0.5f, 0.0f, wcol->text, false);
GPU_blend(GPU_BLEND_NONE);
ui_draw_anti_tria_rect(&tria_rect, 'h', col);
}
static void ui_text_clip_give_prev_off(uiBut *but, const char *str)
@@ -2588,6 +2588,7 @@ static void widget_state(uiWidgetType *wt, int state, int drawflag, eUIEmbossTyp
if (state & UI_BUT_ACTIVE_DEFAULT) {
copy_v4_v4_uchar(wt->wcol.inner, wt->wcol.inner_sel);
copy_v4_v4_uchar(wt->wcol.text, wt->wcol.text_sel);
color_mul_hsl_v3(wt->wcol.outline, 1.0f, 1.0f, 0.9f);
}
if (color_blend != NULL) {
color_blend_v3_v3(wt->wcol.inner, color_blend, wcol_state->blend);
@@ -3315,19 +3316,12 @@ static void ui_draw_but_HSV_v(uiBut *but, const rcti *rect)
static void ui_draw_separator(const rcti *rect, const uiWidgetColors *wcol)
{
const int y = rect->ymin + BLI_rcti_size_y(rect) / 2 - 1;
const uchar col[4] = {
wcol->text[0],
wcol->text[1],
wcol->text[2],
30,
};
const uchar col[3] = {wcol->outline[0], wcol->outline[1], wcol->outline[2]};
const uint pos = GPU_vertformat_attr_add(
immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
GPU_blend(GPU_BLEND_ALPHA);
immUniformColor4ubv(col);
immUniformColor3ubv(col);
GPU_line_width(1.0f);
immBegin(GPU_PRIM_LINES, 2);
@@ -3335,8 +3329,6 @@ static void ui_draw_separator(const rcti *rect, const uiWidgetColors *wcol)
immVertex2f(pos, rect->xmax, y);
immEnd();
GPU_blend(GPU_BLEND_NONE);
immUnbindProgram();
}
@@ -3772,7 +3764,7 @@ static void widget_numslider(
uchar outline[3];
copy_v3_v3_uchar(outline, wcol->outline);
copy_v3_v3_uchar(wcol->outline, wcol->item);
copy_v3_v3_uchar(wcol->inner, wcol->item);
copy_v4_v4_uchar(wcol->inner, wcol->item);
if (!(state & UI_SELECT)) {
SWAP(short, wcol->shadetop, wcol->shadedown);
@@ -3832,6 +3824,9 @@ static void widget_numslider(
factor_discard = factor;
}
rect->xmin += 0.2f * U.widget_unit;
rect->xmax -= 0.2f * U.widget_unit;
round_box_edges(&wtb1, roundboxalign_slider, &rect1, ofs);
wtb1.draw_outline = false;
widgetbase_set_uniform_discard_factor(&wtb1, factor_discard);
@@ -4049,9 +4044,14 @@ static void widget_menu_itembut(uiWidgetColors *wcol,
uiWidgetBase wtb;
widget_init(&wtb);
/* not rounded, no outline */
/* Padding on the sides. */
rect->xmin += 0.2f * U.widget_unit;
rect->xmax -= 0.2f * U.widget_unit;
/* No outline. */
wtb.draw_outline = false;
round_box_edges(&wtb, 0, rect, 0.0f);
const float rad = wcol->roundness * BLI_rcti_size_y(rect);
round_box_edges(&wtb, UI_CNR_ALL, rect, rad);
widgetbase_draw(&wtb, wcol);
}
@@ -4172,10 +4172,32 @@ static void widget_radiobut(uiWidgetColors *wcol, rcti *rect, int UNUSED(state),
{
uiWidgetBase wtb;
widget_init(&wtb);
const float rad = wcol->roundness * U.widget_unit;
round_box_edges(&wtb, roundboxalign, rect, rad);
const float padding = 0.05f;
float color[4];
rgba_uchar_to_float(color, wcol->item);
/* Draw the background for the entire widget first. */
UI_draw_roundbox_corner_set(roundboxalign);
UI_draw_roundbox_4fv(
&(const rctf){
.xmin = rect->xmin,
.xmax = rect->xmax,
.ymin = rect->ymin,
.ymax = rect->ymax,
},
true,
rad,
color);
/* Draw the pill inside, with a small margin to separate each radio choice. */
rect->xmin += padding * U.widget_unit;
rect->xmax -= padding * U.widget_unit;
rect->ymin += padding * U.widget_unit;
rect->ymax -= padding * U.widget_unit;
round_box_edges(&wtb, UI_CNR_ALL, rect, rad);
wtb.draw_emboss = false;
widgetbase_draw(&wtb, wcol);
}
@@ -4199,6 +4221,7 @@ static void widget_box(
const float rad = wcol->roundness * U.widget_unit;
round_box_edges(&wtb, roundboxalign, rect, rad);
wtb.draw_emboss = false;
widgetbase_draw(&wtb, wcol);
copy_v3_v3_uchar(wcol->inner, old_col);

View File

@@ -394,9 +394,6 @@ static void draw_vertical_scale_indicators(const ARegion *region,
const int font_id = BLF_default();
UI_FontThemeColor(font_id, colorid);
BLF_enable(font_id, BLF_ROTATION);
BLF_rotation(font_id, M_PI_2);
BLF_batch_draw_begin();
const float xpos = rect->xmax - 2.0f * UI_DPI_FAC;
@@ -416,7 +413,6 @@ static void draw_vertical_scale_indicators(const ARegion *region,
}
BLF_batch_draw_end();
BLF_disable(font_id, BLF_ROTATION);
GPU_matrix_pop_projection();
}

View File

@@ -2669,7 +2669,7 @@ static void ed_panel_draw(const bContext *C,
bool open;
panel = UI_panel_begin(region, lb, block, pt, panel, &open);
const bool is_subpanel = (panel->type && panel->type->parent != NULL);
const bool search_filter_active = search_filter != NULL && search_filter[0] != '\0';
/* bad fixed values */
@@ -2724,17 +2724,23 @@ static void ed_panel_draw(const bContext *C,
UI_block_apply_search_filter(block, search_filter);
UI_block_layout_resolve(block, &xco, &yco);
panel->labelofs = xco - labelx;
panel->layout = NULL;
}
else {
panel->labelofs = 0;
}
panel->labelofs = UI_PANEL_LABEL_OFFSET;
UI_panel_header_buttons_end(panel);
if (open || search_filter_active) {
short panelContext;
/* Extra offset and panel width adjustment to accomodate sides margin (style->panelouter). */
const int wofs = (pt->flag & PANEL_TYPE_NO_HEADER) ? style->panelouter : 0;
int xofs = (pt->flag & PANEL_TYPE_NO_HEADER) ? 0 : style->panelouter;
if (is_subpanel) {
xofs += style->panelouter;
}
/* panel context can either be toolbar region or normal panels region */
if (pt->flag & PANEL_TYPE_LAYOUT_VERT_BAR) {
panelContext = UI_LAYOUT_VERT_BAR;
@@ -2750,9 +2756,9 @@ static void ed_panel_draw(const bContext *C,
block,
UI_LAYOUT_VERTICAL,
panelContext,
(pt->flag & PANEL_TYPE_LAYOUT_VERT_BAR) ? 0 : style->panelspace,
(pt->flag & PANEL_TYPE_LAYOUT_VERT_BAR) ? 0 : style->panelspace + xofs,
0,
(pt->flag & PANEL_TYPE_LAYOUT_VERT_BAR) ? 0 : w - 2 * style->panelspace,
(pt->flag & PANEL_TYPE_LAYOUT_VERT_BAR) ? 0 : (w - 2 * style->panelspace + wofs - xofs),
em,
0,
style);
@@ -2782,7 +2788,7 @@ static void ed_panel_draw(const bContext *C,
&panel->children,
child_pt,
child_panel,
w,
w - style->panelouter,
em,
unique_panel_str,
search_filter);
@@ -2892,12 +2898,13 @@ void ED_region_panels_layout_ex(const bContext *C,
ScrArea *area = CTX_wm_area(C);
View2D *v2d = &region->v2d;
const uiStyle *style = UI_style_get_dpi();
bool use_category_tabs = (category_override == NULL) && region_uses_category_tabs(area, region);
/* offset panels for small vertical tab area */
const char *category = NULL;
const int category_tabs_width = UI_PANEL_CATEGORY_MARGIN_WIDTH;
int margin_x = 0;
int margin_x = style->panelouter;
const bool region_layout_based = region->flag & RGN_FLAG_DYNAMIC_SIZE;
bool update_tot_size = true;
@@ -2912,7 +2919,7 @@ void ED_region_panels_layout_ex(const bContext *C,
category = region_panels_collect_categories(region, panel_types_stack, &use_category_tabs);
}
if (use_category_tabs) {
margin_x = category_tabs_width;
margin_x = category_tabs_width + style->panelouter;
}
const int w = BLI_rctf_size_x(&v2d->cur) - margin_x;

View File

@@ -266,7 +266,7 @@ static GPUBatch *gpu_batch_preset_panel_drag_widget(float pixelsize,
const float width)
{
GPUVertBuf *vbo = GPU_vertbuf_create_with_format(preset_2d_format());
const uint vbo_len = 4 * 2 * (6 * 2);
const uint vbo_len = 3 * 2 * (6 * 2);
GPU_vertbuf_data_alloc(vbo, vbo_len);
GPUVertBufRaw pos_step, col_step;
@@ -274,16 +274,16 @@ static GPUBatch *gpu_batch_preset_panel_drag_widget(float pixelsize,
GPU_vertbuf_attr_get_raw_data(vbo, g_presets_2d.attr_id.col, &col_step);
const int px = (int)pixelsize;
const int px_zoom = max_ii(round_fl_to_int(width / 22.0f), 1);
const int px_zoom = max_ii(round_fl_to_int(width / 24.0f), 1);
const int box_margin = max_ii(round_fl_to_int((float)(px_zoom * 2.0f)), px);
const int box_size = max_ii(round_fl_to_int((width / 8.0f) - px), px);
const int box_size = max_ii(round_fl_to_int((width / 6.0f) - px), px);
const int y_ofs = max_ii(round_fl_to_int(width / 2.5f), px);
const int y_ofs = max_ii(round_fl_to_int(width / 3.0f), px);
const int x_ofs = y_ofs;
int i_x, i_y;
for (i_x = 0; i_x < 4; i_x++) {
for (i_x = 0; i_x < 3; i_x++) {
for (i_y = 0; i_y < 2; i_y++) {
const int x_co = (x_ofs) + (i_x * (box_size + box_margin));
const int y_co = (y_ofs) + (i_y * (box_size + box_margin));

View File

@@ -352,5 +352,23 @@
.mat_nr = -1, \
}
#define _DNA_DEFAULT_DashGpencilModifierData \
{ \
.dash_offset = 0, \
.segments = NULL, \
.segments_len = 1, \
.segment_active_index = 0, \
}
#define _DNA_DEFAULT_DashGpencilModifierSegment \
{ \
.name = "", \
.dash = 2, \
.gap = 1, \
.radius = 1.0f, \
.opacity = 1.0f, \
.mat_nr = -1, \
}
/* clang-format off */