Commit Graph

100192 Commits

Author SHA1 Message Date
Sebastián Barschkis
edd19c1df9 Fluid: Fix for script export (standalone mode)
The OpenVDB update added a load() function. This function clashes with a helper IO function (only used when exporting and running the simulation externally) that was also named load().
2020-09-22 14:02:53 +02:00
Sebastián Barschkis
97ec16d68f Fluid: Refactor for initial velocities
Removed invel MAC grid since it is sufficient to use the cell centered vec3 representation. When setting initial velocities these will be interpolated by the setter functions.
2020-09-22 14:02:53 +02:00
Jeroen Bakker
b17cca6966 Fix T81026: Image Editor: Alpha (like Bloom) not showing properly
With the new image editor drawing there were was some mutual exclusive
functionality. When rendering the alpha was shown correctly or the pure
emissive colors were shown correctly, but never both. The cause of this
is that the image_gpu did not used the correct alpha mode when generating
gpu textures for non-images (render results, compositors viewer)

The implementation always checked the alpha_mode. Alpha mode is an
attribute for images, but aren't set for non images. This patch adds
a more detailed check to ensure that the gpu texture is premultiplied.

The issue has been tested using several bug report files and production
files.

Reviewed By: Brecht van Lommel

Differential Revision: https://developer.blender.org/D8978
2020-09-22 13:52:54 +02:00
Jeroen Bakker
085329f114 Fix T81002: Images drawn with the Python gpu module no longer draw on top in the Image Editor
Since {D8234} the image editor is drawn using a depth buffer.
When using `draw_texture_2d` the image is drawn using the 2D_IMAGE
shader. inside the vertex buffer the image was pushed to the background.
This was introduced by {648924333234} what seems to be out dated as we
have done several overhauls in this area. (workbench refactor, overlay
engine refactor, color management pipeline).

This patch removes the pushing of the image to the background.
2020-09-22 11:17:17 +02:00
Jacques Lucke
222ed9f781 Fix T80943: return early when field to visualize is NULL 2020-09-22 10:43:11 +02:00
Jeroen Bakker
ee89106ac1 Fix T80915: Image editor only displays the first frame during 'Viewport render animation'
During viewport render animation the gpu textures weren't tagged as
invalid. As the image uv editor now draws the gpu texture only the first
was shown as it wasn't refreshed with the actual image data.
2020-09-22 10:38:22 +02:00
Bastien Montagne
129d9f79c9 Cleanup in style from previous commit.
Forgot that arc land also did the pus ot originh.
2020-09-22 10:33:22 +02:00
Martijn Versteegh
c5efd0939f Fix T80859: Thread safe pixeldata concersion from float to uchar and v.v.
I created a bugreport T80859 earlier.

The problem is in the file source/blender/editors/sculpt_paint/paint_image_proj.c (line numbers against commit d376aea61)

at the lines 5309 and 5320 the functions `IMB_rect_from_float(...)` and `IMB_float_from_rect(...)` are called from threaded code on a shared ibuf.
However, ps->reproject_ibuf is shared between threads, so this is not thread-safe.
This is a race condition and leads to wrong output when projecting float data onto a uchar texture or vice versa on a multithreaded system.
The checks on line 5308 and 5319 are already a race condition.

I created this patch which fixes the problem , but I'm not sure if I'm overlooking something.
This makes sure reproject_ibuf contains the correct formats *before* the threadpool is started.

I replaced the original location of the conversions with BLI_asserts(). That may be overkill?

Reviewed By: #sculpt_paint_texture, mont29

Maniphest Tasks: T80859

Differential Revision: https://developer.blender.org/D8936
2020-09-22 10:30:05 +02:00
Philipp Oeser
af7378bf2a Fix T81013: Weight Paint Overlay XRay fails with clipping
When introduced in rB1ca1744c29e2, the Weight Paint Overlay XRay's
corresponding depth pass was not considering clipping planes.

Maniphest Tasks: T81013

Differential Revision: https://developer.blender.org/D8970
2020-09-22 10:22:49 +02:00
Jacques Lucke
b67c90a822 Cleanup: reduce variable scopes 2020-09-22 10:08:02 +02:00
Philipp Oeser
d037ac315b Fix T80996: Weight Proximity modifier: crash going to editmode on a
target in certain situations

Regression from rBdeaff945d0b96.

mesh_ensure_looptri_data would overflow.

Crash would only happen if a Data Transfer modifier (transferring
UVs) follows, so exact reason for this is not yet entirely clear. Also
there are edit-mode versions of the following BVH lookup functions so it
could be avoided (since this is a expensive operation), marking as TODO.

Similar fix as
- rB0945a79ed1eafae444d3021a5912cb39801a7209
- rB56d7e39b92997768b3db8ce2dbc262f869994145

Reviewers: mont29, campbellbarton

Maniphest Tasks: T80996

Differential Revision: https://developer.blender.org/D8973
2020-09-22 09:48:13 +02:00
Campbell Barton
3cbc5dd90e Object: check for negative index access with duplicator reading UV's 2020-09-22 15:54:17 +10:00
Campbell Barton
a9dceed2a7 Cleanup: comments, spelling 2020-09-22 15:16:36 +10:00
Hans Goudey
b2782f78ba Fix warning building without potrace
The library is no longer in extern, so it isn't necessary to include it
here.
2020-09-21 21:46:15 -05:00
Hans Goudey
4e667ecef9 UI: Add curve geometry start and end panel
The placement of the start and end factor and mapping settings for
curves has been quite misleading for a long time. They were in the
"Bevel" subpanel, but they aren't related to bevel because they affect
curves with only extrusion and no bevel.

This commit moves these properties to their own subpanel, labeled
"Start & End Mapping".

Differential Revision: https://developer.blender.org/D8910
2020-09-21 19:19:21 -05:00
Henrik Dick
8eda3ddc4f Weld Modifier: Performance improvement
This commit contains the Performance improvement, that was originally
proposed in D8966.

It improves the performance of the Weld Modifier by a lot.

It had a loop with execution time O(N^2) which is now O(N*log(N)) at a
bare maximum.
2020-09-21 16:29:33 -03:00
Hans Goudey
6a9e9bef44 Cleanup: Reduce indentation by returning early
Checking for NULL icons or draw info can remove some indentation later
in the funcitons, making the code more readable.
2020-09-21 13:21:22 -05:00
Antonio Vazquez
4d62bb8fe5 GPencil: New Trace images using Potrace
This patch adds a new operator to convert a black and white image into
grease pencil strokes.

If the image is not B/W, an internal conversion is done.

This is the first operator using Potrace, but we expect to add more features in next Blender versions.

Reviewed By: HooglyBoogly

Maniphest Tasks: T79877

Differential Revision: https://developer.blender.org/D8951
2020-09-21 20:03:25 +02:00
Hans Goudey
d93db4f30c Cleanup: Declare variables where initialized 2020-09-21 12:14:31 -05:00
Sebastian Parborg
e5a572157d Fix T80899: Crash on editing multiple UVs of multiple different objects at the same time
The issue was two fold.

First something sets the loop element tag and doesn't clear it before
the UV code in question tries to use the tags. Added a sanity clear to
make sure that it operates on a clean tag state.

The next one was that the UV maps in question had quite a few points
that had zero length UV loop edges. This would lead to division by
zero.

Reviewed By: Jeroen Bakker, Brecht

Differential Revision: http://developer.blender.org/D8967
2020-09-21 16:09:51 +02:00
Bastien Montagne
9d3550d781 Various fixes in UI messages.
Along some other typos in comments or variable names.
2020-09-21 15:18:13 +02:00
Julian Eisel
a34e7c3e5d Cleanup (UI): Early-exit rather than having a big-ish conditional body
It's generally considered a better codestyle to check conditions early
and exit early when they are not met, over having most logic of a
function within a big `if`-block. Otherwise people have to go over the
entire block to see if there's possibly an `else` somewhere, or any
followup logic.
2020-09-21 15:03:02 +02:00
Julian Eisel
7883ccd29f Fix T80854: Search buttons fail in Adjust Last Operation Panel
There's the old and ugly hack where the `uiBut.poin` points to the
button itself. When reallocating the button we have to update that
pointer of course.
2020-09-21 15:01:40 +02:00
Bastien Montagne
87d2ac9681 Cleanup: move some paint helpers to ED_ 'namespace'.
Those two functions had `BKE_` prefix, were defined in BKE headers, but
implemented in ED code, yuck.

Moved everything to ED area for now, since those do not look fondamental
enough to belong to BKE, and none of their usages requires it currently.
2020-09-21 14:43:29 +02:00
Bastien Montagne
82aa300e1c Fix T79373: Forbid painting on linked image from 3DView.
As noted by @lichtwerk (thanks), one can have a local object and/or
material using a linked image data-block, this case needs some different
handling to prevent painting on such linked image.

For now, tweak `BKE_paint_proj_mesh_data_check` (eeeek, that name
prefix!) to consider paintslots with linked image as 'non-existing'.
2020-09-21 14:24:55 +02:00
Bastien Montagne
154752243d Add missing new liboverride option to py-defined collections props doc. 2020-09-21 13:54:58 +02:00
Julian Eisel
88a9d82bbb Cleanup: Remove weird assert in button handling
The function this was in already checks the conditions under which it
can operate (as it should). No need to force the caller to do these
(quite specific) checks, the function can just do nothing if the button
doesn't need these operations.
Otherwise we'd have to always execute these checks before calling, which
makes calling it a hassle, makes the code harder to follow and generally
harder to maintain (what if the conditions change?).
2020-09-21 13:15:43 +02:00
Julian Eisel
92454ae100 Fix assert failure when using Ctrl+Mousewheel on Object Mode button
Do a proper check to see if the button supports Ctrl+Mousewheel cycling.

See T80659.
2020-09-21 13:15:43 +02:00
Ankit Meel
b3c6ab5084 Fix datatoc_icon linker errors with ASan enabled.
Error introduced in {rBf9fcb25d521d}.

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D8964
2020-09-21 16:38:31 +05:30
Sergey Sharybin
6836a40287 Make deps: Enable fPIC for Linux
Similar to D8823.
2020-09-21 12:53:24 +02:00
Sergey Sharybin
216a221876 Implement ID properties support for TimeMarker
Allows scripters to store additional information in the marker itself instead
of using work-around approach based on marker names and such.

Differential Revision: https://developer.blender.org/D8944
2020-09-21 12:25:45 +02:00
Sergey Sharybin
3791dbea1e Fix T79965: mesh.transform() modifies referenced layers
Originally was noticed when transforming mesh created by
object.to_mesh() from an object without modifier, in which case the
result references CustomData layers used by the object itself.

The issue goes a bit deeper: mesh.transform() should never modify
referenced layers, hence it should duplicate referenced layers.

This fix changes one specific aspect of the reported behavior. The
case where vertices coordinates are modified manually will still have
affect on the source mesh (as no referenced CustomData layers are being
duplicated). Proper fix for this case is not yet clear to me.

Differential Revision: https://developer.blender.org/D8939
2020-09-21 12:23:30 +02:00
Jeroen Bakker
abc90d6b03 Fix T80931: Proporional Editing Cursor Draws Incorrect
The incorrect view was setup so it was drawn in pixel space. This patch
changes it to use UV space.
2020-09-21 11:39:32 +02:00
Bastien Montagne
d72b5785eb Fix T79373: Forbid painting on linked image.
There is just no reason to support that kind of useless behavior.

Some remote TODO could be to define a process based on liboverride and
layers.
2020-09-21 10:49:39 +02:00
Jacques Lucke
b8b60e132d Fix T59272: dead particles not included in render, but visible in viewport
The issue was that the pointcache was not storing dead particles,
even though they are displayed. This lead to the rendering issue,
because only alive particles can be read from the point cache in
the frame that is rendered.

This also fixes an issue unrelated to rendering: when dead particles
are displayed, their position is incorrect when some frames are
skipped during playback.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D8907
2020-09-21 10:46:35 +02:00
Bastien Montagne
3bb53b0ee6 Cleanup: Sculpt/Paint ED code: correct return constant types.
Mainly use false/true for bool, but also a few others.

No change in behavior expected.
2020-09-21 10:37:23 +02:00
Dalai Felinto
213445e389 Fix T66614: Text objects: Truncate overflow for non-top aligned text 2020-09-21 18:00:36 +10:00
Jeroen Bakker
701c3e499f Cleanup: correct naming IMAGE_Z_DEPTH
IMAGE_DEPTH is used for bit depth.
2020-09-21 07:53:40 +02:00
mano-wii
f5b6b82598 Fix T80520: Tris to Quads ignores UV delimit option 2020-09-21 15:05:33 +10:00
Campbell Barton
b51d836fcc Cleanup: balance braces, spelling
Keep braces balanced where possible, even with ifdef's as it avoids
confusions with editors calculating correct indentation level &
finding matching brackets.
2020-09-21 15:04:09 +10:00
Hans Goudey
e14894aad2 Fix T80993: Crash duplicating inactive workspace
We need to check for the property editor's runtime struct
before duplicating it.
2020-09-20 13:23:49 -05:00
Bastien Montagne
0d5aa352d3 Fix broken Windows buiilds after own recent commit in read/write code.
Usual issue of win32 not following POSIX standards.
2020-09-20 19:34:12 +02:00
Bastien Montagne
cdad684ada Fix (unreported) wrong definition of ssize_t for windows.
Since at least MSVC2010 there is a `SSIZE_T` available for windows, use
it to typedef `ssize_t` on this platform.
2020-09-20 19:32:46 +02:00
Bastien Montagne
5ea1049e75 Sanitize type 'size' parameters in our read/write file code
This patch tries to sanitize the types of our size parameters across our read
and write code, which is currently fairly inconsistent (using `int`, `uint`,
`size_t`...), by using `size_t` everywhere. Since in Blender file themselves
we can only store chunk of size `MAX_INT`, added some asserts to ensure that
as well.

See {T79561} for details.

Differential Revision: https://developer.blender.org/D8672
2020-09-20 18:41:50 +02:00
Bastien Montagne
86c5d1f4aa LibOverride: add checks to RNA collections editing utils.
Collections of liboverride data only support insertion of new items (and
deleting or moving those around). No operation on existing items from linked
data is allowed.

Reflect that in RNA functions used to edit py-defined RNA collections.

Note that this is not ideal currently, it does the job but feedback to
user is rather poor. Ideally add-ons should implement higher-level
checks for override cases in their operators.
2020-09-20 17:00:07 +02:00
Bastien Montagne
1c98bb83a4 Cleanup: Correct comment in newly added liboverride code for IDProp collections. 2020-09-20 16:26:39 +02:00
Bastien Montagne
9756c66720 LibOverride: expose PROPOVERRIDE_LIBRARY_INSERTION to py-defined properties.
This will allow add-ons to define Collection properties that support
item insertion in library override context.
2020-09-20 16:26:39 +02:00
Bastien Montagne
db314ee7a4 LibOverride: support inserting items in py-defined (IDProp-based) collections.
Supporting IDProperty-based data storage here in a generic way is fairly
simple, unlike actual RNA data (DNA-based), for which getting a proper
generic way to duplicate them from within RNA is currently not really
possible.

Part of T79562.
2020-09-20 16:26:39 +02:00
Bastien Montagne
5e509a3aa9 RNA access: Add utils to search a collection item from its name, and get both item pointer and its index in the collection. 2020-09-20 16:26:39 +02:00
Bastien Montagne
8afa42b05a IDProperties: Add utils to duplicate content of one IDProp into another. 2020-09-20 16:26:39 +02:00