Commit Graph

96427 Commits

Author SHA1 Message Date
Sergey Sharybin
98197343e8 OpenSubdiv: Cleanup, use C++ range based loop
Avoid indirection via define.
2020-05-27 12:07:16 +02:00
Sergey Sharybin
be03a756e5 OpenSubdiv: Cleanup, move utility function to base type conversion 2020-05-27 12:07:16 +02:00
Sergey Sharybin
0ff665e4ce OpenSubdiv: Refactor, move type conversion to base fodler 2020-05-27 12:07:16 +02:00
Sergey Sharybin
4886a704b3 OpenSubdiv: Refactor, move evaluator to own folder 2020-05-27 12:07:16 +02:00
Sergey Sharybin
6fc9d106ad OpenSubdiv: Completely disable topology verification
Previously it was enabled for debug builds, now it is to be enabled
explicitly.

The reason for this is to reduce overhead when debugging other areas
which might involve subdivision surface. When conversion is to be
debugged set this manually in the code.
2020-05-27 12:07:16 +02:00
Sergey Sharybin
0d089ce881 OpenSubdiv: Refactor, move edge map to base folder 2020-05-27 12:07:16 +02:00
Sergey Sharybin
4ab36c4393 OpenSubdiv: Refactor creation of topology refiner
Consolidate it inside of the topology refiner implementation class,
which would allow to store extra data acquired during construction
of the OpenSubdiv's object.
2020-05-27 12:07:15 +02:00
Sergey Sharybin
57aae2a355 OpenSubdiv: Refactor, use C++ allocation for internal classes
Only use OBJECT_GUARDED_{NEW. DELETE} for structures which are part of
public C-API (and hence can not have new/delete operators overloaded).

Could try being brave and override new/delete from under C++ ifdef.
2020-05-27 12:07:15 +02:00
Sergey Sharybin
c81a5f58f8 OpenSubdiv: Refactor, move topology refiner factory to topology folder 2020-05-27 12:07:15 +02:00
Sergey Sharybin
67fe31d751 OpenSubdiv: Refactor, move topology refiner to own folder
In the future factory will also be moved there.
2020-05-27 12:07:15 +02:00
Sergey Sharybin
7c0bea0d65 OpenSubdiv: Refactor, move device specific code to own files
Also, move all device files to own folder.

Makes it so checks for device availability are done in a localized
place.
2020-05-27 12:07:15 +02:00
Konrad Puklicki
e490dc4346 UI: Skip unnecessary cursor setting
Currently, in sculpting, weight paint and vertex paint modes every cursor
movement triggers redraw of a brush. During that redraw, native cursor is set.
Under the hood, setting the cursor causes freeing of previous cursor and
allocating a new one. In most cases, in previously mentioned modes, recreating
cursor is unnecessary since cursor stays the same.

This patch adds a check which skips cursor change if requested cursor is
already set. The check could be added in pain_cursor.c, but I felt adding it
inside WM_cursor_set function would hopefully skip more unnecessary cursor
reallocations.

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

Reviewed by: Julian Eisel
2020-05-27 12:06:35 +02:00
Dalai Felinto
bab5fbb66c Merge remote-tracking branch 'origin/blender-v2.83-release' 2020-05-27 12:01:04 +02:00
Dalai Felinto
1c3b2b5dd8 Fix T77105: Crashes when clicking "new scene" button
This was introduced on ecc395e473d.

Effectively this is reverting that commit for cases when
scene->toolsettings->sculpt is NULL. But since the facesets are only
working for sculpting this should be fine.
2020-05-27 12:00:00 +02:00
Stefan Werner
ecc15c55d4 Cycles: Upgraded Embree to version 3.10.0
Enabled round linear hair in Embree.

Differential Revision: https://developer.blender.org/D7623
2020-05-27 10:10:18 +02:00
Campbell Barton
7836242065 Cleanup: remove unused Main struct from snap context 2020-05-27 16:54:34 +10:00
Campbell Barton
355d129965 Gizmo: lazy initialize snap context
ED_gizmotypes_snap_3d_context_get could have returned NULL,
rename _get(..) to _ensure(..) and initialize the snap context
in this function.
2020-05-27 16:47:30 +10:00
Germano Cavalcante
1f7a791a53 Ruler: Implement Snap Gizmo
The snap point can now be viewed when activating the tool.
2020-05-27 00:16:32 -03:00
Germano Cavalcante
2e73e1390e Gizmo Library: New Snap Gizmo
Generic snap gizmo to be used for different tools.

The Gizmo can be configured initially by the following properties:
- `"snap_elements_force"`, `"prev_point"`

The following properties can be read as return:
- `"location"`, `"normal"`, `"snap_elem_index"`

This property can be linked to another (tool_setting.snap_elements):
- `"snap_elements"`

And this 3 extra utilities have been added:
- `ED_gizmotypes_snap_3d_draw_util`,
- `ED_gizmotypes_snap_3d_context_get`,
- `ED_gizmotypes_snap_3d_update`.

Differential Revision: https://developer.blender.org/D7071
2020-05-27 00:14:11 -03:00
Campbell Barton
7ed7901c00 Gizmo: add flag to disable tooltip
For some gizmos that follow the mouse cursor, this gets in the way.
2020-05-27 12:24:29 +10:00
Campbell Barton
43af0f4d16 Cleanup: pass const wm for WM_keymap_active 2020-05-27 12:09:52 +10:00
Campbell Barton
6c1cf395f2 Cleanup: remove unnecessary copy constructor
Caused deprecated-copy warnings as it wasn't used.
2020-05-27 11:50:54 +10:00
Campbell Barton
a739dc67ef Cleanup: sort file, structs 2020-05-27 10:52:07 +10:00
Campbell Barton
e5458fa4e5 Cleanup: warning 2020-05-27 10:52:00 +10:00
Nathan Craddock
a8551f93e6 Merge branch 'blender-v2.83-release' 2020-05-26 16:52:15 -06:00
Nathan Craddock
f772a4b8fa Fix: A few missing outliner selection sync tags
Add selection syncing for object add named (e.g. drag and drop from
outliner to 3D view), outliner right click (a sync when the context menu
is cancelled), and for object selection from Python.
2020-05-26 16:42:21 -06:00
Hans Goudey
eb5422828a Cleanup: Quiet unused variable warning in non-debug builds 2020-05-26 16:02:08 -04:00
Hans Goudey
5171d86806 UI: List Panel System
This implements a general system to implement drag and drop, subpanels,
and UI animation for the stack UIs in Blender. There are NO functional
changes in this patch, but it makes it relatively trivial to implement
these features for stacks.

The biggest complication to using panels to implement the UI for lists
is that there can be multiple modifiers of the same type. Currently there
is an assumed 1 to 1 relationship between every panel and its type, but
there can be multiple list items of the same type, so we have to break
this relationship. The mapping between panels and their data is stored
with an index in the panel's runtime struct.

To make use the system for a list like modifiers, four components
must be added:
1. A panel type defined and registered for each list data type, with a
    known mapping between list data types and panel idnames.
1. A function called by interface code to build the add the panel
    layouts with the provided helper functions.
    - UI_panel_list_matches_data will check if the panel list needs to
      be rebuilt.
    - UI_panels_free_instanced will remove the existing list panels
    - UI_panel_add_instanced adds a list panel of a given type.
3. An expand flag for the list data and implementations of
    get_list_data_expand_flag and set_list_data_expand_flag.
4. For reordering, the panel type's reorder callback. This is called
   when the instanced panels are drag-dropped. This requires
   implementing a "move to index" operator for the list data.

Reviewed By: Severin, brecht

Differential Revision: https://developer.blender.org/D7490
2020-05-26 15:39:49 -04:00
Cody Winchester
de257b6366 Modifiers: Add normalize weights option to vertex weight modifiers
Original patch by Cody Winchester (@CodyWinch), several fixes and
cleanup by Bastien Montagne (@mont29).

Differential revision: https://developer.blender.org/D7656
2020-05-26 20:56:27 +02:00
Pablo Dobarro
00674c12cc Merge branch 'blender-v2.83-release' 2020-05-26 20:49:53 +02:00
Pablo Dobarro
18f33f293b Fix Cloth Brush grab deformation mode
The grab mode was not correctly implemented, so the way it was working
was confusing for users.
- Grab delta was calculated in increments from the last stroke position, so it did not match the behavior of a grab brush. I refactored the grab delta calculation to make this change more explicit.
- Grab displacement was not calculated from the original coordinates
- Grab was using an incorrect strength

Grab is now setting the position of the affected vertices directly and
the constraints solve the rest of the cloth. I also tried to implement
an alternative version based on applying forces to move the vertices to
the grab position, but I think this is more controllable and the grab
falloff can be adjusted by tweaking the simulation falloff.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D7756
2020-05-26 20:48:46 +02:00
Pablo Dobarro
9aea7dc7c6 Fix Pose Brush origin position with large brush size
When the brush size is bigger than the entire mesh, fdata.tot_co can be
0, so the pose origin will default to (0,0,0), which does not make much
sense. After this patch, the pose origin will be set to the farthest
vertex from the pose origin, which at least should be in the surface of
the mesh and in most cases in the direction the pose brush was already
detecting the origin.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D7773
2020-05-26 20:45:20 +02:00
Pablo Dobarro
9b0f65c4a6 Fix naming in the PBVH neighbor iterator macro
The only possible name for the iterator was ni, this should fix that.

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D7774
2020-05-26 20:43:14 +02:00
Pablo Dobarro
5f63344e84 Fix PBVH API returning wrong normal when using shape keys and modifiers
The implementation of this function should match the one in
SCULPT_vertex_co_get. This does not solve the issue when sculpting with
modifiers active but I think this code is wrong

Reviewed By: sergey, brecht

Differential Revision: https://developer.blender.org/D7805
2020-05-26 20:40:27 +02:00
Julian Eisel
a2baf50242 Cleanup/refactor: Workspace API, boilerplate code, early exit
* Simplify workspace API a bit
* Comment on behavior of workspace-layout relations where exposed in API
* Remove annoying getters/setters
* Avoid lookups if we can early exit
* A NULL check is removed in `direct_link_workspace()` that I don't see
  a need for. Am not 100% sure though, fingers crossed.

In general these changes should improve readability and make things
easier to reason about.
2020-05-26 20:32:21 +02:00
Harley Acheson
1f223b9a1f UI: Windows Shell Links & Improved Mac Aliases
Adds support for Windows Shell Links (shortcuts) to the File Browser. Extended Mac Alias usage. Better visualization of linked items.

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

Reviewed by Campbell Barton
2020-05-26 08:15:50 -07:00
78eae89c39 Merge remote-tracking branch 'origin/blender-v2.83-release' 2020-05-26 16:44:35 +02:00
a1c9d42584 Fix T77021: Alembic export of animated mesh with multiple UV maps fails
This was caused by a side-effect of our exporting code's memory
management (Alembic considers data "written" and "final" when its C++
objects go out of scope) in combination with my change in
rB65574463fa2d. I removed an "only export UVs on the first frame" clause
because it was unclear why this restriction was there. As it turns out,
it breaks the export of the 2nd and subsequent UV maps on an animated
mesh. Effectively, on every frame the Alembic library thought we want to
create a new UV map, instead of continuing to write a new frame of data
to the existing one.

This is resolved by keeping a reference to the C++ objects for the UV
maps in memory while the exporter is running.
2020-05-26 16:42:01 +02:00
Germano Cavalcante
4102e7ed81 Fix T77032: Crash when creating GPUOffscreen without GPUContext in Python 2020-05-26 11:38:19 -03:00
Philipp Oeser
d8733539b7 Merge branch 'blender-v2.83-release' 2020-05-26 16:26:16 +02:00
Philipp Oeser
f3cf29ac96 Fix T77074: Collections: Exclude From ViewLayer toggle crashes
Consider this a bandaid fix (similar to rBe2724abc22d5).

Real issue seems to be that object is still in OB_MODE_PARTICLE_EDIT
whereas it should be in OB_MODE_OBJECT after toggling 'Exclude From
ViewLayer'. So while this patch prevents the crash, it leaves the object
in a weird state (it cannot be selected for example), needs further
investigation.

Maniphest Tasks: T77074

Differential Revision: https://developer.blender.org/D7843
2020-05-26 16:22:41 +02:00
Julian Eisel
4114e89020 Fix overlapping tabs placement when used in right Top-bar split
Didn't respect alignment rules for split layouts.

Reported in T77075.
2020-05-26 15:42:50 +02:00
Dalai Felinto
14b1c55e11 Cleanup: Remove uneeded NULL checks on ed_screen_context
view_layer should never be NULL.
2020-05-26 15:08:45 +02:00
Philipp Oeser
299682bde7 Merge branch 'blender-v2.83-release' 2020-05-26 15:04:17 +02:00
Philipp Oeser
d3275178fe Fix T77082: Greasepencil error accessing material dropdown on an object without materials
Differential Revision: https://developer.blender.org/D7841
2020-05-26 14:55:37 +02:00
Philipp Oeser
35bd596876 Merge branch 'blender-v2.83-release' 2020-05-26 14:53:19 +02:00
Philipp Oeser
2299f6b5a7 Fix T77049: VSE Image cache is not refreshed when strip are muted/
unmuted in metastrip

Maniphest Tasks: T77049

Differential Revision: https://developer.blender.org/D7834
2020-05-26 14:49:19 +02:00
Philipp Oeser
e790f1a8dc Merge branch 'blender-v2.83-release' 2020-05-26 14:24:50 +02:00
Julian Eisel
23520cbd13 Cleanup: Avoid mixing unlink-operator and menu name for ID-templates
The context menu name for `UILayout.template_ID_tabs()` would be passed
through multiple functions as `unlinkop`.
2020-05-26 13:28:21 +02:00
Julian Eisel
2a692e05c8 Fix T77075: Crash omitting optional UILayout.template_ID_tabs parameter 2020-05-26 12:56:53 +02:00