Commit Graph

412 Commits

Author SHA1 Message Date
Thomas Dinges
64fc6d7890 Docs: Replace most wiki links with links to new developer docs
Exceptions:
* Links to personal wiki pages
* Pages that are not in the new developer docs yet (like Human Interface Guidelines)
* tools\check_wiki\check_wiki_file_structure.py needs a refactor
2024-01-18 16:49:38 +01:00
Omar Emara
f0f073bd1f Fix: Files with Pixelate nodes have zero pixel size
Old files with the pixelate node have zero pixel sizes. This patch just
adds versioning to properly initialize the pixel size.
2024-01-18 14:39:23 +02:00
Lukas Tönne
83d3ba8a58 Fix #116477: Node group sockets with subtypes have broken idnames
Loading pre-4.0.20 node groups with sockets using subtypes causes
broken socket identifiers. This is because the node tree interface now
expects sockets to use the base identifiers ("NodeSocketFloat" instead
of "NodeSocketFloatFactor" etc.).

To correct this the conversion code now replaces socket idnames that
include a subtype suffix with their base names. This fix is also applied
to files between versions 4.0.20 and 4.1.10, where the socket types
may have been converted incorrectly.

Pull Request: https://projects.blender.org/blender/blender/pulls/117133
2024-01-16 15:32:33 +01:00
Thomas Dinges
1229ffa859 Versioning: Bump subversion and move code into block 2024-01-09 15:29:40 +01:00
Nathan Vegdahl
c9093332e0 Fix #115434: custom bone colors invisible in stick mode
The issue was that bone colors are only specified with 3 channels (RGB),
but they're stored as 4 channels for some reason.  So the fourth bogus
channel gets initialized to zero by default, which was then being
interpreted as zero alpha in some drawing modes.

This fixes the issue by ensuring that the fourth unused channel always
gets initialized to 255, and therefore can be validly interpreted as an
alpha channel.

Pull Request: https://projects.blender.org/blender/blender/pulls/115477
2023-11-28 18:04:11 +01:00
Iliya Katueshenock
8149678d5e Geometry Nodes: use dynamic declaration for some nodes
This changes a bunch of nodes that have a data type drop-down to using a dynamic
node declaration that changes based on the selected data type instead of always having
all sockets. This greatly simplifies the code and is less weird than having suffixes on
socket identifiers.

Backward compatibility and forward compatibility remain due to #113497 and #113984.

One user-visible change is that changing the data type in these nodes does not break
the link anymore.

It may be necessary to bring back some functionality from link-drag-search afterwards.

Pull Request: https://projects.blender.org/blender/blender/pulls/113553
2023-11-17 16:23:34 +01:00
Hans Goudey
9785f2631e Mesh: Add flag to store presence of overlapping topology
For improving performance in the triangulate node (#112264), it's
helpful to know whether the mesh has edges or faces that overlap
each other. If that is known to be false, the node can skip edge de-
duplication.This might apply to the future "Replace Faces" node too.

This information is stored as a flag on the mesh and set in various
places that create "clean" new meshes. It isn't calculated lazily unlike
other other areas, because the point is to improve performance, and
the calculation probably isn't faster than the duplication check it's
meant to replace.

Pull Request: https://projects.blender.org/blender/blender/pulls/113205
2023-11-15 14:02:48 +01:00
Germano Cavalcante
78943edc5d Transform: Custom modifier to navigate while transforming
Discussed in #114646.

This commit transforms the "alt_navigation" option of the transform
operators into a new modal key item. "PASSTHROUGH_NAVIGATE"

In addition to cleaning up a lot of the code, it allows you to
customize the key chosen to navigate while transforming.
2023-11-09 21:33:34 -03:00
Miguel Pozo
6d0b5e2ace EEVEE-Next: New shadow settings
Remove `Material > Shadow Mode` and use `Object > Shadow Ray Visibility`
and `Material > Transparent Shadows` instead.

The versioning system auto-updates objects/materials in EEVEE
scenes so their behavior is as close as possible to the previous one.

Update Cycles to use the native `use_transparent_shadow` property.

Note:
Material changes don't set any `recalc` flag on the objects that use
them, so the EEVEE Next shadow maps don't update when changing
settings/nodes.
Fixing this issue is required for 4.1, but it's out of the scope of this PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/113980
2023-11-06 15:45:00 +01:00
Gilberto Rodrigues
dfd1b63cc7 UI: improve mesh edge highlighting
Changes to edit mode mesh overlays, use hue shift instead of color
fading/darkening for selection mode visual differentiation, and some
theme changes to improve the display of mesh edges and faces with good
selection visibility.

- Removed "edge" toggle from edit mode overlays panel.
- No longer halves the edge and face alpha depending on selection mode.
  Half the face alpha in wire-frame mode. For better visibility on most
  themes.

Ref !111431
2023-11-02 22:09:17 +11:00
Harley Acheson
0bde01eab5 UI: Configurable UI Font Weight
Allows selecting different font weights in Text Styles

Pull Request: https://projects.blender.org/blender/blender/pulls/112454
2023-10-21 00:28:28 +02:00
Hans Goudey
89e3ba4e25 Mesh: Replace auto smooth with node group
Design task: #93551

This PR replaces the auto smooth option with a geometry nodes modifier
that sets the sharp edge attribute. This solves a fair number of long-
standing problems related to auto smooth, simplifies the process of
normal computation, and allows Blender to automatically choose between
face, vertex, and face corner normals based on the sharp edge and face
attributes.

Versioning adds a geometry node group to objects with meshes that had
auto-smooth enabled. The modifier can be applied, which also improves
performance.

Auto smooth is now unnecessary to get a combination of sharp and smooth
edges. In general workflows are changed a bit. Separate procedural and
destructive workflows are available. Custom normals can be used
immediately without turning on the removed auto smooth option.

**Procedural**

The node group asset "Smooth by Angle" is the main way to set sharp
normals based on the edge angle. It can be accessed directly in the add
modifier menu. Of course the modifier can be reordered, muted, or
applied like any other, or changed internally like any geometry nodes
modifier.

**Destructive**
Often the sharp edges don't need to be dynamic. This can give better
performance since edge angles don't need to be recalculated. In edit
mode the two operators "Select Sharp Edges" and "Mark Sharp" can be
used. In other modes, the "Shade Smooth by Angle" controls the edge
sharpness directly.

### Breaking API Changes
- `use_auto_smooth` is removed. Face corner normals are now used
  automatically   if there are mixed smooth vs. not smooth tags. Meshes
  now always use custom normals if they exist.
- In Cycles, the lack of the separate auto smooth state makes normals look
  triangulated when all faces are shaded smooth.
- `auto_smooth_angle` is removed. Replaced by a modifier (or operator)
  controlling the sharp edge attribute. This means the mesh itself
  (without an object) doesn't know anything about automatically smoothing
  by angle anymore.
- `create_normals_split`, `calc_normals_split`, and `free_normals_split`
  are removed, and are replaced by the simpler `Mesh.corner_normals`
  collection property. Since it gives access to the normals cache, it
  is automatically updated when relevant data changes.

Addons are updated here: https://projects.blender.org/blender/blender-addons/pulls/104609

### Tests
- `geo_node_curves_test_deform_curves_on_surface` has slightly different
   results because face corner normals are used instead of interpolated
   vertex normals.
- `bf_wavefront_obj_tests` has different export results for one file
  which mixed sharp and smooth faces without turning on auto smooth.
- `cycles_mesh_cpu` has one object which is completely flat shaded.
  Previously every edge was split before rendering, now it looks triangulated.

Pull Request: https://projects.blender.org/blender/blender/pulls/108014
2023-10-20 16:54:08 +02:00
Falk David
07749b389d GPv3: Convert radius to blender units
Previously, Grease Pencil used a radius convention where
1 "px" = 0.001 units. This "px" was the brush size which would be
stored in the stroke thickness and then scaled by the point pressure
factor. Finally, the render engine would divide this thickness value by
2000 (we're going from a thickness to a radius, hence the factor of
two) to convert back into blender units.

Store the radius now directly in blender units. This makes it
consistent with how hair curves handle the radius.

* Removes the scaling in the render engine.
* Makes sure the grease pencil primitives use the correct radii
* Changes the drawing tool to work with screen space radius
* Draws the drawing tool cursor in screen space
* Makes sure the scaling is done when converting from legacy
grease pencil objects
* Makes sure the scaling is done when loading previous files

Consequences for the draw tool:
* Since the tool has a radius input in pixels, it now works in screen space. This is a pretty big change to how it works by default before, so a new option will have to be added that allows the brush to be in "Scene" space. This is similar to how it works in sculpt mode. But this is a bigger change, so I would like to split that into a separate PR.

Pull Request: https://projects.blender.org/blender/blender/pulls/113770
2023-10-17 17:00:35 +02:00
Thomas Dinges
ab26ddc455 Revert "Release cycle: Bcon3 for Blender 4.0"
This reverts commit 8c25952886.
2023-09-27 12:53:52 +02:00
Thomas Dinges
74cc9f5738 Merge branch 'blender-v4.0-release' 2023-09-27 12:53:22 +02:00
Thomas Dinges
8c25952886 Release cycle: Bcon3 for Blender 4.0 2023-09-27 12:52:04 +02:00
Thomas Dinges
673ad635f5 Release cycle: Bcon1 for Blender 4.1 2023-09-27 12:49:46 +02:00
Julian Eisel
04d22d73f3 UI: Hide asset shelf by default
Only the pose library enables the asset shelf by default, but Blender
doesn't come with pose assets, they have to be created by the user. So
when entering pose mode with factory settings, the asset shelf will
currently be just a big empty bar. Plus, pose mode is used for posing
without pose assets quite a lot. So hide the asset shelf by default. The
pose library already shows a toggle to hide/unhide it where the previous
pose library UI was for discoverability.
2023-09-27 11:54:45 +02:00
Richard Antalik
86a0d0015a VSE: Improve retiming UI
Currently retiming is quite awkward, when you need to retime multiple
strips strips in sync. It is possible to use meta strips, but this is
still not great. This is resolved by implementing selection.

General changes:
Gizmos are removed, since they are designed to operate only on active
strip and don't support selection.
Transform operator code is implemented for retiming data, which allows
more sophisticated manipulation.
Instead of drawing marker-like symbols, keyframes are drawn to
represent retiming data. Retiming handles are now called keys. To have
consistent names, DNA structures have been renamed.
Retiming data is drawn on strip as overlay.

UI changes:
Retiming tool is removed. To edit retiming data, press Ctrl + R, select
a key and move it. When retiming is edited, retiming menu and
context menu shows more relevant features, like making transitions.
Strip and retiming key selection can not be combined. It is possible to
use box select operator to select keys, if any key is selected.
Otherwise strips are selected.
Adding retiming keys is possible with I shortcut or from menu.
Retiming keys are always drawn at strip left and right boundary. These
keys do not really exist until they are selected. This is to simplify
retiming of strips that are resized. These keys are called "fake keys"
in code.

API changes:
Functions, properties and types related to retiming handles are renamed
to retiming keys:
retiming_handle_add() -> retiming_key_add()
retiming_handle_move() -> retiming_key_move()
retiming_handle_remove() -> retiming_key_remove()
retiming_handles -> retiming_keys
RetimingHandle -> RetimingKey

Retiming editing "mode" is activated by setting `Sequence.show_retiming_keys`.

Pull Request: https://projects.blender.org/blender/blender/pulls/109044
2023-09-27 01:45:59 +02:00
Sybren A. Stüvel
c524fbe623 Anim: Improve readability of channel colors in channel list
Draw anim channel colors as a little rectangle in the channel list,
instead of taking over the entire channel name background. This keeps
the channel names readable, regardless of the channel colors.

Channel colors are typically set via the bone colors, and since those
are chosen for visual contrast in the 3D Viewport, they aren't
guaranteed to also be a suitable background color for the channel list.
Because of this, it's no longer used as such.

The channel 'data' background (i.e. the keyframe area) is now drawn with
a consistent color, and much more subtle.

This also enables the 'Channel Group Colors' setting in the preferences
by default, as it is now way less obnoxious and invasive.

Design task: https://projects.blender.org/blender/blender/issues/69059
Reviewed-On: https://projects.blender.org/blender/blender/pulls/112861
2023-09-26 17:06:35 +02:00
Weizhen Huang
def9b76207 Shader: Change specular tint in Principled BSDF from float to color
For more artistic control. Tints the reflection of dielectric materials
at normal incidence.

Ref #99447

Pull Request: https://projects.blender.org/blender/blender/pulls/112192
2023-09-25 19:42:05 +02:00
Philipp Oeser
8094309474 Fix: Changing theme color for recent additions doesn't save
affected were:
- VSE Transition color
- Enum Highlighting color

which missed version bumps from 5f0a8759b0 / a7ad0ad8fb.

Similar to 179c419115.

Pull Request: https://projects.blender.org/blender/blender/pulls/112615
2023-09-22 12:13:32 +02:00
Harley Acheson
636f3697ee UI: Window Title With Version
Include blender version information in title (including cycle), and
also indicate unsaved and dirty status better.

Pull Request: https://projects.blender.org/blender/blender/pulls/111998
2023-09-16 02:37:06 +02:00
Nate Rupsis
9da88301ef Fix #100718: NLA Hold Forward Inconsistency
Fix #100718: NLA Hold Forward Inconsistency

Action Track with 'extrapolation=Hold Forward' behaves the same as 'Hold'.

For the Action Track, we now properly treat extrapolation Hold_Forward just like the rest of the NLA system.

Co-author Wayde Moss @wbmoss_dev
Pull Request: https://projects.blender.org/blender/blender/pulls/109182
2023-09-11 18:40:31 +02:00
Campbell Barton
4fc5d287ac Cleanup: doxygen parameters, blank comment lines 2023-09-08 16:53:30 +10:00
Hans Goudey
4e97def8a3 Geometry Nodes: Expose sharp edge status with builtin nodes
Change the existing "Is Shade Smooth" node to be named "Is Face Smooth"
and add a new "Is Edge Smooth" node. Also give the "Set Shade Smooth"
node the ability to set face or edge smoothness.

The fact that the nodes process "smooth" data reversed from the builtin
"sharp" attributes can be reversed with versioning in a separate commit.

While it's tempting to abstract the sharpness status into a single node,
face and edge smoothness are accessed separately in edit mode, and the
subtlety of interacting with data on different domains would make that
confusing. Instead, a separate "Is Shade Smooth" node group asset will
give all the sharp elements taking into account both builtin attributes.

The fact that sharpness is stored separately on two domains makes the
best design for simple operations non-obvious. For example, you should be
able to remove all sharpness or make everything flat with a single node.
The behavior depends on whether the two attributes exist and the
combination of values between the domains.

---

![image](/attachments/c3f053c4-2b0f-44ac-9227-62071065fe56)

![image](/attachments/fd489fb3-314b-42ff-a5a9-e79578cbdfe7)

Pull Request: https://projects.blender.org/blender/blender/pulls/112029
2023-09-06 17:12:27 +02:00
Lukas Tönne
79a6a6977a Fix #111721: Node interface root panel flag missing
The file in question does not have the default (internal) root panel
flag for allowing child panels. This was probably saved before the flag
was added. A simple versioning snippet takes care of this case.

Pull Request: https://projects.blender.org/blender/blender/pulls/111828
2023-09-02 15:58:19 +02:00
Nathan Vegdahl
ceb5981bff Versioning: move bone collection/color versioning to bumped subversion
Also bump the recorded minimum 3.6 subversion for opening files, to
correspond to a fix in the 3.6 branch that prevents bones from seemingly
disappearing when opening files with 4.x bone collections.
2023-09-01 16:11:28 +02:00
Lukas Tönne
e071288ab2 Nodes: Panels integration with blend files and UI
Part 3/3 of #109135, #110272

Switch to new node group interfaces and deprecate old DNA and API.
This completes support for panels in node drawing and in node group
interface declarations in particular.

The new node group interface DNA and RNA code has been added in parts
1 and 2 (#110885, #110952) but has not be enabled yet. This commit
completes the integration by
* enabling the new RNA API
* using the new API in UI
* read/write new interfaces from blend files
* add versioning for backward compatibility
* add forward-compatible writing code to reconstruct old interfaces

All places accessing node group interface declarations should now be
using the new API. A runtime cache has been added that allows simple
linear access to socket inputs and outputs even when a panel hierarchy
is used.

Old DNA has been deprecated and should only be accessed for versioning
(inputs/outputs renamed to inputs_legacy/outputs_legacy to catch
errors). Versioning code ensures both backward and forward
compatibility of existing files.

The API for old interfaces is removed. The new API is very similar but
is defined on the `ntree.interface` instead of the `ntree` directly.
Breaking change notifications and detailed instructions for migrating
will be added.

A python test has been added for the node group API functions. This
includes new functionality such as creating panels and moving items
between different levels.

This patch does not yet contain panel representations in the modifier
UI. This has been tested in a separate branch and will be added with a
later PR (#108565).

Pull Request: https://projects.blender.org/blender/blender/pulls/111348
2023-08-30 12:37:21 +02:00
Rawalanche
411cd827b7 Nodes: Move Auto-Offset toggle to User Preferences
Move Auto-Offset toggle from Node Editor View menu
into the Editing > Node Editor section of User Preferences,
to reflect its use as a workflow option not configured
per editor or per file.

Pull Request: https://projects.blender.org/blender/blender/pulls/111589
2023-08-29 01:18:33 +02:00
Campbell Barton
b150b47720 UI: add a preference for the number of samples used for FPS playback
This was hard coded to 8, which can still result in a number that
jitters making the overall FPS difficult to measure.

The default is still 8, but this is now a preference that can be
increased for values that don't jitter as much.
2023-08-25 19:33:48 +10:00
Clément Foucault
acd6dd96b7 Camera: Move panoramic projection settings to DNA
This is in prevision of EEVEE panoramic projection support.

EEVEE-Next is planned to add support for these parameters.
Not having these parameters in Blender DNA will make Cycles
and EEVEE not share the same parameters and will be confusing
for the user.

We handle forward compatibility by still writing the parameters
as ID properties as previous cycles versions expect.

Since this change will break the API compatibility it is crucial
to make it for the 4.0 release.

Related Task #109639

Pull Request: https://projects.blender.org/blender/blender/pulls/111310
2023-08-22 15:49:34 +02:00
Hoshinova
0702c24a36 Nodes: Add Lacunarity and Normalize inputs to Noise node
This PR adds the Lacunarity and Normalize inputs to the Noise node
similar to the Voronoi node.

The Lacunarity input controls the scale factor by which each
successive Perlin noise octave is scaled. Which was previously hard
coded to a factor of 2.

The Noise node normalizes its output to the [0, 1] range by default.
The Normalize option makes it possible for the user to disable that.
To keep the behavior consistent with past versions it is enabled by
default.

To make the aforementioned normalization control easer to implement,
the fractal noise code now accumulates signed noise and remaps the
final sum, as opposed to accumulating positive [0, 1] noise.

Pull Request: https://projects.blender.org/blender/blender/pulls/110839
2023-08-15 17:38:45 +02:00
Campbell Barton
e955c94ed3 License Headers: Set copyright to "Blender Authors", add AUTHORS
Listing the "Blender Foundation" as copyright holder implied the Blender
Foundation holds copyright to files which may include work from many
developers.

While keeping copyright on headers makes sense for isolated libraries,
Blender's own code may be refactored or moved between files in a way
that makes the per file copyright holders less meaningful.

Copyright references to the "Blender Foundation" have been replaced with
"Blender Authors", with the exception of `./extern/` since these this
contains libraries which are more isolated, any changed to license
headers there can be handled on a case-by-case basis.

Some directories in `./intern/` have also been excluded:

- `./intern/cycles/` it's own `AUTHORS` file is planned.
- `./intern/opensubdiv/`.

An "AUTHORS" file has been added, using the chromium projects authors
file as a template.

Design task: #110784

Ref !110783.
2023-08-16 00:20:26 +10:00
Colin Marmond
b8eb7d18e9 Nodes: experimental node previews in the shader editor
First implementation of node previews in the shader node editor. Using
the same user interface as compositor node previews, most shader nodes
can now be previewed (except group in/output and material output).

This is currently still an experimental feature, as polishing of the
user experience and performance improvements are planned. These will
be easier to do as incremental changes on this implementation.

See #110353 for details on the work that remains to be done and known
limitations.

Implementation notes:

We take advantage of the `RenderResult` available as `ImBuf` images to
store a `Render` for every viewed nested node tree present in a
`SpaceNode`. The computation is initiated at the moment of drawing nodes
overlays.

One render is started for the current nodetree, having a `ViewLayer`
associated with each previewed node. We separate the previewed nodes in
two categories: the shader ones and the non-shader ones.
- For non-shader nodes, we use AOVs which highly speed up the rendering
  process by rendering every non-shader nodes at the same time. They are
  rendered in the first `ViewLayer`.
- For shader nodes, we render them each in a different `ViewLayer`, by
  rerouting the node to the output of the material in the preview scene.

The preview scene takes the same aspect as the Material preview scene,
and the same preview object is used.

At the moment of drawing the node overlay, we take the `Render` of the
viewed node tree and extract the `ImBuf` of the wanted viewlayer/pass
for each previewed node.

Pull Request: https://projects.blender.org/blender/blender/pulls/110065
2023-08-08 17:36:06 +02:00
Campbell Barton
845a5146e7 Cleanup: avoid term '_len' for buffer size 2023-08-06 16:09:04 +10:00
Julian Eisel
268d322e7c BKE: Bump subversion for versioning in previous commit 2023-08-03 17:07:22 +02:00
Sergey Sharybin
fddcbf2d40 Fix missing subversion bump in the previous commit
Pull Request: https://projects.blender.org/blender/blender/pulls/110687
2023-08-01 15:02:27 +02:00
Campbell Barton
724755879e Cleanup: spelling in comments, use doxygen doc-strings 2023-07-31 10:18:09 +10:00
Julian Eisel
4319c211dc UI: Support layout based region resizing that still allows user resizing
No user visible changes expected.

This is needed for the asset shelf (#104831), so that the user can
resize the asset shelf region, but it's ensured to always be snapped to
a multiple of the row height (which can change over redraws).

Before this, `RGN_FLAG_DYNAMIC_SIZE` would have to be set so that
regions can control their own size in the `ARegionType::layout()`
callback. But this would also disable resizing the region by the user.
Tagging regions as being dynamically sized and disabling user resizing
are now two separate options/flags.

Included changes:
- Rename `RGN_FLAG_PREFSIZE_OR_HIDDEN` to `RGN_FLAG_NO_USER_RESIZE` and
  make that generally disable user resizing like `RGN_FLAG_DYNAMIC_SIZE`
  used to, so that it can be used for more than just the properties
  editor tabs region.
- Ensure regions that relied on the previous `RGN_FLAG_DYNAMIC_SIZE`
  behavior that disallowed user resizing have the
  `RGN_FLAG_NO_USER_RESIZE` flag set too now.
- Versioning to ensure the previous point for old files.
- Update comments.
2023-07-28 14:36:02 +02:00
Bastien Montagne
830730e2cc Reduce file minversion to 3.6 (sub 11) for Blender 4.0.
Required to make 4.0 files readable by 3.6 once the compatibility
changes are backported to the LTS releases.

Part of #109151 (PR !110109).
2023-07-27 16:21:38 +02:00
Bastien Montagne
0896cae97c BKE version: Add utils to get string out of numbers for blendfile version.
Since in rare cases there may be needs to expose file subversion here,
the following format was defined:

  <major>.<minor> (sub <subversion>)

Part of #109151 (PR !110109).
2023-07-27 16:21:38 +02:00
Nate Rupsis
9ec018e1df Fix: Bump BLENDER_FILE_SUBVERSION to 11 used in #108286 2023-07-21 08:40:56 -04:00
Colin Marmond
1ebdd2d9cf Nodes: Move preview images to an overlay
Move the node previews to the overlay region, atop each node.
It allows nodes to keep the same size when the preview is toggled,
which is more convenient for large nodes and large nodetrees.

The preview has to be drawn from `node_draw_extra_info_panel`
because there could be overlapping between info text and the preview.
When the node is out of the view, it also has to make sure that the
preview is also out of the view before exiting the draw function.

Pull Request: https://projects.blender.org/blender/blender/pulls/108001
2023-07-12 16:14:12 +02:00
Weizhen Huang
482211b7e0 Fix wrong conversion from power to radiance of area lights
The correct conversion factor should be 1 / (pi * area), see #108505

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/109153
2023-07-07 17:03:02 +02:00
Pratik Borhade
e73273e24b Animation: Set hardmin/max for frame start and end of action
Currently start and end property of action don't have hardmin/hardmax. This results in an
error when exporting action having extreme range values in FBX and gltf formats (#107965).

Pull Request: https://projects.blender.org/blender/blender/pulls/107985
2023-07-06 10:55:33 +02:00
Hans Goudey
e5ec04d73c Mesh: Move vertex/edge crease to generic attributes
Store subdivision surface creases in two new named float attributes:
- `crease_vert`
- `crease_edge`
This is similar to 2a56403cb0.

The attributes are naming conventions, so their data type and domain
aren't enforced, and may be interpolated when necessary. Editing tools
and the subdivision surface modifier use the hard-coded name. It might
be best if these were edited as generic attributes in the future, but
in the meantime using generic attributes helps.

The attributes are visible in the list, which is how they're now meant
to be removed. They are now interchangeable with any tool that works
with the generic attribute system-- even tools like vertex paint can
affect creases now.

This is a breaking change. Forward compatibility isn't preserved for
versions before 3.6, and the `crease` property in RNA is removed in
favor of making a smaller API surface area with just the attribute API.
`Mesh.vertex_creases` and `Mesh.edge_creases` now just return the
matching attribute if possible, and are now implemented in Python.
New functions `*ensure` and `*remove` also replace the operators to
add and remove the layers for Python.

A few extrude node test files have to be updated because of different
(now generic) attribute interpolation behavior.

Pull Request: https://projects.blender.org/blender/blender/pulls/108089
2023-06-13 20:23:39 +02:00
Hans Goudey
46cf093270 Mesh: Remove face map list, convert to integer attribute
Face maps were added as a prototype of a new rigging solution during
2.8 development. Their storage is redundant with the newer generic
attribute system (specifically with integer face attributes), and
they were never used much. This commit removes the face map list
and converts the storage to an attribute with the name `face_maps`.
There is nowhere to store the face map names anymore, so those
are not kept.

It probably still makes sense to have a feature like mesh face gizmo
selection for rigging. But the design and implementation woulds likely
have to change significantly, including possibly changing the storage
type, and making use of the generic attribute system instead of a
special type.

See #105317 for more discussion.
2023-06-09 13:54:52 +02:00
Germano Cavalcante
8e059b569b UI: move 'Face Nearest' snap option to another section
The snap mode called "Face Nearest" (and the "Increment" but that's for
another time) doesn't behave like the other snap modes.

Unlike the other snap modes, "Face Nearest" does not act on a Snap
Base (or Snap Source).

It always acts on the origin of individually transformed elements, (such
as each vertex individually).

It works just like the "Project Individual Elements" option.

So this commit makes the following changes:
- `Snap With` was moved to the beginning of the popover
- `Align Rotation to Target` and `Backface Culling` have been moved closer to the snap targets
- `Snap With`, `Target Selection` and `Align Rotation to Target` are no longer hidden by varying the mode and options
- `Project Individual Elements` has been replaced with the `Face Project` option
- `Face Nearest` has been moved to stick together with the `Face Project` option

Co-authored-by: Germano Cavalcante <germano.costa@ig.com.br>
Pull Request: https://projects.blender.org/blender/blender/pulls/108555
2023-06-06 19:35:57 +02:00
Germano Cavalcante
3010f1233b Transform: new feature to edit the 'Snap Base'
This commit implements a new modifier key (`B`) for the transform
operators.

This new key allows changing the 'Snap Base' of a transform by snapping
it to a defined point in the scene.

Ref #66424

# Implementation Details

- This feature is only available in the 3D View.
- This feature is only available for the transform modes:
  - `Move`,
  - `Rotate`,
  - `Scale`,
  - `Vert Slide` and
  - `Edge Slide`.
- The `Snap Base Edit` is enabled while we are transforming and we
  press the key `B`
- The `Snap Base Edit` is confirmed when we press any of the keys:
 `B`, `LMB`, `Enter`
- During um operation, if no snap target is set for an element in the
  scene (Vertex, Edge...), the snap targets to geometry Vertex, Edge,
  Face, Center of Edge and Perpendicular of Edge are set automatically.
- Constraint or similar modal features are not available during the
  `Snap Base Edit` mode.
- Text input is not available during the `Snap Base Edit` mode.
- A prone snap base point is indicated with an small cursor drawing.

Pull Request: https://projects.blender.org/blender/blender/pulls/104443
2023-06-03 04:18:49 +02:00