Commit Graph

102904 Commits

Author SHA1 Message Date
Campbell Barton
0d042c8cca RNA: document Python instancing for ID's and RNA types
Document some of the less obvious implications for
re-using Python instances.
2021-01-07 21:36:39 +11:00
Campbell Barton
4a771263fd Outliner: use the scene ID for ObjectBase PointerRNA
While this didn't cause any problems, `Base` structs are part of the
scene which is being set in other uses of this type.
2021-01-07 16:20:08 +11:00
Yevgeny Makarov
dd0df3c5d2 UI: Fix various issues with UI text
- Use the name "Point Cloud" instead of "Pointcloud"
 - Fix a typo in UV_OT_smart_project.
 - Use the name "Install Light" to for the installation
   operator for MatCaps, HDRIs, and Studio Lights.

Fixes T83585, T65291, and T54921

Differential Revision: https://developer.blender.org/D9867
2021-01-06 22:54:10 -06:00
Campbell Barton
2dfd117ab5 Fix memory leak duplicating a scene with "Copy Settings" 2021-01-07 15:04:26 +11:00
Campbell Barton
a9dea9cfaa PyAPI: don't raise & clear exceptions when setting context members
BPY_context_dict_clear_members_array used PyDict_DelItemString
which raised & cleared the exception when the key didn't exist.

Even though setting/clearing the exception is supported,
it's worth avoiding where possible as it adds some overhead as well as
overwriting the previous error which can free PyObject's which are
unrelated to the code being executed.

Possible fix for T82552, crashing on Windows when setting the exception.
2021-01-07 14:41:52 +11:00
Campbell Barton
f35a38fba7 Fix BKE_blender_atexit_unregister error removing from linked list
This is an old bug exposed by having multiple atexit calls since
c65c4149c9be8a1811eb389f657216fab071dfc5.
2021-01-07 13:31:57 +11:00
Aaron Carlisle
27426c05b1 PyAPI Docs: Link to user docs instead of describing in API doc 2021-01-06 19:52:13 -05:00
Aaron Carlisle
b138c8f5b3 PyAPI Docs: Update Indirect Data Access docs
Fixes T84432
2021-01-06 19:34:21 -05:00
Aaron Carlisle
a9c607e60e PyAPI Docs: Fix wrong modifier path usage
Fixes T84430
2021-01-06 18:54:56 -05:00
Aaron Carlisle
133bdac306 PyAPI Docs: Clarify quick start guide tips
Some of the text here was outdated with 2.8x.
See T84427
2021-01-06 18:45:34 -05:00
Philipp Oeser
211e161d76 Fix T84416: Vertex color baking checks for UVMap
Since the introduction in rB2221389d6e8e, baking to vertex colors would
still check for the existence of a valid UVMap (as if baking to image
textures).

Now check for vertex colors instead if target is
R_BAKE_TARGET_VERTEX_COLORS.

Maniphest Tasks: T84416

Differential Revision: https://developer.blender.org/D10006
2021-01-06 22:26:20 +01:00
Hans Goudey
6ea01dc509 UI: Use the 3D cursor icon for the RNA struct
Since there is a specific icon to represent the 3D cursor it makes sense
to add it to the RNA struct. This struct's icon is only displayed in the
Data API section of the outliner.
2021-01-06 14:00:44 -06:00
Bastien Montagne
3028de9527 UndoType: Refactor: replace use_context boolean by a bitflag.
We will soon need more options here, sinmpler and cleaner to use a
bitflag then.
2021-01-06 18:07:09 +01:00
Falk David
5cdf279ef4 Fix T84420: Linking regular materials to gpencil
When using "Make Links"->"Materials" regular materials could be linked
onto grease pencil objects. This caused a number of issues.

The fix changes the `allow_make_links_data` function to make sure that
if one object is of type `OB_GPENCIL`, the other has to be aswell.

Reviewed By: antoniov

Maniphest Tasks: T84420

Differential Revision: https://developer.blender.org/D10014
2021-01-06 17:54:44 +01:00
Bastien Montagne
6672cbeb23 Fix T84202: Sculpt lasso mask crash after remesh.
'Caused'/revealed by rBd29a720c45e5: Operators that fully re-create the
mesh would previously rely on `sculpt_update_object` called from update
code to get required sculpt-specific data layers re-added to the new
mesh.

Now instead put all code adding data to orig mesh for sculpt purpose
into a new util function (`BKE_sculpt_ensure_orig_mesh_data`), and call
that function when entering sculpt mode, and from voxel remesher code.

This is contonuing effort to more clearly separate orig data from evaluated
data handling/usage in sculpt code.

TODO: there are likely other code paths that would need to call that
new function?

Reviewers: @sergey, @pablodp606

Subscribers:
2021-01-06 16:25:39 +01:00
Bastien Montagne
a584aef470 Undo: Further tweak/fixes the 'use context' flag of undo types.
Note that this is fairly fragile still, especially in cases like paint
cureve undo, which actually does not use context in most cases (and can
be called with a NULL context), but do need it in one case. This will
need a proper rework at some point.
2021-01-06 15:59:23 +01:00
Campbell Barton
691c021679 Fix T82952: Crash changing mesh data block and switching scenes
Regression in 33ac3582bbd5551bdfbc7ef8856640b5e61888f8.
2021-01-07 01:35:05 +11:00
Campbell Barton
f0071dfa10 Fix T79779: Pick shortest UV face-path ignores sticky setting 2021-01-07 00:37:05 +11:00
Bastien Montagne
0e4f8ed90e UndoType: Fix some incinsistencies re context usage flag.
`use_context_for_encode` was not properly set regarding actual `encode` code for a few types.
2021-01-06 14:11:25 +01:00
Jeroen Bakker
eb1ff4b3a4 Cleanup: CodeStyle format 2021-01-06 13:55:27 +01:00
Jeroen Bakker
1c72a2f47d Cleanup: CodeStyle Format 2021-01-06 13:54:12 +01:00
Campbell Barton
967cf303f3 Fix T83372: Point.select can be True when unselected 2021-01-06 23:27:03 +11:00
Bastien Montagne
bc3e38ca3a Cleanup/refactor: UndoType: Clarify use_context variable.
Rename it to mark it is only for `encode` callbacks, fix `encode`
callback of text undo to early fail in case it gets a NULL context, add
an assert to `BKE_undosys_step_push_with_type` that context is not NULL
when undotype requires a valid one.

Note that in practice this should not change anything, currently it
seems that we always get a valid context in
`BKE_undosys_step_push_with_type`?
2021-01-06 12:28:06 +01:00
Julian Eisel
4e23f08807 Fix object moved to cursor when editing last operation after dropping object
Steps to reproduce were:
* Drag object icon from the Outliner into the 3D view (or an object asset from
  the Asset Browser)
* Open the "Adjust Last Operation" panel
* Edit options in there - the object would move to the mouse location

The same issue happens with collection instance and object data adding (e.g.
via drag & drop). This patch addresses them too.

The operator used the event state stored in the window. This shouldn't be
accessed from the operator execute callback generally which happened here.
Especially not if the operator supports editing properties.
2021-01-06 11:55:21 +01:00
Philipp Oeser
290b6d7ef3 Fix T70316: Custom "Delete Keyframes" shortcut still requires
confirmation

Deleting keyframes in the dopesheet or graph editor always required
confirmation, even if used ouside of the "Delete" menus.

Now add a "confirm" option [same as for deleting objects], which can be
disabled for immediate keyframe deletion.

This will also change the default behavior and bring this in line with
how object deletion works so there is one shortcut for bringing up the
menu/confirmation and another shortcut to delete immediately without
requiring confirmation / another click:

- Blender Default keymap: "X" for menu, "Del" for immediate
- Industry Compatible: "Backspace" for menu, "Del" for immediate

Maniphest Tasks: T70316

Differential Revision: https://developer.blender.org/D9651
2021-01-06 11:35:06 +01:00
Campbell Barton
4b56c18290 Fix T84426: Limit dissolve ignores selection with custom normals
Regression in 9969c2dd165c7d8ffe607a5a050a80aa59ac50be.

Add note that custom normal calculation functions write into to tags.
2021-01-06 19:04:53 +11:00
Campbell Barton
947dc92083 BMesh: assert when a mesh has two kinds of shake-key data
Assert with comment to avoid confusion caused by
mixing two kinds of shape-key data.

This problem was exposed when investigating T84364.
2021-01-06 18:11:46 +11:00
Yevgeny Makarov
5424b4821d Fix T83094: Alternate rows in the Sequencer are green (macOS)
The issue is that `UI_GetThemeColorBlendShade4fv()` creates a color
with alpha, but there is not any background underneath to blend in with.

The solution is just to draw an opaque background first, which also
halves the number of rects to draw. Note that the brighter rows get
very slightly darker after this change.

Differential Revision: https://developer.blender.org/D9947
2021-01-05 14:21:54 -06:00
Pablo Dobarro
2ed6055209 Fix T79146: Sculpt Mode lags until the entire mesh is visible
This was caused when the BKE_pbvh_draw_cb function was used with
update_only_visible set to false. In that case, all nodes with the flag
were updating, but the update flag was only cleared for visible nodes.
This was causing constant updates per redraw in no visible nodes until
they enter the view frustum and their flag was cleared.

In order to fix this and prevent it from happening again:
 - Updating the buffers, flushing the updates and clearing the flags are
now part of the same function. It does not make sense to do these in
separate places.

 - The BKE_pbvh_draw_cb function was refactored so the
pbvh_update_draw_buffers is only called once. It should now be easier to
understand what the function does when it is used to update only visible
nodes or all nodes.

Reviewed By: mont29

Maniphest Tasks: T79146

Differential Revision: https://developer.blender.org/D9935
2021-01-05 20:23:41 +01:00
Hans Goudey
c20e482714 Fix T78681: "Add Primitive" icons are cropped in tool header
The issue can be simply resolved by moving the primitives and plus
icons slightly. They still bump up against the top and bottom of the
header but it looks much better now.
2021-01-05 13:00:35 -06:00
Hans Goudey
4ade409a87 Cleanup: Reduce variable scope 2021-01-05 12:22:23 -06:00
Patrick Mours
3373d14b1b Fix T83925: Crash when rendering on the CPU with OptiX denoiser enabled
Rendering on the CPU uses the Embree BVH layout, whether the OptiX denoiser is enabled or not.
This means the "build_bvh" function gets a "BVHEmbree" object to fill and not a "BVHMulti" as it
was assuming before, which caused crashes due to memory geting overwritten incorrectly. This
fixes that by redirecting Embree BVH builds to the Embree device.

Manifest Tasks: T83925
2021-01-05 18:37:31 +01:00
Bastien Montagne
491a9e9ec4 Cleanup: Undo code: poll function.
Remove obviously outdated comment, and explictely set `poll` to `NULL`
in the one case it is not actually defined (sculpt undo).
2021-01-05 18:21:09 +01:00
Bastien Montagne
90a26f900c Cleanup: UndoType: use size_t for memory size of structs. 2021-01-05 18:21:09 +01:00
Patrick Mours
166c0db3f9 Fix T83915: Subdivision Surface modifier causes visual artifacts in Cycles rendered viewport - CPU and OptiX
Changing the geometry in the current scene caused the primitive offsets for all geometry to
change, but the values would not be updated in all bottom-level BVH structures. Rendering
artifacts and crashes where the result. This fixes that by ensuring all BVH structures are
updated when the primitive offsets change.
2021-01-05 17:59:38 +01:00
Philipp Oeser
da9d471e1d Fix T84389: RGB Curves node shows "tone" option outside of compositor
Since the introduction in rB4de7c0c3105a, the option is only used in the
compositor, it has no effect elsewhere [texture nodes, shader nodes].

Now only show the option for the compositor.

Maniphest Tasks: T84389

Differential Revision: https://developer.blender.org/D10005
2021-01-05 17:04:56 +01:00
Jacques Lucke
583006d0ef Cleanup: clang tidy 2021-01-05 17:04:02 +01:00
Jacques Lucke
39f99fd05c Fix: tried to set error message on modifier that does not exist
Without this, the example file in T83730 crashes in a debug build
when deleting the hair edit bake in the particle settings.
2021-01-05 16:50:23 +01:00
Jeroen Bakker
9dbea1db66 Compositor: Alpha Mode
{D9211} introduced pre-multiplying the color for the keying node. This
pre-multiplication should also be done by other keying nodes and should be
the default operation for alpha node.

This patch will change the logic of keying nodes (Cryptomatte Node,
Channel Matte, Chroma Matte, Color Matte, Difference Matte, Distance
Matte, Luminance Matte) and breaks old files.

The Set alpha node has a mode parameter. This parameter changes
the logic to `Apply Mask` the alpha on the RGBA channels of the input color
or only replace the alpha channel (old behavior).

The replace mode is automatically set for older files. When adding
new files the the multiply mode is set.

Reviewed By: Sergey Sharybin

Differential Revision: https://developer.blender.org/D9630
2021-01-05 16:34:55 +01:00
Jacques Lucke
357e519575 Fix T83282: division by zero when creating psys tasks 2021-01-05 16:17:37 +01:00
Jeroen Bakker
cffa39358f Cleanup: Compositor comment style 2021-01-05 15:50:58 +01:00
Philipp Oeser
36ae6e66c1 Fix T84367: Fix crash when showing invalid/legacy constraints
Exposed by rBeaa44afe703e.

Definition for CONSTRAINT_TYPE_NULL is not totally clear (it is set for
constraints without data, see an old comment from Ton), but for these, a
TypeInfo cannot be fetched.

Avoid processing those constraints in UI code, just do nothing instead.

Maniphest Tasks: T84367

Differential Revision: https://developer.blender.org/D9987
2021-01-05 15:31:40 +01:00
Jeroen Bakker
1f41bdc6f3 Eevee Cryptomatte: Store hashes in render result meta data
Stores cryptomatte hashes as meta data to the render result. Compositors could
use this for lookup on names in stead of hashes.

Differential Revision: https://developer.blender.org/D9553
2021-01-05 15:03:05 +01:00
Jeroen Bakker
7cd6f667e3 Fix T84053: Mask overlay in image editor not working
The mask overlay wasn't part of the overlay engine. The reasoning nehind
this was that more editors used the mask overlay and most of them used
old drawing code. This patch adds the mask overlay drawing to the draw
overlay engine. This code path will only be used by the image editor
VSE, Compositor and Movie Clip editor will still use the previous
method.

During this patch some alternatives have been researched:
1. `ED_mask_draw_region`: this would lead to different code paths when
   drawing in the image editor, and some hacks to retrieve the correct
   framebuffer.
2. Add mask drawing to image engine: Would lead to incorrect color
   management when viewing the mask.
3. Add mask drawing to image engine and overlay engine: Would lead to
   duplicated code.
4. Add mask drawing to overlay engine and for combined overlay select
   the correct framebuffer.

Option 4 was chosen as the exception (switching framebuffers) can be
done without hacks. The code stays clean.
2021-01-05 13:53:33 +01:00
Germano Cavalcante
f41de6dc46 Fix T84404: Crash when using Skin Resize in mesh without Skin modifier
Caused by rB54ee4109143b

Before that commit `TD_SKIP` was marked for all vertices.

Now skip the whole operation as all vertices are skipped.
2021-01-05 09:46:07 -03:00
Philipp Oeser
fab772860d Asset browser: workspace in the wrong category
Workspaces [FILTER_ID_WS] were in the `Environment` category
IDFilterBoolean, whereas they are in the `Miscellaneous` category in
`rna_def_fileselect_asset_params`.

Make this consistent ['Miscellaneous'] in both cases.

(note this was already done in rB2c317457cbf2 for the file browser case)

Spotted while looking into T83983.

Maniphest Tasks: T83983

Differential Revision: https://developer.blender.org/D9911
2021-01-05 13:30:51 +01:00
Campbell Barton
acfa7b102b Sculpt: use distance threshold for dyntopo symmetrize
This was only used for non-dyntopo symmetrize.
There is no reason to use a hard-coded value in this case.
2021-01-05 23:19:34 +11:00
Campbell Barton
1f6846fa4e Cleanup: remove UNUSED(..) from public function declarations
This doesn't serve any purpose and can become out of sync
with the function it's self without reporting warnings.
2021-01-05 23:09:50 +11:00
Campbell Barton
e4884d224c Cleanup: remove redundant RNA_types.h header from UI_interface.h 2021-01-05 23:04:51 +11:00
Campbell Barton
105d385e4b Fix T84364: Sculpt symmetrize fails with shape keys
Use the BMesh symmetrize operator instead of using the modifier code.

While we could support shape-keys with the existing code used by the
mirror modifier, we'd need to add code-paths for evaluated mesh & bmesh
conversion to handle shape-keys differently just for this one case,
since we want to avoid copying & processing shape-keys layers for
evaluated meshes in general.
2021-01-05 22:48:12 +11:00