Commit Graph

66165 Commits

Author SHA1 Message Date
96e39af948 transform_snap_object: Fix snap to curves.
Use `BKE_curve_texspace_get` instead `BKE_curve_boundbox_get`.
The snap to curve, even out of edit mode, is not done on the displist. So test a boundbox that covers the points seens in edit mode.
2018-11-21 13:07:51 -02:00
cec83e92e6 Fix T57884: Triangle count is incorrect when above around 2 billion
Maniphest Tasks: T57884

Differential Revision: https://developer.blender.org/D3962
2018-11-21 16:34:32 +01:00
d3e686d61e Depsgraph: Update comment 2018-11-21 16:29:22 +01:00
2a354dd4bd Depsgraph: Allow flush of CoW tag from Action
This way we guarantee that action tagged for CoW will ensure
order of updates with objects which are using it.

Fixes T57870: Scaling keyframes in Graph Editor causes crash
Fixes T57971: Moving keys in the Dopesheet crashes with Segfault 11
Fixes T57530: Moving keys on a rig, Crash
Fixee T57491: Crash when trying to move keyframe in dope sheet
2018-11-21 16:21:24 +01:00
693233b198 Fix T57975: Drawing with Onion Skin enabled crash Blender 2018-11-21 15:53:45 +01:00
5e4ed2793b Depsgraph: Move boundbox sync to the post-geometry evaluation
Boundbox does not depend on transform and only need geometry
component.

This change solves possible race condition accessing geometry
data and allocating/assigning pointers.

Based on disacussion in IRC with @mano-wii and @brecht.
2018-11-21 15:04:18 +01:00
b6693f1f54 Depsgraph: Cleanup, use more clear name
Five years later since the original commit, is probably not so bad
timing on calling things by their clear name.
2018-11-21 14:52:42 +01:00
539b465b32 Implement basic global tablet pressure curve options.
Grease Pencil already implements support for full-featured
per-brush pressure curves, but it is useful to have some
basic global settings that affect all brushes and tools.

This adds two simple options:

- Raw pressure required to achieve full brush intensity.
- Softness control, using a gamma curve internally.

The most important one is the max pressure setting, because it is
critical for ergonomics, but the Linux Wacom driver lacks it.

The softness option internally converts to gamma = 4^-softness.

Reviewers: brecht, campbellbarton

Differential Revision: https://developer.blender.org/D3967
2018-11-21 16:34:07 +03:00
ed1ee89288 I18N: tweak some UI labels and tips. 2018-11-21 12:06:59 +01:00
638622971b I18N defaults: enable tooltip translation.
That is minimal change for now, we may want to fully enable i18n by
default...
2018-11-21 12:05:56 +01:00
3a64d7ca48 GP: Remove Target Weight switch 2018-11-21 09:03:17 +01:00
7de712e1e5 Fix uv-sculpt use w/ tool-system 2018-11-21 17:56:10 +11:00
77a80d9f2f Gizmo: show dial handle for unconstrained extrude
Now only show an arrow when extrude was constrained on an axis.
2018-11-21 17:15:53 +11:00
1a551328b4 Gizmo: set operator options before execution
Avoid setting all operator options every redraw,
instead set them before invoking.
2018-11-21 16:00:00 +11:00
6b6105a87e Gizmo: run invoke_prepare even when the gizmo isn't modal
This is useful for setting up state for gizmos that run
operators too.
2018-11-21 15:35:29 +11:00
67c3791f63 Object: minor changes to jump-to API
- Always select the jump-to object, even if it's active.
- Remove check for invalid object data
  (these cases will fail much earlier).
2018-11-21 13:07:36 +11:00
18593c7cd3 Cleanup: add reveal_hidden arg to jump-to API calls
Jumping to data shouldn't necessarily change hidden status
or visible layers.
2018-11-21 13:04:03 +11:00
a86a1292f3 Gizmo: workaround for extrude modifying normals for XYZ axis
This was done for the normal gizmo, but not the XYZ handles.
2018-11-21 12:58:06 +11:00
774471dd45 Fix custom matrix orientation being written to scene 2018-11-21 12:58:06 +11:00
ac5889a9ee Correct editbone root-select check
Mistake in recent commit.
2018-11-21 12:58:06 +11:00
63150511a2 Gizmo: use Y-axis for armature extrude on normal
For bones it's useful to extrude a bone aligned to the existing bone.
2018-11-21 12:14:28 +11:00
04d09014e9 Gizmo: set the extrude transform constraint matrix 2018-11-21 11:45:16 +11:00
5b45434be4 Transform: use root/tip for bone normal orientation
When there are no fully selected bones,
use the normal of bones which only have the root/tip selected as a
fallback.

Without this, the extrude gizmo isn't very useful
since extrude is often used with only the tip selected.
2018-11-21 11:32:08 +11:00
91e8509467 Cleanup: use boolean array for mirror modifier 2018-11-21 10:30:51 +11:00
19875439b5 Modifier: Mirror learns to bisect on plane
D3966 by @kioku w/ edits.

This adds bisect and flip options to mirror modifier.
2018-11-21 10:01:04 +11:00
6aa7cea3c2 Cleanup: rename extrude gizmo 2018-11-21 09:25:55 +11:00
d3a75c48fd Cleanup: move extrude gizmo to transform module
Since this is no longer mesh only, move out of mesh,
rename next.
2018-11-21 09:20:19 +11:00
34b9bd3a9b Gizmo: initial extrude support for non mesh types 2018-11-21 09:09:34 +11:00
c17cc4c0d8 Fix extrude tool redo
Redo operator properties weren't being set.
2018-11-21 08:20:22 +11:00
b7ee0912a7 Fix T57921: Crash when loading 2.7x .blend with scene without any render layer.
We need at least one view layer, always. :)
2018-11-20 21:50:46 +01:00
3a13b89296 Cleanup: unused args, indentation 2018-11-21 06:29:19 +11:00
176b0df920 Cleanup: gcc function type warning 2018-11-21 06:24:52 +11:00
a4a9123c33 GP: Refactor target weight paint
Now, the target weight is defined as the final maximum value with a new property and all fields have be moved to brush struct.
2018-11-20 20:05:37 +01:00
e63c947204 GP: Refactor drawing engine to single VBO
This is part of T57829.

Reduce the number of batches used to only one by shader type.  This reduces GPU overhead and increase a lot the FPS. As the number of batches is small, the time to allocate and free memory was reduced in 90% or more.

Also the code has been simplified and all batch management has been removed because this is not necessary. Now, all shading groups are created after all vertex buffer data for all strokes has been created using DRW_shgroup_call_range_add().

All batch cache data has been moved to the Object runtime struct and not as before where some parts (derived data) were saved inside GPD datablock.

For particles, now the code is faster and cleaner and gets better FPS.

Thanks to Clément Foucault for his help and advices to improve speed.
2018-11-20 20:05:37 +01:00
140d383393 Fix T57935: Crash Alt clicking w/ poly build tool 2018-11-21 05:25:52 +11:00
5aa728ec7e Cleanup: style 2018-11-21 05:25:52 +11:00
ec908beab3 GP: New option to paint a predefined weight
Enabling this option, the weight is set to the predefined value and not the result of the sum of the paint actions.
2018-11-20 18:12:04 +01:00
53d9ddf772 UI: Color Ramp: Add menu and functions to distribute color stops
Suggestion from Right-Click Select: https://blender.community/c/rightclickselect/Npcbbc/color-ramp-flags-auto-distribution-function

Differential Revision: https://developer.blender.org/D3965
2018-11-20 17:02:31 +00:00
23656d01d8 Merge branch 'master' into blender2.8 2018-11-20 18:01:13 +01:00
ec851efda9 Fix T57923: Freeze in mesh vnors computation code with some degenerated geometry.
Second part of the fix: do not try at all to compute normals in degenerated
geometry. Just loss of time and potential issues later with weird
invalid computed values.
2018-11-20 17:54:48 +01:00
c9c6433a59 Fix T57923: Freeze in mesh vnors computation code with some degenerated geometry.
Fix first part of it, the freeze itself being caused by float NAN values
never comparing equal to anything, not even themselves.
2018-11-20 17:52:21 +01:00
d2e473f01c GP: Reorganize Reproject options
The options depend of drawing mode and this was very strange. Now, the options are listed in the menu.
2018-11-20 16:29:33 +01:00
1824aad3f3 GP: Set Gizmo orientation for edit mode 2018-11-20 16:04:19 +01:00
4dc639ac99 Speedup rigs with multiple objects deformed by bbones
Previously each of the objects which has armature modifier will
request deformation matricies from bbones. Thing is, all those
deformations are the same and do not depend on object which is
being modified. What's even worse is that this calculation is
not cheap.

This change makes it so bbones deformation is calculated once
and stored in the armature object. After this armature modifiers
simply use it.

With a rigs we've got here dependency graph evaluation time
goes down from 0.02 sec to 0.012 sec.

Possible further optimization is to make bbone deformation
calculated at the time when bone is calculated. This will avoid
an extra threaded loop over all bones.
2018-11-20 15:53:59 +01:00
163be42a96 Cleanup: Use more const qualifiers 2018-11-20 15:07:38 +01:00
5c632ced53 Merge branch 'master' into blender2.8 2018-11-20 15:02:13 +01:00
01e8e7dc6d Task scheduler: Optimize parallel loop over lists
The goal is to address performance regression when going from
few threads to 10s of threads. On a systems with more than 32
CPU threads the benefit of threaded loop was actually harmful.

There are following tweaks now:

- The chunk size is adaptive for the number of threads, which
  minimizes scheduling overhead.

- The number of tasks is adaptive to the list size and chunk
  size.

Here comes performance comparison on the production shot:

 Number of threads        DEG time before        DEG time after
       44                     0.09                   0.02
       32                     0.055                  0.025
       16                     0.025                  0.025
       8                      0.035                  0.033
2018-11-20 14:58:17 +01:00
98bcd52ef2 Comment out all derived mesh evaluation
Seems all the usecases of derived mesh are if-defed already,
so no need to have API for it in place, and definitely no
need to waste CPU ticks on converting evaluated mesh to
derived mesh.
2018-11-20 14:54:16 +01:00
e81aca85cb Depsgraph: Don't use derived mesh
Ideally would need to make check based on evaluated mesh,
but is now a good time to go away from derived mesh.
2018-11-20 14:54:16 +01:00
fd926f0058 Modifier stack: Only ensure derived mesh when USE_DERIVEDMESH is defined
This is more an internal transition away from derived mesh.
2018-11-20 14:53:41 +01:00