Commit Graph

6359 Commits

Author SHA1 Message Date
Aras Pranckevicius 1be8b51b11 VSE: display audio waveforms by default
As outlined in #115274 design task, at this point VSE timeline audio
waveform processing/rendering is no longer a performance issue,
so make it on by default.

Pull Request: https://projects.blender.org/blender/blender/pulls/116334
2023-12-20 19:51:23 +01:00
Hans Goudey edf8a776ac Cleanup: Use forward declarations to replace includes of BKE_attribute.hh
Remove most includes of this header inside other headers, to remove unnecessary
indirect includes which can have a impact on compile times. In the future we may
want more dedicated "_fwd.hh" headers, but until then, this sticks with the
solution in existing code.

Unfortunately it isn't yet possible to remove the include from `BKE_geometry_set.hh`.
2023-12-20 13:25:28 -05:00
Hans Goudey 19001c9e6c Cleanup: Move attribute domain enum to C++ header, use enum class
Each value is now out of the global namespace, so they can be shorter
and easier to read. Most of this commit just adds the necessary casting
and namespace specification. `enum class` can be forward declared since
it has a specified size. We will make use of that in the next commit.
2023-12-20 13:25:28 -05:00
Hans Goudey 8dd8f932e2 Cleanup: Rename Mesh loop_data to corner_data
Related to #110434, efbee2d606, 7c69c8827b
2023-12-19 20:39:05 -05:00
Hans Goudey efbee2d606 Mesh: Rename totvert, totedge, and totloop fields
Use the standard "elements_num" naming, and use the "corner" name rather
than the old "loop" name: `verts_num`, `edges_num`, and `corners_num`.
This matches the existing `faces_num` field which was already renamed.

Pull Request: https://projects.blender.org/blender/blender/pulls/116350
2023-12-20 02:21:48 +01:00
Campbell Barton 4d965615fc Cleanup: various C++ changes (use ELEM & string copy macros) 2023-12-17 16:25:10 +11:00
Campbell Barton 240b159918 Cleanup: remove unused defines 2023-12-17 16:04:42 +11:00
Hans Goudey 912c4c60d8 Mesh: Add viewport normals simplify option
Before #108014, toggling "Auto Smooth" was an easy way to disable
evaluation of custom normals and face corner normals for faster
viewport playback performance. Now that corner normals are calculated
automatically as necessary, it's helpful to still have a way to disable
expensive normal computation for faster playback.

This commit adds a "Normals" scene simplify setting. To avoid a bunch
of complexity, it just influences which normals are requested from the
object by viewport rendering. In my tests, skipping calculating at
least doubled viewport FPS in a few test files with a large mesh with
custom normals. This works well because normals are cached and lazily
calculated.

Pull Request: https://projects.blender.org/blender/blender/pulls/113975
2023-12-16 00:18:41 +01:00
Campbell Barton a4af406b81 Clenaup: spelling in comments 2023-12-14 11:14:50 +11:00
Bastien Montagne 60a9c8ee25 Fix #115486: Linked scenes disappear after reopening file.
Caused by 133dde41bb, it is expected behavior now for linked ID in
general, see also #105786 and #106321.

However, Scenes are a special case here, since they are almost never
(and should not be) indirectly linked by other data, and have (almost)
never any real user, unless they are active in one of the open main
windows.

So this commit essentially reverts the new behavior implemented
in #106321, for linked scenes only.

Should be backported to a potential bugfix release of 4.0.
2023-12-13 18:50:07 +01:00
Jacques Lucke f7383cfe9b Geometry Nodes: use dynamic declaration for switch node
Follow up for 8149678d5e. Significantly reduce boilerplate
required for each type in the switch node.Forward compatibility in 4.0
provided by 0ea193bdb3.

Co-authored-by: Hans Goudey <hans@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/113413
2023-12-13 17:33:25 +01:00
Hans Goudey 65252564ee Fix #116025: Uninitialized value when versioning old node trees
Usually we expect new DNA values do be zeroed when we add them. But the
conversion to the interface format for 4.0 didn't clear the memory, so
behavior was different when updating old files. Fix that by using
`calloc` instead of `malloc`.
2023-12-13 11:24:39 -05:00
Hans Goudey e657aa2360 Cleanup: Move two mesh functions to C++ header 2023-12-13 09:50:47 -05:00
Hans Goudey b52a071e7a Cleanup: Remove unnecessary Mesh C-API functions
Like mentioned in the docstrings, use the C++ API or access methods
in C++ code.
2023-12-13 08:40:21 -05:00
Omar Emara 123da3412b Cleanup: Move Cryptomatte node defines into enums 2023-12-13 12:40:34 +02:00
Hans Goudey a6838c8a12 Geometry Nodes: Change Instance Rotation node to use rotation socket
See #92967. Since the versioning is idempotent, I just moved it to the
latest subversion bump again.
2023-12-12 12:46:27 -05:00
Clément Foucault ae70d25959 EEVEE-Next: Refactor Raytracing pipeline
This de-duplicate some passes in the raytracing
pipeline and make it more ready for adoption
of arbitrary closure evaluation. This last part
means the removal of some per closure type
options.

The put in common the tile classification step
that is now done only once for all 3 closure
type. Also add some speedup to the tile
compaction phase that is now only twice
faster.

The horizon-scan setup was also de-duplicated
and run only if needed, which can save up to
0.5ms is complex scenes.

However, this moves the max-roughness and and
resolution scaling to a common parameter.
This is to be able to support arbitrary closure
evaluation where multiple closure with conflicting
parameters could be evaluated in one tracing pass.

Pull Request: https://projects.blender.org/blender/blender/pulls/116009
2023-12-10 21:38:23 +01:00
Campbell Barton 21fbd9dbd7 Cleanup: add missing header, sort files 2023-12-10 16:38:15 +11:00
Hans Goudey 854cdd1180 Cleanup: Use consistent "mesh" variable name (replace "me")
"mesh" reads much better than "me" since "me" is a different word.
There's no reason to avoid using two more characters here. Replacing
all of these at once is better than encountering it repeatedly and
doing the same change bit by bit.
2023-12-08 16:40:06 -05:00
Jeroen Bakker 65e58fe574 CMake: Fix Compiling Shader Builder on macOS
Due to changes in the build environment shader_builder wasn't able to
compile on macOs. This patch reverts several recent changes to CMake files.

* dbb2844ed9
* 94817f64b9
* 1b6cd937ff

The idea is that in the near future shader_builder will run on the buildbot as
part of any regular build to ensure that changes to the CMake doesn't break
shader_builder and we only detect it after a few days.

Pull Request: https://projects.blender.org/blender/blender/pulls/115929
2023-12-08 15:47:14 +01:00
Campbell Barton 77695da84b Cleanup: minor formatting tweaks 2023-12-08 16:22:14 +11:00
Sebastian Parborg e7f0bb24f7 VSE: Implement file based copy paste
This is a smaller rewrite/refactor of the VSE copy paste code to use the file copy buffer logic that is used in other places of Blender.

This makes Blender able to copy paste between Blender processes.
It can also paste successfully after closing and reopening Blender.

Other than that, the functionally should remain the exact same as the current copy paste operator with one exception: Scene strips does not retain their scene pointer when pasting into the same file.

This is to make it consistent with how it was before when copy pasting between .blend files.
(The scene data for the scene strips were never copied in when doing that)
Logic for pulling in or linking scenes into new or current files are purposely left for later when a proper proposal of how this would work in a nice fashion is done.

Now the strip data gets copied either fully or partially besides for scene strips. There only the script data gets copied and not the scene data.
If there is a audio/video data block of the same name as in the paste data, it will be reused to reduce potential duplication of data.

Pull Request: https://projects.blender.org/blender/blender/pulls/114703
2023-12-07 15:39:51 +01:00
Campbell Barton 497600e49e Cleanup: spelling in comments, strings 2023-12-07 12:45:27 +11:00
Sybren A. Stüvel 42083c8357 Refactor: move ANIM_bone_collections.h into the .hh file
Move the contents of `ANIM_bone_collections.h` into its C++
`ANIM_bone_collections.hh` sibling. Blender is C++ by now that we can do
without the C header.

No functional changes.
2023-12-05 15:10:27 +01:00
Nathan Vegdahl 05ac25dfba Cleanup: use existing bone iterator function 2023-12-05 11:54:16 +01:00
Bastien Montagne fa25a286d8 Refactor: BKE: Move `BKE_library` header to full CPP. 2023-12-05 11:53:55 +01:00
Campbell Barton d48b9d32c6 Fix (unlikely) integer overflow error in writedata(..)
The range check was applied before padding up, in the unlikely case
sizes (INT_MAX - 2) or (INT_MAX - 1) were passed in,
the value overflow into a negative integer.
2023-12-05 17:11:03 +11:00
Hans Goudey e1c4e7b4c6 Fix: Missing versioning for generic sculpt mask conversion
Since we're always writing the mask with the old format, this versioning
will have to run until a larger breaking release such as 5.0. Luckily it
is cheap, it's just rearranging the pointers to larger arrays.
2023-12-04 07:55:46 -05:00
Omar Emara b183a1cd12 Compositor: Disable preview of Split node by default
The Split node had preview enabled after versioning, so disable it by
default.
2023-12-04 13:24:24 +02:00
Omar Emara 771a0cf4e7 Fix: Dangling pointer in Split Viewer versioning
The Split Viewer node storage was freed but not set to nullptr.
2023-12-04 13:23:49 +02:00
Habib Gahbiche 153f14be2b Compositor: Make split viewer a regular split node
Changes:
- Renamed Split Viewer Node to Split Node
- Split Node is now under `Utilities` (similar to Switch node)
- Versioning: split viewer from 4.0 and before is replaced with the new split node connected to a new viewer node.

Pull Request: https://projects.blender.org/blender/blender/pulls/114245
2023-12-03 23:20:44 +01:00
Campbell Barton 32c5ea6262 Cleanup: format 2023-12-02 14:56:12 +11:00
Bastien Montagne 3acb64e7ac BKE_main: move header to be a fully CPP one.
Pull Request: https://projects.blender.org/blender/blender/pulls/115681
2023-12-01 20:38:54 +01:00
Bastien Montagne fe3cb11ae4 BKE_lib: Convert `BKE_lib_remap` and `lib_intern` headers to be fully C++. 2023-11-30 19:51:22 +01:00
Aras Pranckevicius 3f7ab7069e Cleanup: move writeffmpeg to C++
Pull Request: https://projects.blender.org/blender/blender/pulls/115585
2023-11-30 06:03:18 +01:00
Campbell Barton 15db0cb446 Cleanup: use style for doxygen comment blocks 2023-11-30 14:15:11 +11:00
Hans Goudey 7e3ba529ea Cleanup: Move four blenkernel headers to C++ 2023-11-28 16:05:12 -05:00
Nathan Vegdahl 32e56879b7 Fix: missed some version bump code 2023-11-28 18:12:21 +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
Bastien Montagne dad1eea511 Move `BKE_main_idmap` and `BKE_main_namemap` to be fully cpp headers.
NOTE: `BKE_main.h` is currently used by `writeffmpeg.c`, so not trivial
to make it a full CPP header file for now.

Pull Request: https://projects.blender.org/blender/blender/pulls/115485
2023-11-27 18:09:27 +01:00
Ray Molenkamp 1b6cd937ff Cleanup: CMake: Modernize bf_imbuf dependencies
Pretty straightforward

- Remove any bf_imbuf paths from INC
- Add a dependency though LIB when missing

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/115425
2023-11-25 23:37:24 +01:00
Ray Molenkamp 6b70c04724 Cleanup: CMake: Modernize bf_depsgraph dependencies
Pretty straightforward

- Remove any bf_depsgraph paths from INC
- Add a dependency though LIB when missing

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/115422
2023-11-25 22:51:59 +01:00
Ray Molenkamp ae25298774 Cleanup: CMake: Modernize bf_blenfont dependencies
Pretty straightforward

- Remove any bf_blenfont paths from INC
- Add a dependency though LIB when missing

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/115365
2023-11-24 18:29:09 +01:00
Ray Molenkamp b683bcc46c Cleanup: CMake: Modernize bf_intern_clog dependencies
Pretty straightforward

- Remove any bf_intern_clog paths from INC
- Add a dependency though LIB when missing

context: https://devtalk.blender.org/t/cmake-cleanup/30260

Pull Request: https://projects.blender.org/blender/blender/pulls/115323
2023-11-24 17:12:24 +01:00
Harley Acheson 694104f8aa Fix: Failing bf_io_wavefront_obj_tests test
BLF needs to initialized to properly set up Freetype, caching, etc.

Pull Request: https://projects.blender.org/blender/blender/pulls/115318
2023-11-23 21:49:28 +01:00
Bastien Montagne a1507baead Collection: Revert moving `owner_id` to runtime data.
While it may have been working from a practical PoV (not certain though,
since some bug would prevent clearing runtime data when writing embedded
Scene collection in current code), this is semantically wrong.

The owner of an embedded ID is a critical piece of information in
Blender data structure and ID management code. Having it written in
.blend files is also a potential good source of data for investigating
issues.

Further more, this handling of `owner` ID data is somewhat generic now
in ID management, so if this data should be considered runtime, then the
change should also be made in NodeTree and Key IDs.

This commit partially reverts 44dd3308a5, in the future I'd like to
be involved in the review of changes affecting ID management.

NOTE: fix for embedded collection runtime data not being cleared on
write will be committed separately.
2023-11-23 15:07:40 +01:00
Hans Goudey ba1c8fe6a5 Mesh: Improve remesh attribute transfer
Currently we have options to transfer the paint mask, face sets, and
color attributes to the new mesh created by voxel remesh. This doesn't
make use of the generic attribute design, where it would be clearer to
transfer all attributes with the same methods. That's reflected in the
code as well-- we do duplicate work for the mask and vertex colors, for
example.

This commit replaces the transfer options with a single checkbox for
all attributes. All attribute types on all domains are transferred with
basically the same method as the "Sample Nearest" node from geometry
nodes-- they take the value from the nearest source element of the same
domain. Face corners are handled differently than before. Instead of
retrieving the mixed value of all the corners from the nearest source
vertex, the value from the nearest corner of the nearest face.

---

Some timing information, showing that when interpolating the same
data, the attribute propagation is significantly faster than before.
Edge and corner attributes would add some cost (edges more than
corners), but might not always be present.

Before
```
voxel_remesh_exec: 3834.63 ms
BKE_shrinkwrap_remesh_target_project: 1141.17 ms
BKE_mesh_remesh_reproject_paint_mask: 689.35 ms
BKE_remesh_reproject_sculpt_face_sets: 257.14 ms
BKE_remesh_reproject_vertex_paint: 54.64 ms
BKE_mesh_smooth_flag_set: 0.15 ms
```

After
```
voxel_remesh_exec: 3339.32 ms
BKE_shrinkwrap_remesh_target_project: 1158.76 ms
mesh_remesh_reproject_attributes: 517.52 ms
```

Pull Request: https://projects.blender.org/blender/blender/pulls/115116
2023-11-22 15:21:58 +01:00
Hans Goudey 49087a84d0 Geometry Nodes: Use rotation socket for the object info node
See 600a133521 and #92967.
2023-11-22 08:25:32 -05:00
Hans Goudey 106de9f03c Fix: Avoid unnecessary conversions in rotation socket versioning
When the new rotation socket is connected to another rotation socket
already, a conversion node is unnecessary. Check this in addition to the
existing "non-self" implicit conversions.
2023-11-22 08:25:32 -05:00
Clément Foucault a001cf9f2b EEVEE-Next: Displacement Option
This add the displacement option to EEVEE materials.
This unifies the option for Cycles and EEVEE.

The displacement only option is not matching cycles
and not particularly useful. So we decided to not
support it and revert to displacement + bump.

Pull Request: https://projects.blender.org/blender/blender/pulls/113979
2023-11-21 19:55:38 +01:00