Commit Graph

14398 Commits

Author SHA1 Message Date
Campbell Barton
d35b14449e Cleanup: ensure one newline at end of file, strip trailing space 2021-07-15 17:53:26 +10:00
Hans Goudey
3b6ee8cee7 Refactor: Move vertex group names to object data
This commit moves the storage of `bDeformGroup` and the active index
to `Mesh`, `Lattice`, and `bGPdata` instead of `Object`. Utility
functions are added to allow easy access to the vertex groups given
an object or an ID.

As explained in T88951, the list of vertex group names is currently
stored separately per object, even though vertex group data is stored
on the geometry. This tends to complicate code and cause bugs,
especially as geometry is created procedurally and tied less closely
to an object.

The "Copy Vertex Groups to Linked" operator is removed, since they
are stored on the geometry anyway.

This patch leaves the object-level python API for vertex groups in
place. Creating a geometry-level RNA API can be a separate step;
the changes in this commit are invasive enough as it is.

Note that opening a file saved in 3.0 in an earlier version means
the vertex groups will not be available.

Differential Revision: https://developer.blender.org/D11689
2021-07-13 12:10:34 -04:00
Philipp Oeser
7b6c77aa84 Fix T88015: Round end caps on Freestyle lines not shaped as documented
This might be an artistic choice, but round end caps are supposed to be
a "half circle centered at the end point of the line" as documented
here: https://docs.blender.org/manual/en/dev/render/freestyle/
parameter_editor/line_style/strokes.html#caps

They are a shashed half circle instead.

This patch makes this pure half circles [and also fixes the case where
thickness of beginning was used for both beginning and end of the
stroke]

Maniphest Tasks: T88015

Differential Revision: https://developer.blender.org/D11340
2021-07-12 22:14:57 +02:00
Johnny Matthews
2a41ab5e6c Geometry Nodes: Curve Primitive Quadrilateral
This commit adds a curve primitive node for creating squares,
rectangles, trapezoids, kites, and parallelograms. It also includes
a mode where the four points are just vector inputs.

Differential Revision: https://developer.blender.org/D11665
2021-07-12 13:11:52 -04:00
Aaron Carlisle
62d9dabc7d UI: Clip: Fix checkbox wrongly greying out entire column
The Pattern and Search display options in the Clip Editor display settings
are independent and should not be grayed out since those options
remain relevant even with path display turned off.

Alternative solution were propoesed in D11630 and D11715
but each of those patches had downsides.
This solution is the simplest and does not break muscle memory.
2021-07-09 19:23:08 -04:00
Dalai Felinto
c749c24682 Walk Navigation: Z axis correction
Fly navigation has always had this option. They is particularly useful
when users use "Trackball" as their orbit method.

For walk navigation this works as a one off option. Not as a toggle like
for fly navigation.

Differential Revision: https://developer.blender.org/D11863
2021-07-09 15:03:50 +02:00
Sergey Sharybin
8dd941cac0 Tracking: Fix "Lock to Selection" option from header causing jump
This change makes the behavior consistent between shortcut and
option from space clip's header.

The only caveat is that the "Lock to Selection" is removed from the
Display popover. This is because it is rather hard to make operator
to render same as regular checkbox. However, shouldn't be a problem
because the setting in popover was redundant.

Differential Revision: https://developer.blender.org/D10423
2021-07-09 10:37:36 +02:00
Lukas Tönne
07faa3c5ac Nodes: Moved group interface panel code to python.
The node group interface panels were still implemented in C.
Now they ported over to python for easier maintenance.

Differential Revision: https://developer.blender.org/D11834
2021-07-09 07:57:29 +01:00
Philipp Oeser
d0c5c67e94 Make Single User: support object data animation
In addition to _object_ animation, now _object data_ (mesh, curve, ...)
animation can now be made single user as well.

This came up in T89369 and while it is possible to do this via the
Outliner [where all actions have to be selected individually], this
seems to be more convenient to be done from the 3DView.

note: usercount of the action is checked now, if it single-user already,
no copy takes place (same thing could/should be done for
single_object_action_users as well).

note2: obdata is made single user as well (otherwise duplicated actions
will be assigned to the same shared obdata - which does not result in
unique animadata which is what we are after here)

ref. T89369

Maniphest Tasks: T89369

Differential Revision: https://developer.blender.org/D11683
2021-07-09 08:09:43 +02:00
Hans Goudey
0b1050bf09 Geometry Nodes: Rename nodes for clarity between mesh and curve
Rename the mesh circle to "Mesh Circle", mesh line to "Mesh Line",
and mesh subdivide to "Mesh Subdivide". Previously they looked exactly
the same in the search menu, and the nodes themselves had the same
label. This is a "deep" rename that also renames internal defines and
function names to match the UI.
2021-07-06 23:00:27 -05:00
Angus Stanton
63a8b3b972 Geometry Nodes: Curve Endpoints Node
This node is quite similar to the curve to points node, but creates
points for only the start and end of each spline. This is a separate
node because the sampling from the curve to points node don't apply,
and just for ease of use.

All attributes from the curves are copied, including the data for
instancing: tangents, normals, and the derived rotations. One simple
use case is to make round caps on curves by instancinghalves of a
sphere on each end of the splines.

Differential Revision: https://developer.blender.org/D11719
2021-07-06 22:24:04 -05:00
Richard Antalik
4e80573a76 VSE: Use snapping settings for scrubbing
Use "Snap Playhead to Strips" option to enable playhead snapping.
Change behavior of CTRL key to invert snapping similar to transform operator.

Currently this option is disabled by default. It makes editing quite unpleasant
for me personally, but ideally I should gather feedback from more users.

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D11745
2021-07-07 03:26:14 +02:00
1364f1e35c Fix T89592: Can't remove keyframes without active keying set
Partially revert 7fc220517f87a2c40a4f438a50485233ae6ed62f, as it
introduced two issues:

- Deleting keys without active keying set was no longer possible, and
- there was no more confirmation popup.

Pressing {key Alt I} in the 3D Viewport now executes
`ANIM_OT_keyframe_delete_v3d`, adjusted to suit both T88068 and T89592:

- If there is an active keying set, delete keys according to that keying
  set.
- Otherwise, behave as `ANIM_OT_keyframe_delete_v3d` did before, that
  is, delete all keyframes of the selected object and in pose-mode also
  of selected bones.
2021-07-06 18:20:26 +02:00
Campbell Barton
432bfbf7a3 Cleanup: pep8 2021-07-06 12:05:27 +10:00
Johnny Matthews
29d6750134 Geometry Nodes: Curve Primitive Line
This node creates a poly spline line in one of 2 modes:
 - Line between two points
 - Start Point, Direction, and Length

Both modes create splines with only start and endpoints.
A resample node can be used afterward to increase the point count.

Differential Revision: https://developer.blender.org/D11769
2021-07-05 12:27:12 -05:00
Nikhil Shringarpurey
fd0370acc2 Geometry Nodes: Add explicit Float to Int conversion node
This patch adds a very simple node that explicitly converts a float to
an int. While this may seem redundant, it would offer 2 benefits to the
current requirement to use implicit float conversions:
 1. It makes the node tree's intent more clear and self-documenting
    (especially if changes in the future require integer inputs).
 2. It eliminates undefined behavior in current/future nodes from float
    inputs by guaranteeing that the input is an integer.

The node offers a variety of rounding techniques to make it more flexible.

Differential Revision: https://developer.blender.org/D11700
2021-07-05 11:52:10 -05:00
Campbell Barton
416e006a2a Cleanup: use 'use_' prefix for RNA booleans 2021-07-05 22:02:57 +10:00
Jacques Lucke
9009ac2c3d Geometry Nodes: new Viewer node
This adds a viewer node similar to the one in the compositor.
The icon in the headers of nodes is removed because it served
the same purpose and is not necessary anymore.

Node outputs can be connected to the active viewer using
ctrl+shift+LMB, just like in the compositor. Right now this collides
with the shortcut used in the node wrangler addon, which will
be changed separately.

As of now, the viewed geometry is only visible in the spreadsheet.
Viewport visualization will be added separately.

There are a couple of benefits of using a viewer node compared
to the old approach with the icon in the node header:
* Better support for nodes that have more than one geometry output.
* It's more consistent with the compositor.
* If attributes become decoupled from geometry in the future,
  the viewer can have a separate input for the attribute to visualize.
* The viewer node could potentially have visualization settings.
* Allows to keep "visualization points" around by having multiple
  viewer nodes.
* Less visual clutter in node headers.

Differential Revision: https://developer.blender.org/D11470
2021-07-05 10:46:36 +02:00
Alexander Gavrilov
bc8ae58727 Copy Transforms: implement Remove Target Shear and more Mix options.
This constraint can be naturally viewed as a prototype for a future
4x4 matrix math node (or subset thereof), since its basic semantics
already is matrix assignment. Thus it makes sense to add math options
to this constraint to increase flexibility in the meantime.

This patch adds support for several operations that would be useful:

- An option to remove shear in the incoming target matrix.

  Shear is known to cause issues for various mathematical operations,
  so an option to remove it at key points is useful.

  Constraints based on Euler like Copy Rotation and Limit Rotation
  already have always enabled shear removal built in, because their
  math doesn't work correctly with shear.

  In the future node system shear removal would be a separate node
  (and currently Limit Rotation can be used as a Remove Shear constraint).
  However removing shear from the result of the target space conversion
  before mixing (similar to Copy Rotation) has to be built into
  Copy Transforms itself as an option.

- More ways to combine the target and owner matrices.

  Similar to multiple Inherit Scale modes for parenting, there are
  multiple ways one may want to combine matrices based on context.
  This implements 3 variants for each of the Before/After modes
  (one of them already existing).

  - Full implements regular matrix multiplication as the most basic
    option. The downside is the risk of creating shear.
  - Aligned emulates the 'anti-shear' Aligned Inherit Scale mode,
    and basically uses Full for location, and Split for rotation/scale.
    (This choice already existed.)
  - Split Channels combines location, rotation and scale separately.

  Looking at D7547 there is demand for Split Channels in some cases,
  so I think it makes sense to include it in Copy Transforms too, so that
  the Mix menu items can be identical for it and the Action constraint.

Differential Revision: https://developer.blender.org/D9469
2021-07-02 15:15:05 +03:00
Richard Antalik
519c12da41 VSE: Snapping feedback
Address initial feedback:
 - Use checkboxes instead of radio buttons
 - Hide snapping distance control from UI
 - Tweak snapping line color - use selected strip color, 50% transparency. Similar to other editors
 - Draw 2px thick line, since strip outline is also 2px thick

Reviewed By: HooglyBoogly

Differential Revision: https://developer.blender.org/D11759
2021-07-01 22:08:11 +02:00
Johnny Matthews
c1fc180861 Geometry Nodes: Curve Primitive Circle
This node has two modes: the first mode computes a circle from three
locations and a resolution. The second takes radius and resolution.
The first mode also outputs the center of the computed circle as
a vector.

Differential Revision: https://developer.blender.org/D11650
2021-06-30 19:22:13 -05:00
Johnny Matthews
8884d2d61b Geometry Nodes: Curve Primitive Bezier Segment
Creates a Curve with 1 Bezier Spline from four positions (start,
start handle, end handle, end) and a resolution. The handles are
aligned and mirrored automatically. An "Offset" mode is also included
to allow specifying the handles relative to the control points.

The default settings recreate the existing default Bezier Curve in the
3D viewport add menu.

Differential Revision: https://developer.blender.org/D11648
2021-06-30 00:03:55 -05:00
Johnny Matthews
d3788207aa Geometry Nodes: Curve Primitive Quadratic Bezier Segment
This patch is for a node that creates a poly spline from a
3 point quadratic Bezier. Resolution is also specified.

Curve primitives design task: T89220

Differential Revision: https://developer.blender.org/D11649
2021-06-29 22:39:26 -05:00
Johnny Matthews
21ebee2580 Geometry Nodes: Curve Primitive Spiral
This node creates a curve spline and gives control for the number of
rotations, the number of points per rotation, start and end radius,
height, and direction. The "Reverse" input produces a visual change,
it doesn't just change the order of the control points.

Differential Revision: https://developer.blender.org/D11609
2021-06-29 22:22:28 -05:00
Johnny Matthews
86c6769e20 Geometry Nodes: Curve Primitive Spiral
This patch adds a Curve Primitives menu in Geometry nodes with an
initial entry of a star primitive.

The node is a basic star pattern node that outputs a poly spline.
Options control the inner and outer radius, the number of points,
and the twist of the valleys.

Differential Revision: https://developer.blender.org/D11653
2021-06-29 22:00:29 -05:00
Richard Antalik
fba9cd019f VSE: Improved Snapping
Change snapping behavior to snap strip edges when they are close to snap point.
Default behavior is, that each transformed strip is snapped to any other strip.

Implement snapping controls in sequencer tool settings. These controls include:

 - Snapping on/off
 - Ability to snap to playhead and strip hold offset points
 - Filter snap points by excluding sound or muted strips
 - Control snapping distance

Snapping controls are placed in timeline header similar to 3D viewport

Reviewed By: mano-wii

Differential Revision: https://developer.blender.org/D11646
2021-06-29 20:30:31 +02:00
YimingWu
d1e0059eac LineArt: Filtering intersection lines using mask numbers
Mask value works just like transparency mask.

You are able to select intersection lines inside a
collection or, between collections.

Reviewed By: Sebastian Parborg (zeddb)

Differential Revision: https://developer.blender.org/D11309
2021-06-29 20:47:55 +08:00
Jacques Lucke
6ce4d39e6b Geometry Nodes: initial attribute list for meshes
This adds a new Attributes panel in the mesh properties editor.
It shows a list of all the generic attributes on the mesh.
In the future, we want to show built-in and other attributes in the
list as well. Related technical design tasks: T88460, T89054.

There is also a new simple name collision check that warns the user
when there are multiple attributes with the same name. This can be
problematic when the attribute is supposed to be used in geometry
nodes or during rendering.

Differential Revision: https://developer.blender.org/D11276
2021-06-28 16:53:25 +02:00
Hans Goudey
0afe4e81cb Fix name of UI emboss RNA enum item
This was a stupid mistake in my original commit that added this item.
While this is an API breakage, the name is simply wrong, and it is only
6 months old, and slightly niche.

Differential Revision: https://developer.blender.org/D11701
2021-06-28 09:51:39 -05:00
YimingWu
cf21ba37ef LineArt: Occlusion effectiveness support
This patch adds a function where you can specify occlusion effectiveness from 0 to 255 layers per face for a given mesh material.

Reviewed By: Sebastian Parborg (zeddb)

Ref D11308
2021-06-28 22:26:23 +08:00
YimingWu
c297769d22 UI: Hide collection tab when scene master collection is active
CollectionLineart does not care about the configurations
in master collection.
Other options are not applicaple for master collection as well.
Hence hiding it.

Reviewed by Dalai Felinto (dfelinto)

Differential Revision: https://developer.blender.org/D11702
2021-06-28 15:51:34 +08:00
Dalai Felinto
bb2648ebf0 Outliner: View Layers filter for View Layer Mode
This option allow users to see the view layer in context to the
others. It is particularly useful to see which view layers have which
collections enabled, and their render settings (holdout, ...).

This option is off by default.

Differential Revision: https://developer.blender.org/D11708
2021-06-28 09:34:44 +02:00
Mihnea Stoian
5ec6c8d267 Linux: prefer using dedicated GPU when launching Blender
Adds "PrefersNonDefaultGPU" and "X-KDE-RunOnDiscreteGpu" to the .desktop file.
Similar hints for macOS and Windows exist already, to prefer using a dedicated
GPU over a slower integrated GPU.

See: https://gitlab.freedesktop.org/xdg/xdg-specs/-/merge_requests/13

Differential Revision: https://developer.blender.org/D11643
2021-06-25 15:28:19 +02:00
Fabian Schempp
ae085e301c Spreadsheet: Dataset region for spreadsheet editor
This patch adds a left aligned sidebar to the spreadsheet editor. This
Sidebar can be used to navigate the geometry component types and
attribute domains. It also provides a quick overview of domain sizes.
It replaces the two dropdowns in the regions header.
Next step will be to add the domain cycling shortcut
using the CTRL + mouse wheel.

Reviewer: Dalai Felinto (dfelinto), Julian Eisel (Severin),
Hans Goudey (HooglyBoogly).

Differential Revision: https://developer.blender.org/D11046
2021-06-25 07:57:24 +02:00
YimingWu
de05e261ec Line Art: Discard out of frame edges.
For scenes that have a lot of edges, this could potentially
save some time generating individual strokes that are outside
camera frustum.

Reviewed By: Sebastian Parborg (zeddb)

Differential Revision: https://developer.blender.org/D11525
2021-06-24 13:09:25 +08:00
Julian Eisel
f7fbb518c8 Fix failure when baking actions with Bendy Bones
682a74e0909ba renamed Bendy Bones properties and replaced existing float
properties with float-vector properties. This updates the property names used
by the action baking operator (`NLA_OT_bake`).
2021-06-24 00:10:11 +02:00
Pablo Dobarro
ef7fcaf8e6 Voxel Remesher: Make smooth shading output automatic
Previously the smooth shading of the voxel remesher was controlled by a
mesh property. With this change, the output will try to match the
current shading of the object. This only takes into consideration the
shading mode of the first polygon of the model, but it is probably what
most users expect as it works as intended with the shade smooth/flat
object mode options.

Reviewed By: JulienKaspar, JacquesLucke

Differential Revision: https://developer.blender.org/D11626
2021-06-23 18:42:40 +02:00
Pratik Borhade
a6f275cad3 Fix T88808: Set Origin missing from Text object in 2.93
Fix T88808.
Caused by {rB5f2c5e5bb8c15bf0d6679351e3482f9c38c00935}

object type for `TEXT object` was missing in following check
that's why `Set Origin` option was lost from object context menu.

Reviewed By: lichtwerk

Maniphest Tasks: T88808

Differential Revision: https://developer.blender.org/D11495
2021-06-23 11:12:13 +02:00
Aaron Carlisle
a8f37763ca RNA Manual Reference: Update Mapping File 2021-06-22 19:37:45 -04:00
Leon Zandman
c317f111c1 Cleanup: Spelling Mistakes
This patch fixes many minor spelling mistakes, all in comments or
console output. Mostly contractions like can't, won't, don't, its/it's,
etc.

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

Reviewed by Harley Acheson
2021-06-22 10:54:50 -07:00
Campbell Barton
53ba9f01e2 Fix error in context menu when built without freestyle 2021-06-22 17:19:02 +10:00
Campbell Barton
1725bfc3cb Cleanup: remove unused menu VIEW3D_MT_edit_mesh_edges_data
8aa17c5b12d734332c0af62a110524c4e523fb64 missed removing the
menu definition when removing from the UI.
2021-06-22 17:18:28 +10:00
Aaron Carlisle
d086570c7a UI: Sequencer: add refresh_all operator to all sequencer view menus
This commit piggybacks on rB3e695a27cdfad560d0b28e742cfa069d098200d6
2021-06-21 22:29:58 -04:00
Gaia Clary
2851602052 Add a reason for why an Addon can not be loaded. This change gives a more detailed explanation of the issue and may help the Addon Developer to identify what exactly needs to be changed.
The current message 'addon not loaded' is a bit too sparse.

Differential Revision: https://developer.blender.org/D11655
2021-06-21 12:51:46 +02:00
Hans Goudey
80083ac773 Fix T89310: Industry Compatible keymap not working
Caused by improper testing on my part, assuming a helper function
existed in the industry compatible keymap file, and also assuming it
also used the N and T keys for the left and right side-regions.
2021-06-20 18:52:01 -05:00
Hans Goudey
f9aea19d98 Spreadsheet Editor: Row Filters
This patch adds support for filtering rows based on rules and values.
Filters will work for any attribute data source, they are a property
of the spreadsheet rather than of the attribute system. The properties
displayed in the row filter can depend on data type of the currently
visible column with that name. If the name is no longer visible, the
row filter filter is grayed out, but it will remember the value until
a column with its name is visible again.

Note: The comments in `screen.c` combined with tagging the sidebar
for redraw after the main region point to a lack of understanding
or technical debt, that is a point to improve in the future.

**Future Improvements**
* T89272: A search menu for visible columns when adding a new filter.
* T89273: Possibly a "Range" operation.

Differential Revision: https://developer.blender.org/D10959
2021-06-18 16:33:02 -05:00
Alexander Gavrilov
b6030711a2 Armature: add automatic B-Bone Scale toggles.
Currently B-Bone scaling can only be controlled via their
properties, thus requiring up to 8 drivers per joint between
B-Bones to transfer scaling factors from the handle bone.

A Scale Easing option is added to multiply the easing value
by the Y scale channels to synchronize them - this produces a
natural scaling effect where both the shape of the curve and
the scale is affected.

In addition, four toggles are added for each handle, which
multiply each of the X, Y, Z and Ease values by the matching
Local Scale channel of the handle bone, thus replacing trivial
drivers. The Scale Easing option has no effect on this process
since it's easy to just enable both Length and Ease buttons.

Differential Revision: https://developer.blender.org/D9870
2021-06-18 18:56:04 +03:00
Alexander Gavrilov
682a74e090 Armature: add B-Bone Y scale channel and extra flag fields to DNA.
In addition to the base bone transformation itself, B-Bones have
controls that affect transformation of its segments. For rotation
the features are quite complete, allowing to both reorient the
Bezier handles via properties, and to control them using custom
handle bones. However for scaling there are two deficiencies.

First, there are only X and Y scale factors (actually X and Z),
while lengthwise all segments have the same scaling. The ease
option merely affects the shape of the curve, and does not cause
actual scaling.

Second, scaling can only be controlled via properties, thus
requiring up to 6 drivers per joint between B-Bones to transfer
scaling factors from the handle bone. This is very inefficient.

Finally, the Z channels are confusingly called Y.

This commit adds a B-Bone Y Scale channel and extra B-Bone flag
fields to DNA with appropriate versioning (including for F-Curves
and drivers) in preparation to addressing these limitations.

Functionality is not changed, so the new fields are not used
until the following commits.

Differential Revision: https://developer.blender.org/D9870
2021-06-18 18:56:03 +03:00
Jeroen Bakker
ea4309925f Performance: Limit recounting during selection mode flushing.
This patch ensures that selection mode flushing updates total selection
counts internally. This reduces recounting when we are sure that the
input total selection counts were up to date.

For example for circle selection the total selection counts were
correct. But during flushing the selection could have been changed and
therefore the selection was always recounted.

This increased the performance on selected system from 6.90 FPS to 8.25
FPS during circle selection operations.

Before: {F10179981}
After: {F10179982}

Reviewed By: mano-wii

Differential Revision: https://developer.blender.org/D11647
2021-06-18 15:44:08 +02:00
Lukas Tönne
4b673ebb99 Raycast geometry node.
The //Raycast// node intersects rays from one geometry onto another.
It computes hit points on the target mesh and returns normals, distances
and any surface attribute specified by the user.

A ray starts on each point of the input //Geometry//. Rays continue
in the //Ray Direction// until they either hit the //Target Geometry//
or reach the //Ray Length// limit. If the target is hit, the value of the
//Is Hit// attribute in the output mesh will be true. //Hit Position//,
//Hit Normal//, //Hit Distance// and //Hit Index// are the properties of the
target mesh at the intersection point. In addition, a //Target Attribute//
can be specified that is interpolated at the hit point and the result
stored in //Hit Attribute//.

Docs: D11620

Reviewed By: HooglyBoogly

Differential Revision: https://developer.blender.org/D11619
2021-06-17 21:11:32 +01:00