Commit Graph

103193 Commits

Author SHA1 Message Date
Campbell Barton
f066cee92f Merge branch 'blender-v2.92-release' 2021-01-26 22:04:21 +11:00
Campbell Barton
548d8a397c Fix T85011: "Allow Execution" reloads the wrong file when recovering
Support custom revert actions, necessary for recover operations
to be able to reload the file with scripts enabled.
2021-01-26 21:56:49 +11:00
Bastien Montagne
2a8122fb65 ed_undo refactor: split/remove ed_undo_step_impl.
This function was doing too many things, with behaviors fairly different
depending on its input parameters. This was making the code fragile and
hard to follow.

Split it in three:
* `ed_undo_step_pre` does the common actions before we actually undo
  data.
* `ed_undo_step_post` does the common actions after we have undone/redone
  data.

Then, `ed_undo_step_direction`, `ed_undo_step_by_name` and
`ed_undo_step_by_index` do their actual specific actions, with their own
logic.

Note: Since the actual behavior of those three funtions is fairly
different (the first only undo/redo one effective step, the second is only
supposed to **undo** //before// given named step, and the third actually
undo/redo until given indexed step become active), we could also find
better names for those. right now, it sounds like they are doing the
same thing, with just different ways to specify the target step.

Note: This is part of on-going refactor work on undo system, see T83806.

Differential Revision: https://developer.blender.org/D10112
2021-01-26 09:44:46 +01:00
Hans Goudey
0d9f79b163 Cleanup: Reduce variable scope, use LISTBASE_FOREACH macro 2021-01-25 23:47:56 -06:00
Campbell Barton
f21de01b84 Merge branch 'blender-v2.92-release' 2021-01-26 15:38:08 +11:00
Campbell Barton
7909f70f64 WM: add "use_scripts" to recover auto-save/session operators
Support recovering blend files with scripts enabled,
needed to fix T85011, can be useful in general too.

Adding this also resolves an assert in BKE_autoexec_match,
since it ran even when scripts were enabled.
2021-01-26 15:34:38 +11:00
Hans Goudey
e9e054b987 Geometry Nodes: Add float2 to attribute complexity map 2021-01-25 22:20:41 -06:00
Campbell Barton
71a8e32dc0 Merge branch 'blender-v2.92-release' 2021-01-26 15:18:10 +11:00
Campbell Barton
d55d95b04d WM: return success from WM_recover_last_session, minor cleanup
- Return success from WM_recover_last_session
- Avoid setting global variables is already called in WM_file_read.
  While it didn't cause any problems, these assignments ran even when
  recovering the session failed to load the file.
- Return OPERATOR_CANCELLED when the operator fails.

Returning success is needed to fix T85011.
2021-01-26 15:16:12 +11:00
Juanfran Matheu
7d2f746369 TEXTURE PAINT: Tools with wrong cursor
Texture paint tools were using DEFAULT cursor instead of PAINT_CROSS cursor as vertex paint, weight paint and sculpt modes.

Before
{F9591366}

After
{F9591370}

Reviewed By: Blendify

Differential Revision: https://developer.blender.org/D10172
2021-01-25 22:37:14 -05:00
Zev Eisenberg
6499a2ec5c Fix typos in driver_functions.py
I'm learning how driver functions work, and I found a couple of typos in the driver_functions.py template file. Here's a quick patch to fix them up.

Reviewed By: Blendify

Differential Revision: https://developer.blender.org/D10149
2021-01-25 22:37:14 -05:00
Hans Goudey
d7a2e0b83c Cleanup: Use const arguments 2021-01-25 21:11:57 -06:00
Juanfran Matheu
be262cf561 TEXTURE PAINT: Tools with wrong cursor
Texture paint tools were using DEFAULT cursor instead of PAINT_CROSS cursor as vertex paint, weight paint and sculpt modes.

Before
{F9591366}

After
{F9591370}

Reviewed By: Blendify

Differential Revision: https://developer.blender.org/D10172
2021-01-25 22:01:12 -05:00
Zev Eisenberg
0734b235d2 Fix typos in driver_functions.py
I'm learning how driver functions work, and I found a couple of typos in the driver_functions.py template file. Here's a quick patch to fix them up.

Reviewed By: Blendify

Differential Revision: https://developer.blender.org/D10149
2021-01-25 21:59:25 -05:00
Hans Goudey
ae1e68f514 Cleanup: Declare variables where initialized 2021-01-25 17:22:52 -06:00
Hans Goudey
70e064f111 Cleanup: Correct comments in ID type enum 2021-01-25 16:28:00 -06:00
Campbell Barton
c4f3475612 Cleanup: update comment from 77f73a92843965906189dd56dcc4d18eae2371cc 2021-01-26 09:23:44 +11:00
Falk David
6249995c5e Fix T85054: undo/redo app handlers broken
Regression in recent commit c13383da416c9c99d03058caaf66c736af0272cb
which swapped undo/redo when calling the handlers.

Ref D10200
2021-01-26 09:18:26 +11:00
Julian Eisel
eaa726542e Merge branch 'blender-v2.92-release' 2021-01-25 23:12:02 +01:00
Julian Eisel
77f73a9284 Fix library name clipping most of the data-block name in data-block menus
Issue is visible here https://developer.blender.org/F8626313.

If there is enough space for both the item name and the library hint, display
both. Otherwise, clip either the item name, the library hint, or both so that
not more than 60% and 40% of the available width are used repectively.
There are further improvements we could do, as noted in T84188, this just fixes
the regression for the release.

Part of T84188. There were multiple reports about this, see merged in and
mentioned reports in T84188 and T78012.
2021-01-25 23:10:16 +01:00
Campbell Barton
a35c0fe6ce Merge branch 'blender-v2.92-release' 2021-01-26 08:16:22 +11:00
Campbell Barton
14f61c619b Fix wm.context_* operators reusing values when it's not expected
wm.context_* operators typically have their options set by menus
or key bindings.

Re-using options in this case can cause problems where two
actions that change unrelated properties will re-use a setting
from the previous execution.

For example changing the lights Power impacted
changing it's Radius afterwards.
2021-01-26 08:13:58 +11:00
Campbell Barton
4fc54ddae1 Cleanup: spelling 2021-01-26 07:50:40 +11:00
Pablo Dobarro
1559aa3da0 Merge branch 'blender-v2.92-release' 2021-01-25 21:11:48 +01:00
Greg Neumiller
c134d7437d Fix T84031 initialize connectivity info of the base mesh before using Displacement Smear brush.
Reviewed By: pablodp606

Maniphest Tasks: T84031

Differential Revision: https://developer.blender.org/D9956
2021-01-25 21:09:58 +01:00
Hans Goudey
93e3aed041 Merge branch 'blender-v2.92-release' 2021-01-25 11:48:53 -06:00
Hans Goudey
aa030d3459 Fix: Unable to animate nodes modifier exposed properties
The RNA path used for animating the settings passed to the node tree
is incorrect. Currently it's just `settings.property_name`, but it's
the path from the ID, not the modifier, so it should be
`modifiers[modifier_name].settings.property_name`.

However, the "Settings" struct is separated in RNA and DNA, which means
that the callback to get the RNA path does not know about the modifier's
name in order to fill the above path, so some reference to the modifier
in the "Settings" struct would be necessary, which would create a
convoluted layout in the `ModifierData` struct.

Instead, this commit simply removes the "Settings" struct from RNA,
which isn't as elegant from the point of view of the Python API,
but otherwise it's a nice simplification. Note that we don't remove the
"Settings" struct from DNA, because it would break reading old files.

Differential Revision: https://developer.blender.org/D10175
2021-01-25 11:46:55 -06:00
Ray Molenkamp
51c433f1a5 Windows: Remove zero terminator from stack trace
Important lesson to be learned here, leaving comments
is great and in the moment, they usually make sense.

Many months later they may not quite make as much sense
any more and time will have to be spend to figure out
what was meant, all of this would have been averted with a
better comment.

The zero terminator in this case, I can find no evidence
of it being used or relied on at any point. It does however
break GTests's `EXPECT_EXIT` macro that stops looking in
the output as soon as it sees the zts and doesn't end up
looking at the actual assert text being thrown. Which in
turn makes the`fcurve_active_keyframe`test fail when run
in debug mode on windows.
2021-01-25 08:50:37 -07:00
Jacques Lucke
8a77019474 Cycles: modernize usage of rna iterators
Using rna iterators in range-based for loops is possible since {rBc4286ddb095d32714c9d5f10751a14f5871b3844}.

This patch only updates the places that are easy to update
without more changes in surrounding code.

Differential Revision: https://developer.blender.org/D10195
2021-01-25 16:25:27 +01:00
Brecht Van Lommel
04f91bce53 Fix build error after Cycles Amembic procedural commit 2021-01-25 16:15:35 +01:00
Kevin Dietrich
b64f0fab06 Cycles: internal support for Alembic procedurals
The implementation is currently optimized to load animation sequences once
and then quickly scrubbing through them. Later on an option should be added
to optimize for memory usage and only load the current frame into memory.

Currently mesh and curve objects are supported, including support for UV and
vertex color attributes. Missing still is support for arbitrary attributes and
motion blur, as well as better handling of changing topology. Shader assignments
are made using FaceSets found in the Alembic archive.

The animation (and constant) data of the objects inside the Alembic archive is
loaded at once at the beginning of the render and kept inside a cache. At each
frame change we simply update the right socket of the corresponding Cycles node
if the data is animated. This allows for fast playback in the viewport
(depending on the scene size and compute power).

Note this is not yet exposed in the Blender UI, it's a feature that is still under
development and not ready for general use.

Ref T79174, D3089
2021-01-25 15:51:42 +01:00
Kevin Dietrich
2e67191c86 Cycles: internal support for the concept of procedurals
Procedurals are nodes in the scene that can generate an arbitrary number of
other nodes at render time. This will be used to implement an Alembic procedural
that can load an Alembic file into Cycles nodes. In the future we also expect to
have a USD procedural.

Direct loading of such files at render time is a standard feature in other
production renderers. Reasons to support this are memory usage and performance,
delayed loading of heavy scene data until rendering, Cycles standalone rendering
using standard file formats beyond our XML files, and shared functionality for
Cycles integration in multiple 3D apps.

Ref T79174, D3089
2021-01-25 15:51:38 +01:00
Kevin Dietrich
3656fc3aee Cleanup: move code to find geometry shaders into own function
Ref D3089
2021-01-25 15:48:39 +01:00
Bastien Montagne
2a81d948ad LibOverride: refactor of relationships handling in library overrides.
First step towards a better handling of relationships between IDs in
override context, especially when a resync is needed.

First, introduce a new flag to override operations,
`IDOVERRIDE_LIBRARY_FLAG_IDPOINTER_MATCH_REFERENCE`, for ID pointers.
It keeps track of whether an RNA ID pointer has been kept to its
'natural overriden ID' (in override hierarchy context), or has actually
been re-assigned to some other data-block.

Second, refactor how we deal with relationships between IDs in override
hierarchy code, especially in resync case. This will fixe several cases
listed in T83811, especially the case where an ID pointer to an existing
override needs to be updated to a new one due to a matching change in
linked data.
2021-01-25 14:48:51 +01:00
Julian Eisel
5c490bcbc8 Fix T85027: Crash dragging a collection over empty Outliner
Filtering may make the Outliner tree empty. The function to find the drop
element should just return null then and let the caller decide how to deal with
it.
2021-01-25 14:37:24 +01:00
Brecht Van Lommel
ef6d652428 Fix T83344: Cycles baking with progressive refine fails on GPU 2021-01-25 14:27:01 +01:00
Germano Cavalcante
f226687bb9 Cleanup: Knife Tool: Remove redundant 'view3d_operator_needs_opengl' calls
This function sets the `RegionView3D` matrices to the GPU.
But the OpenGL library is not actually being used by the operator.
2021-01-25 10:07:50 -03:00
Germano Cavalcante
4792d988fb Fix T84964: Crash when running Knife Project in the background
Although the Knife Project operator converts 3D coordinates to screen
space, it doesn't really need opengl.

Differential Revision: https://developer.blender.org/D10178
2021-01-25 10:07:50 -03:00
Campbell Barton
e9a47223cb Merge branch 'blender-v2.92-release' 2021-01-25 23:48:00 +11:00
Campbell Barton
4bc7996e2e Merge branch 'blender-v2.92-release' 2021-01-25 23:47:56 +11:00
Campbell Barton
72a207de35 Merge branch 'blender-v2.92-release' 2021-01-25 23:47:52 +11:00
William Reynish
601b690a24 Fix T84911: Add Primitive and IC keymap - 3d navigation conflict
Ref D10176
2021-01-25 23:46:57 +11:00
William Reynish
da2955fdf6 UI: improve categorization in Grease Pencil Layers sub-panels
The "Layers" panel for Grease Pencil objects uses sub-panels to organize
their properties in categories. Currently, this isn't so clear.
This patch cleans up these sub-panels with clearer categorization.

Reviewed By: #grease_pencil, antoniov, Blendify, HooglyBoogly

Ref D10184
2021-01-25 23:41:00 +11:00
Jeroen Bakker
7a005fb7d1 Fix T84324: Crash when combining two scenes in compositor.
In the CompositorOperation::deinitExecution the viewer could be freed at
the same time it was drawn in the image editor or node editor. There is
a guard for that but wasn't added during the migration of the two
editors to the draw manager.
2021-01-25 12:44:18 +01:00
Jeroen Bakker
dd2b616320 Buildbot: Fixed crash when building RC builds
Building RC builds would parse `BLENDER_VERSION_CYCLE_NUMBER` that
doesn't exist anymore. It was removed by {D7748}.

This change removes it from `buildbot_utils.py`.
2021-01-25 11:53:35 +01:00
Sergey Sharybin
06fdbe6664 Merge branch 'blender-v2.92-release' 2021-01-25 11:36:31 +01:00
Sergey Sharybin
fba35a02c6 Fix padding issue in DNA
Was introduced in the previous change in the image.
2021-01-25 11:35:29 +01:00
William Reynish
5f2c5e5bb8 UI: object context menu tweaks for consistency
Currently, the object context menu includes some inconsistencies
between object types. This is a small patch that fixes these.

- Adds the same ability to Join and Set Origin
  to all supported object types.
- Adds Set Active Camera for cameras.
- Adds Adjust Stroke Width for GP Objects.
- Adds Trace Image to Grease Pencil for Image Empties.

Reviewed By: #grease_pencil

Ref D10144
2021-01-25 21:28:39 +11:00
Jeroen Bakker
ebaa3fcedd Fix T84398: Multiview images show only one view.
The `image_get_gpu_texture` didn't use the iuser->view_index but
recalculated the requested view again. This lead to inconsistent
behavior when switching between multi view textures or stereo textures.

This has been fixed by ensuring that the `iuser->view_index` is always
used.

An Image has only place to store 2 view textures. This is done for
right/left eye compositing. A multi view texture can have more views.
This would lead to reading and writing to unallocated space.

When a multiview texture is requested that is larger than 1. It will
always be cached as being the first eye. The `gpu_view` of the Image is
also used as a cache key to check this.
2021-01-25 11:27:55 +01:00
Sergey Sharybin
7cb65a1e67 Fix T84990: Proportional Editing falloff drawing for masks in MCE is broken
This got broken in 4b1112c8c96. A fix which will be consistent with image
editor is not obviously clear, so for the time being revert the change and
go back to state which was working for a long time.
2021-01-25 11:10:42 +01:00