100040 Commits

Author SHA1 Message Date
Bastien Montagne
0696eaa3e8 Fix T80684: Node shader wrapper: Tweak handling of alpha textures.
There is no ideal solution here, but we can assume by default that we should
use the Alpha output from a texture used for transparency data.

This will break people using a dedicated B&W texture for this alpha
pass, but we cannot really handle all cases properly in this wrapper, we
only try to support the most common ones to some extent.
2020-09-16 16:39:49 +02:00
Julian Eisel
1a4fc6dcd6 Fix versioning code after FCurves versioning not executed
There must not be any return directly in our versioning patches. It
would return from the entire versioning function.
Mistake in da95d1d851b4.

As a result, when opening old files with animation data, the versioning
for the new collection color tagging wouldn't run, and all collections
would get the first color assigned.
2020-09-16 15:56:39 +02:00
Chris Clyne
c9c0f89307 Action Constraint: Add manual time factor input control
Adds an optional slider to the action constraint so that it can be
driven without a constraint target.

This is very helpful for more complex rigging and mechanical rigs, as it
means the action constraint can be controlled with a driver/custom
property directly, currently if we want to use a driver to control it we
must add a "dummy" bone/object inbetween to act as a control.

Reviewed By: Sebastian Parborg, Sybren A. Stüvel, Demeter Dzadik, Julian Eisel

Differential Revision: http://developer.blender.org/D8022
2020-09-16 15:55:22 +02:00
Clément Foucault
569e2e6dba GPUDebug: Avoid using STREQ on StringRef
This might be dangerous because StringRef is not guaranteed to be
null-terminated and STREQ assumes null termination.
2020-09-16 15:24:37 +02:00
Clément Foucault
fa81e36f65 Fix T78653 Workbench: Broken Depth of Field in Viewport (Mac OSX)
The output layout was wrong and it's a mistery why it works on most
implementations since it's clearly a wrong usage.

Thanks @sebbas for helping narrowing down the issue.
2020-09-16 15:17:58 +02:00
Bastien Montagne
fa2ef64d96 Fix (unreported) buffer overflow in BLI_system_cpu_brand_string helper.
Since this buffer is used as an array of 12 32bits integers, and C++
string expect a NULL-terminated C-string, we need an extra char to
ensure last one is always NULL.

See D8906. Thanks to @brecht for noting this one too.
2020-09-16 15:04:19 +02:00
Wayde Moss
d067c13a9d NLA: Always Show All Strips
Currently, it's difficult to use the NLA system for users who are only
interested in using it as animation layers.

Entering tweak mode hides strips which are not evaluated. If the user
wanted to edit a different strip, they must exit tweak mode, look for
the strip, select it then re-enter tweak mode.

Solution:
All strips are always shown. The user can now see the next strip they
want to start editing.

Reviewed By: Sybren, Sebastian Parborg

Differential Revision: http://developer.blender.org/D7600
2020-09-16 14:52:48 +02:00
Bastien Montagne
be11603dc2 Fix (unreported) buffer overflow in Cycles' system_cpu_brand_string helper.
Since this buffer is used as an array of 12 32bits integers, and C++
`string` expect a NULL-terminated C-string, we need an extra char to
ensure last one is always NULL.

See D8906. Found while investigating T80657.
2020-09-16 14:39:13 +02:00
Jacques Lucke
f14995aba7 Fix: add versioning to fix incorrectly written customdata
Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D8903
2020-09-16 12:26:16 +02:00
Jacques Lucke
27a5da4dc3 Cleanup: use uint8_t for various flags in curves
Previously, it was kind of a mess. In different places it was using `char`, `short` and `int`.

The changed properties are flags that are operated upon using bit operations. Therefore, the integer type should be unsigned. Since we only use 2 bits of these flags, `uint8_t` is large enough.

Especially note the change I had to make in `RNA_define.h` to make this work.

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D8844
2020-09-16 12:23:23 +02:00
Jeroen Bakker
d376aea618 Fix: Showing Meta Data Crash
When Showing Meta data for an image where the buffer does not exist
(missing file) it crashed. This patch removes the check on the image and
only checks the availability of the buffer.
2020-09-16 11:55:48 +02:00
Bastien Montagne
c5c22d1ce1 Install_deps: update to add pugixml and potrace new deps.
Also fixed OpenVDB maximum version, it appears that even 7.1 is not
compatible with 7.0?

Re T80818 and D8628.
2020-09-16 11:23:58 +02:00
Jeroen Bakker
7cae58adf5 Fix T80800: Active UVMap Drawing
Regression introduced by D8234. In stead of using the active uv map, the
render uv map was drawn. This change will use the active uv map.
2020-09-16 11:19:47 +02:00
Jacques Lucke
ba85b4e45c Fix: create shallow copy of CustomData before writing
CustomData_blend_write_prepare might modify the `CustomData`
instance, making it invalid afterwards. It is not necessary to do this
in other cases explicitly, because when writing shallow copies of
ID data blocks are made.
2020-09-16 10:39:04 +02:00
Jeroen Bakker
cee6518b5e Fix T80825: UV Editor UV Grid
Regression introduced by D8234.
2020-09-16 10:35:18 +02:00
Campbell Barton
7e8cba98b6 Cleanup: spelling 2020-09-16 15:28:02 +10:00
Campbell Barton
c7309c5007 Cleanup: use doxygen links to struct members 2020-09-16 15:17:44 +10:00
Clément Foucault
75b52da826 Cleanup: DNA_fluid_types: Add DNA member name before enum declarations 2020-09-16 02:02:57 +02:00
Clément Foucault
e4eb1a71ee Fix building with tests enabled 2020-09-16 02:02:57 +02:00
Hans Goudey
17ccb409dd Bump file subversion after recent theme-related changes 2020-09-15 18:47:35 -05:00
Red Mser
675807e2b6 UI: Add grid-related theme options
This commit makes grid theming more consistent and capable by adding
some new theme colors related to grid rendering.
 - Add grid theme color for node editor. `UI_view2d_multi_grid_draw`
   is called with TH_GRID instead of a shaded `TH_BACK`.
   Also color-blend `TH_NODE_GROUP`.
 - Make the movie clip editor's clip preview grid respect grid theme
   color (`ED_region_grid_draw` uses color-blended `TH_GRID`).
 - Add versioning code to allow fixing existing themes (the resulting
   themes should visually look the same as before)

These changes did cause some inconsistencies in the movie clip editor,
even after adjusting the themes accordingly:
1. The alpha slider of the grid color affects the background and not
   the grid lines themselves.
2. The grids used by graph and dopesheet mode could already be themed
   in the past. Now that the clip preview's grid can also be themed,
   two different modes share the same theme color.

Differential Revision: https://developer.blender.org/D8699
2020-09-15 18:42:38 -05:00
Clément Foucault
1858535a10 GPUShader: Add meaningful debug names to builtin shaders
This makes the debugging easier.
2020-09-16 01:40:45 +02:00
Clément Foucault
0dd44f4647 GPU: Add debug groups inside selection code
This makes the debugging easier.
2020-09-16 01:40:45 +02:00
Clément Foucault
926b426073 GPU: Add debug groups inside wm_draw.c
This makes the debugging easier
2020-09-16 01:40:45 +02:00
Clément Foucault
8eda18f789 GPUDebug: Add function to test if inside a debug group
This is a nice way to check certain GPU codepaths only for some
regions or callers paths.
2020-09-16 01:40:45 +02:00
Clément Foucault
fafc1fbd7f Fix T80107 Selection: Regression in Box selection
The Draw State now needs to be in sync with what the selection
code set. We query the state just before locking it.
2020-09-16 01:40:45 +02:00
Clément Foucault
6624c4c225 Fix T75061 Grease Pencil: MacOS: broken Gradient and Texture
There is a driver bug that makes all the end of the structure unreadable.
Workaround this by just declaring a vec4 an unpacking manually.
2020-09-16 00:03:12 +02:00
Nathan Craddock
1572da858d Outliner: Modifier/constraint/shaderfx drag and drop operator
This adds an operator to allow drag and drop of modifiers, constraints,
and shader effects within the outliner. Referred to as "data stack" in
the code for simplicity.

The following operations are allowed:
* Reordering within an object or bone
* Copying a single modifier/constraint/effect to another object or bone
* Copying (linking) all modifiers/constraints/effects to another object
  or bone.

This complements the recent work done for panel-based modifier layouts
by allowing reordering in the outliner. It also makes it simple to copy
a single modifier/constraint/effect to another object.

Differential Revision: https://developer.blender.org/D8642
2020-09-15 15:29:59 -06:00
Nathan Craddock
583354e9e9 Modifiers: Add link and copy functions
Adds functions to copy a modifier between objects, and an ED_ level
function for linking modifiers between objects. This will be used in
outliner modifier drag and drop.

These functions support both regular and grease pencil modifiers.

Differential Revision: https://developer.blender.org/D8642
2020-09-15 15:29:19 -06:00
Nathan Craddock
f4a2024c44 Constraints: Add link and copy functions
Add functions to copy a single constraint between objects or between
bones, and another function to link constraints. This is in preparation
for constraint drag and drop in the outliner.

Differential Revision: https://developer.blender.org/D8642
2020-09-15 15:29:19 -06:00
Nathan Craddock
4d04a345a6 Cleanup: Move notifiers to move_to_index functions
Move the notifiers and DEG tagging to the ED_* level functions for
modifiers and gpencil shaderfx in preparation for outliner modifier and
shaderfx drag and drop. No functional changes.

Differential Revision: https://developer.blender.org/D8642
2020-09-15 15:29:19 -06:00
Nathan Craddock
a6434ff417 Cleanup: Extract editor function from constraint_move_to_index_exec
No functional changes. Move the constraint reordering logic into an ED_
level function to be used by outliner constraint drag and drop.

Differential Revision: https://developer.blender.org/D8642
2020-09-15 15:29:19 -06:00
Nathan Craddock
18701c19fa GPencil: Add link and copy functions for shaderfx
Adds two functions: one to copy a shaderfx between two gpencil objects,
and another to link all shaderfx between two gpencil objects. Added in
preparation for outliner shaderfx drag and drop.

Differential Revision: https://developer.blender.org/D8642
2020-09-15 15:29:19 -06:00
Nathan Craddock
1c5d0deb2a Cleanup: Separate BKE_object_link_modifiers into functions
No functional changes. Split the grease pencil and object copy logic
into separate functions. This makes the code cleaner and prepares
utility functions for outliner modiifier drag and drop.

Differential Revision: https://developer.blender.org/D8642
2020-09-15 15:29:19 -06:00
Hans Goudey
cf0791bf38 Property Search: Properly set expansion for instanced panels
Stack panels (for modifiers, etc..) also get their expansion from their
associated list data. This means that property search expansion needs
to properly update the list data, which can be accomplished by calling
`set_panels_list_data_expand_flag`.

This commit also moves this logic to `UI_panels_end`, where it fits
better.
2020-09-15 15:57:30 -05:00
Ankit Meel
a4c5811e21 ASan/macOS: fix incomplete C/CXX compiler flags.
While testing for {rB40dcf686f04f}, compiler flags got mixed up and
non-working ASan configuration was committed.

Platform file, which is `include`d after the `CMAKE_C_FLAGS_DEBUG` etc.,
are set, overwrites those flags instead of appending to them. To fix this,
`PLATFORM_CFLAGS` is used to pass the `-fsanitize=*` flags to the C/C++
compiler.

Tested on fresh build using both Xcode and Ninja, with & without ccache.

Also silence a clang warning for multi-config generators:
the object size sanitizer has no effect at -O0, but is explicitly
enabled: -fsanitize=object-size [-Winvalid-command-line-argument]

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D8879
2020-09-16 02:18:59 +05:30
Ankit
84032fd110 GMP/macOS: silence "PIE disabled" linker warning.
The change builds GMP with `--with-pic` flag on non-arm architecture.

The warning:
ld: warning: PIE disabled. Absolute addressing
(perhaps -mdynamic-no-pic) not allowed in code signed PIE, but used in
___gmpn_divexact_1 from lib/darwin/gmp/lib/libgmp.a(dive_1.o). To fix
this warning, don't compile with -mdynamic-no-pic or link with
-Wl,-no_pie

Reviewed By: sebbas

Differential Revision: https://developer.blender.org/D8823
2020-09-16 02:05:51 +05:30
Hans Goudey
8aab26b3b3 UI: Refactor some list panel expansion code
This commit moves the "get panel expansion from list data" function to
UI_panels_end, which is an improvement because it's more centralized.
2020-09-15 15:34:27 -05:00
Ray Molenkamp
2eec6ec793 Deps: Add potrace as a new library dependency
For work the GP team plans to land soon (T79877) potrace was taken
on as an additional optional dependency.

This diff adds building the library to the deps builder and takes
care of the integration into the build-system with the `WITH_POTRACE`
cmake switch.

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

Reviewed by: brecht, sergey
2020-09-15 13:16:37 -06:00
Nathan Craddock
7b3d38a72d Outliner: Hierarchy line drawing
Adds a new hierarchy line that draws to the left of collections. If the
collection is color tagged, then the hierarchy line is drawn in that
color. This is useful to see the color tag of a collection that exceeds
the vertical height of the outliner when expanded.

This also modifies the object hierarchy line drawing to match the new
collection hierarchy line, with no horizontal lines, and moved a unit to
the left. Object lines are not drawn colored.

Manifest Task: https://developer.blender.org/T77777

Differential Revision: https://developer.blender.org/D8622
2020-09-15 12:47:10 -06:00
Nathan Craddock
16f625ee65 Outliner: Draw colored collection icons
This replaces the collection icon with the filled collection icon.

If the collection is color tagged, then the icon draws in the tagged
color.

Manifest Task: https://developer.blender.org/T77777

Differential Revision: https://developer.blender.org/D8622
2020-09-15 12:47:10 -06:00
Nathan Craddock
33d7b36cec Outliner: Set collection color tag operator
This adds a new operator to the outliner context menu. The collections
context menu now shows inline icons to set the color tag for all
selected collections.

Manifest Task: https://developer.blender.org/T77777

Differential Revision: https://developer.blender.org/D8622
2020-09-15 12:47:09 -06:00
Nathan Craddock
26a40ac8fa UI: Fix spacing of inline row icon buttons
A follow-up to rbe17df47303e1. Fix the horizontal spacing of aligned row
icon buttons in menus.
2020-09-15 12:47:09 -06:00
Nathan Craddock
4c3813fb32 UI: Show color tagged collection icons in menus
Draw color tagged collection icons in the link to collection, add
collection instance, collection instance search, and remove collection
menus.

Manifest Task: https://developer.blender.org/T77777

Differential Revision: https://developer.blender.org/D8622
2020-09-15 12:47:09 -06:00
Nathan Craddock
452a1c7b38 Collections: Add color tagging
This adds color tagging to collections. There are 8 color
options which are themable in the user preferences, with an additional
option for no color tag by default.

This adds a new filled collection icon and 8 colored variants of the
icon that can be themed in the user preferences.

In this commit the only interface to setting the color tags is through
Python, and there is nowhere in the interface where the collections are
shown colored. Setting and viewing the color tags from the outliner will
follow.

Manifest Task: https://developer.blender.org/T77777

Differential Revision: https://developer.blender.org/D8622
2020-09-15 12:47:09 -06:00
Sriharsha Kotcharlakot
f137022f99 Liquid Simulation Display Options (GSoC 2020)
All the changes made in the branch `soc-2020-fluid-tools` are included in this patch.

**Major changes:**

=== Viewport Display ===

- //Raw voxel display// or //closest (nearest-neighbor)// interpolation for displaying the underlying voxel data of the simulation grids more clearly.
- An option to display //gridlines// when the slicing method is //single//.

==== Grid Display ====

- Visualization for flags, pressure and level-set representation grids with a fixed color coding based on Manta GUI.

==== Vector Display ====

- //**M**arker **A**nd **C**ell// grid visualization options for vector grids like velocity or external forces.
- Made vector display options available for external forces.

==== Coloring options for //gridlines// ====

- Range highlighting and cell filtering options for displaying the simulation grid data more precisely.
- Color gridlines with flags.

- Also, made slicing and interpolation options available for Volume Object.

Reviewed By: JacquesLucke, sebbas

Differential Revision: https://developer.blender.org/D8705
2020-09-15 23:13:01 +05:30
Hans Goudey
bedbd8655e Property Search: Quick start and clear operators
`ctrl-F` to start the search is obviously necessary, but the clear
operator, `alt-F` requires some of explanation. First, it maps nicely
to the paradigm of "key to set, alt-key to clear," which makes it
unobtrusive. Second, it can be a quicker way to clear the search than
moving the mouse to the top. Finally, in the future, it could a reset
the panels to their expansion before the search started.

Differential Revision: https://developer.blender.org/D8857
2020-09-15 11:39:25 -05:00
Hans Goudey
8bcdcab659 UI: Single tab property search
This adds a search bar to the properties editor. The full search for
every tab isn't included in this patch, but the interaction with
panels, searching behavior, UI, region level, and DNA changes are
included here.

The block-level search works by iterating over the block's button
groups and checking whether they match the search. If they do, they
are tagged with a flag, and the block's panel is tagged too. For
every update (text edit), the panel's expansion is set to whether
the panel has a result or not. The search also checks for matching
strings inside enums and in panel labels.

One complication to this that isn't immediately apparent is that
closed panel's subpanels have to be searched too. This adds some
complexity to the area-level panel layout code.

Possible Future Improvements:
 - Use the new fuzzy search in BLI
 - Reset panels to their expansion before the search started if
   the user escape out of the text box.
 - Open all child panels of a panel with expansion.

Differential Revision: https://developer.blender.org/D8856
2020-09-15 11:25:49 -05:00
Philipp Oeser
7a0a60dde8 Dont show temporary IK constraints in the constraint stack
Those constraints are added when using AutoIK (or targetless IK as
well).
While not strictly incorrect, these kinds of constraints were not
showing in the UI prior to rBeaa44afe703e (and I think they should not).

ref T80437

Maniphest Tasks: T80437

Differential Revision: https://developer.blender.org/D8895
2020-09-15 17:57:37 +02:00
Philipp Oeser
2b36e6bee6 Fix T80333: cursor disappears after using navigation gizmo in editmode
Caused by rBe490dc4346db: UI: Skip unnecessary cursor setting

Above commit returned early if the cursor was already set, but did this
before visibility was regained, now return (still early) after setting
visibility.

Reviewed by @Severin in T80333
2020-09-15 17:50:45 +02:00