1961 Commits

Author SHA1 Message Date
Hans Goudey
1d372bdc8b Refactor: Split CustomData attribute and newer attribute headers
Avoid including DNA_customdata_types.h everywhere we include the
attributes header. Over time the older attribute header should be
used less and less.

Part of #122398

Pull Request: https://projects.blender.org/blender/blender/pulls/147980
2025-10-13 15:38:26 +02:00
Casey Bianco-Davis
fff2b76645 Fix #142377: Grease Pencil SVG Exporter objects disabled in render
This adds a check to ensure that objects disable in the render
don't show up in exported SVGs.

4.5 Backport candidate.

Pull Request: https://projects.blender.org/blender/blender/pulls/147332
2025-10-06 18:43:23 +02:00
Jesse Yurkovich
6ffd9be9a6 Fix: USD: Prevent unsupported point instancing setups from causing warns
If we detect an unsupported point instancing setup, do not attempt to
still export it out. Depending on the number of instances this can spew
10's of thousands of USD warning traces to the console.

Pull Request: https://projects.blender.org/blender/blender/pulls/147253
2025-10-06 04:42:39 +02:00
Hans Goudey
a68d39e9d9 Cleanup: Formatting
Run `make format` after the library update in the previous commit.
2025-10-02 12:55:42 -04:00
Thomas Dinges
66224d69b0 Deps: Library changes for Blender 5.0
This commit includes the changes to the build system, updated hashes to the actual new libraries as well as a required test update.

* DPC++ 6.2.0 RC
* freetype 2.13.3
* HIP 6.4.5010
* IGC 2.16.0
* ISPC 1.28.0
* libharu  2.4.5
* libpng 1.6.50
* libvpx 1.15.2
* libxml2 2.14.5
* LLVM 20.1.8
* Manifold 3.2.1
* MaterialX 1.39.3
* OpenColorIO 2.4.2
* openexr 3.3.5
* OpenImageIO 3.0.9.1
* openjpeg 2.5.3
* OpenShadingLanguage 1.14.7.0
* openssl 3.5.2
* Python 3.11.13
* Rubber Band 4.0.0
* ShaderC 2025.3
* sqlite 3.50.4
* USD 25.08
* Wayland 1.24.0

Ref #138940

Co-authored-by: Ray Molenkamp <github@lazydodo.com>
Co-authored-by: Jesse Yurkovich <jesse.y@gmail.com>
Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Co-authored-by: Nikita Sirgienko <nikita.sirgienko@intel.com>
Co-authored-by: Sybren A. Stüvel <sybren@blender.org>
Co-authored-by: Kace <lakacey03@gmail.com>
Co-authored-by: Sebastian Parborg <sebastian@blender.org>
Co-authored-by: Anthony Roberts <anthony.roberts@linaro.org>
Co-authored-by: Jonas Holzman <jonas@holzman.fr>

Pull Request: https://projects.blender.org/blender/blender/pulls/144479
2025-10-02 18:34:11 +02:00
Campbell Barton
b78c5fadf3 Cleanup: various non functional changes for C++ 2025-10-01 23:22:44 +00:00
Jesse Yurkovich
4bb6513b7d Fix #146822: Ensure safe names are used for custom Alembic attributes
We did not sanitize the names used for UV maps or Color attributes when
exporting to Alembic. Names containing characters like ':' or '/' would
cause an unhandled exception from Alembic.

Pull Request: https://projects.blender.org/blender/blender/pulls/146867
2025-09-27 01:23:05 +02:00
Jesse Yurkovich
fd3da2004c Cleanup: Alembic: Remove some unused utility APIs
These have long been unused and they will not be used in the future
either.

Pull Request: https://projects.blender.org/blender/blender/pulls/146863
2025-09-27 00:08:46 +02:00
Pavel Ševeček
08d95785c5 Alembic: Support import of additional point cloud attribute types
Adds support for importing arbitrary 32-bit float properties on Alembic
point clouds.

This includes the following Alembic property types (with their imported
Geometry Nodes attribute types):
 - `IFloatArrayProperty` -> `Float`
 - `IV2fArrayProperty` -> `2D Vector`
 - `IV3fArrayProperty`, `IN3fArrayProperty` -> `Vector`
 - `IC3fArrayProperty` -> `Color`

See PR for further details.

Co-authored-by: pavel <sevecek@sirrah.troja.mff.cuni.cz>
Pull Request: https://projects.blender.org/blender/blender/pulls/145946
2025-09-25 21:21:19 +02:00
Jesse Yurkovich
7c75651b3b IO: Remove visible_objects_only property for USD and Alembic export
To help reduce confusion, remove this property as we believe it has
little to no actual utility. Visibility, instead, remains controlled
with the `evaluation_mode` option.

Ref #134012
See PR for discussion and description of what effect this option used to
have.

Pull Request: https://projects.blender.org/blender/blender/pulls/144600
2025-09-23 22:04:36 +02:00
Jesse Yurkovich
fb352dcd53 Cleanup: IO: Remove unused local variable
Pull Request: https://projects.blender.org/blender/blender/pulls/146423
2025-09-18 01:20:46 +02:00
Habib Gahbiche
1b4daf9d2e Nodes: remove "Use Nodes" in Shader Editor for Object Materials
"Use Nodes" was removed in the compositor to simplify the compositing
workflow. This introduced a slight inconsistency with the Shader Node
Editor.

This PR removes "Use Nodes" for object materials.

For Line Style, no changes are planned (not sure how to preserve
compatibility yet).
This simplifies the state of objects; either they have a material or
they don't.

Backward compatibility:
- If Use Nodes is turned Off, new nodes are added to the node tree to
simulate the same material:
- DNA: Only `use_nodes` is marked deprecated
- Python API:
  - `material.use_nodes` is marked deprecated and will be removed in
6.0. Reading it always returns `True` and setting it has no effect.
  - `material.diffuse_color`, `material.specular` etc.. Are not used by
EEVEE anymore but are kept because they are used by Workbench.

Forward compatibility:
Always enable 'Use Nodes' when writing blend files.

Known Issues:
Some UI tests are failing on macOS

Pull Request: https://projects.blender.org/blender/blender/pulls/141278
2025-09-14 17:53:54 +02:00
Campbell Barton
62d791c8d6 Cleanup: only use "r_" prefix for return arguments 2025-09-14 23:03:01 +10:00
Campbell Barton
d1b76b6554 Cleanup: only use "r_" prefix for return arguments
Ref !146253
2025-09-14 11:08:50 +00:00
Jacques Lucke
6cb2226f13 Refactor: IDProperty: accelerate looking up properties by name
Currently, `IDP_GetPropertyFromGroup` is a common bottleneck because it has to
iterate over all properties to find the one with the right name.

This patch adds a hash table to id property groups that finding properties by
name in O(1) instead of O(n). The main tricky aspect is to find all the places
where this needs to be created/updated/freed. I tried to find all places but if
I missed some place, it should be easy to fix.

Pull Request: https://projects.blender.org/blender/blender/pulls/140907
2025-09-12 11:34:38 +02:00
Campbell Barton
84511b8509 Core: add type checks to ID property accessors
Since moving the C++ ID property access macros cast "const" away,
replace with get/set accessors and add asserts that correct types
are used.
2025-09-12 06:29:42 +00:00
Jesse Yurkovich
bbc0b35bef Fix #145856: Obey the relative_path operator property for USD import
The `relative_path` operator property on USD import was never wired up
completely. As such it would always write absolute paths when creating
MeshSequenceCache modifiers or Volume object file paths.

Obey this property and create relative paths as necessary.

Pull Request: https://projects.blender.org/blender/blender/pulls/145899
2025-09-09 01:32:44 +02:00
Mattias Fredriksson
32e61d3d09 OBJ IO: Import NURBS as Curves directly (not legacy)
Extends obj importer for importing NURBS directly as Curves,
avoiding importing and converting legacy curves. This change
only affects geonode importer, and will not be a change in
behavior for users (import operator will still create legacy curve).

Pull Request: https://projects.blender.org/blender/blender/pulls/145850
2025-09-08 19:16:48 +02:00
Damien Picard
f2b61b0874 UI: Fix and improve a few messages
- "grease pencil" -> "Grease Pencil": title case.
- "Display type" -> "Display Type": title case for property name.
- "Bezier" -> "Bézier": proper noun.
- "Mem:%dM, Peak %dM" -> "Mem:%dM, Peak: %dM": missing colon.
- "cannot save image while rendering" -> "Cannot": Sentence case.
- "Linked data cannot text-space transform" -> "Cannot create
  transform on linked data": rephrase strange sentence.
- "Unsupported object type for text-space transform" -> "... for
  texture space transform": unnecessary abbreviation.
- "Cannot write to asset %s:  %s": remove double space.
- "Failed to set tmpact" -> "temporary action": unclear abbreviation.
- "luminance at which the midetones of the image" -> "midtones: typo.
- "Line angle where the image should be split." -> trailing full stop.
- "... instances all the children in the collection" -> "... instances
  of all the children...": missing "of".
- "Curves to generated rounded corners on" -> "generate": typo.
- "Instances that converted to a point per instance" -> "Instances to
  convert to points": rephrase unclear sentence.
- "Great Pencil to set the depth order of" -> "Grease Pencil": typo.
- "Description to set the smoothness of" -> "Geometry to set the
  smoothness of": typo.
- "A cannot use current file as library" -> "cannot use...": typo.

Pull Request: https://projects.blender.org/blender/blender/pulls/145840
2025-09-07 00:26:31 +02:00
luz paz
1b49b94e0d Cleanup: Fix typos in source/blender/io
Fixes various user-facing and non-user-facing typos.

Pull Request: https://projects.blender.org/blender/blender/pulls/145804
2025-09-05 20:17:28 +02:00
Jesse Yurkovich
3e3ee35e9d Fix #145711: Packed images may fail to export with USD
Certain packed images, like those loaded directly into memory with
`BKE_image_packfiles_from_mem`, would cause USD to process the images as
"in memory" rather than as "packed" because the API was not removing the
IMG_GEN_TILE flag.

Additionally, be sure to use the packed filepath whenever possible
rather than the name given to the Image datablock as this ensures the
correct file names are used inside the USD file and for the resulting
file on disk after export.

This also fixes 2 render tests which now match when compared to the
native renders.

Pull Request: https://projects.blender.org/blender/blender/pulls/145749
2025-09-05 19:41:20 +02:00
Brecht Van Lommel
ffa4f8c7ad Refactor: Split off lighter BLI_color_types.hh from BLI_color.hh
Functions for convert between the color types and ostream support are
now outside the classes.

Many files were changed to fix cases where direct includes for headers
were missing.

Pull Request: https://projects.blender.org/blender/blender/pulls/145756
2025-09-05 11:11:32 +02:00
Aras Pranckevicius
37b1886769 Fix #145244: FBX importer does not import textures from some files
Some FBX files contain somewhat incorrect relative paths for their
material textures. The old Python importer was "working" only as a side
effect that it was exhaustively searching the subfolder hierarchy.

Try to do a smaller version of that here too: if referenced image
is still not found after trying the regular relative/absolute paths,
try taking longer path parent chains from the absolute path coming
from FBX file, and using that as relative path wrt the FBX file itself.

Pull Request: https://projects.blender.org/blender/blender/pulls/145641
2025-09-03 10:26:10 +02:00
Aras Pranckevicius
eb96ef2dff Fix #145116: new FBX importer does not handle geometry transform + instancing properly
When instanced meshes were using FBX geometric transforms, the code
was not telling ufbx to create proper adjustment helper nodes due to
UFBX_GEOMETRY_TRANSFORM_HANDLING_MODIFY_GEOMETRY_NO_FALLBACK flag.
That flag was put in earlier, before import of armatures was solidified,
turns out using the proper flag (UFBX_GEOMETRY_TRANSFORM_HANDLING_MODIFY_GEOMETRY)
is not a problem anymore.

Pull Request: https://projects.blender.org/blender/blender/pulls/145527
2025-09-01 19:39:54 +02:00
Jesse Yurkovich
9f4ac95357 Fix: USD: Camera FStop of 0 means no depth of field
If a USD camera has an fstop value of 0, we need to treat that as
meaning DOF should be disabled (and animate it accordingly).

https://openusd.org/release/api/class_usd_geom_camera.html#a335e1647b730a575e3c0565e91eb8d49

Pull Request: https://projects.blender.org/blender/blender/pulls/145366
2025-08-29 22:33:10 +02:00
YimingWu
af700685e7 Fix #145259: Grease Pencil: Bail when no frame is selected for SVG export
Previously `SVGExporter::export_scene` can work on a empty `frames`
index mask, causing crash. Now it will exit early when no frames are
selected, and it will show a warning to the user.

Pull Request: https://projects.blender.org/blender/blender/pulls/145286
2025-08-29 12:03:29 +02:00
Hans Goudey
c01d4a4ee6 Refactor: Deduplicate position transform utilities
The pattern of transforming many position vectors at once is quite
common, both with separate source and result arrays, and when modifying
an array in place. In some cases at least we used a separate function
with a consistent name across files, but there were also many duplicate
parallel transform implementations.

This commit adds these utilities to the BLI_math_matrix.hh API and uses
them where many positions from contiguous arrays are transformed at
once. While there might be a more ideal location for these utilities,
it's consistent with 3936d7a93e, and certainly better
than duplicating them.

This also reduces binary size of my build by 15 KB.

Pull Request: https://projects.blender.org/blender/blender/pulls/145352
2025-08-28 19:27:17 +02:00
Hans Goudey
d74c033a9d Cleanup: Remove else after return in grease_pencil_io.cc 2025-08-28 19:27:16 +02:00
Jesse Yurkovich
7111e95527 USD: Import UsdNurbsCurves as Curves instead of old Curve
Refactor and revamp import and export of `UsdGeomNurbsCurves` prim
objects.

Fixes #130056, among other things.

Summary of changes and enhancements:
- Export:
  - Write out `nurb_weight` attribute as the USD `pointWeights` primvar
  - Properly write out cyclic NURBS curves data (* see notes)
- Import:
  - Import using the new `Curves` datablock rather than the old `Curve`
  - Properly read in cyclic NURBS curves data (* see notes)
  - Tries harder to match incoming knot vector to standard `knots_mode`,
    will use Custom otherwise
  - Support import of all custom primvars and data attached to the prim
    (for use with Geometry Nodes etc.) (* see notes)

Tests were added which check a variety of point count, order, knot_mode,
and cyclic combinations (generated through Geometry Nodes). A small
number of hand-crafted curves were used to test the Custom knots_mode
support on import. Additionally, the tests cover the case when there are
multiple curves defined for a single object.

Notes:
- Cyclic NURBS support is reliant on the current, under-spec'd, USD
  documentation. Changes may be required in the future if/when the USD
  spec is clarified: https://github.com/PixarAnimationStudios/OpenUSD/issues/3740
- Some Cyclic x knots_mode combinations are not correct and would
  require more research to determine how to properly address.
- Custom attributes are not imported for Cyclic NURBS curves yet. Those
  will require additional work to function correctly and are also
  reliant on seeing how the USD spec changes.

Pull Request: https://projects.blender.org/blender/blender/pulls/143970
2025-08-27 19:34:46 +02:00
Hans Goudey
18fc19b4fe Cleanup: Rename "mloopuv" to "uv_map"
The old name refers to the `MLoopUV` struct which isn't use anymore.

Pull Request: https://projects.blender.org/blender/blender/pulls/145251
2025-08-27 17:44:08 +02:00
Jesse Yurkovich
bd6c4d73a0 Fix: Crash during USD import of an instanced point-instancer
Found while trying to import an instanced point-instancer with the
operator setting `support_scene_instancing=false`.

The point-instancer Prototype would be partially processed but not
completely since the option was disabled. This caused a discrepancy
during the final portion of import where the view layer was synced and
we attempted to query for an object that was not present.

Pull Request: https://projects.blender.org/blender/blender/pulls/144845
2025-08-22 22:22:47 +02:00
Campbell Barton
25ec9729dc Build: correct TBB include
`TBB_INCLUDE_DIR` is not meant to be used directly and isn't declared
on Linux. Replace with `TBB_INCLUDE_DIRS`.
2025-08-21 13:37:33 +10:00
Jesse Yurkovich
d4b0f02f72 Fix: Incorrect attribute type check during USD shape import
Accidentally changed in 1f92fd7577 and only noticed because there was a
suspicious drop in code coverage for the affected file.

Fix and add tests to ensure it doesn't happen again.

Pull Request: https://projects.blender.org/blender/blender/pulls/144702
2025-08-18 06:16:57 +02:00
Hans Goudey
072d251b8e Refactor: Use optional Span instead of empty Span with no attribute
The semantics of checking "has_value()" (etc.) are much better than
checking for an empty span when dealing with the result of an attribute
lookup. This mainly affects the Bezier curve handle position attributes
currently. Plenty of places assume those attributes exist now. In a
couple places the code is a bit safer now, otherwise it's just a bit
more obvious.

Pull Request: https://projects.blender.org/blender/blender/pulls/144506
2025-08-17 18:08:18 +02:00
Oxicid
b1d9a91647 FBX: Add material name collision mode
Introduces the Material Name Collision option, similar to how
USD / OBJ importers have it.

Pull Request: https://projects.blender.org/blender/blender/pulls/144375
2025-08-15 15:04:36 +02:00
Thomas Hope
da46eed108 IO: Add Apply Transforms option to obj exporter
When enabled (default), exported OBJ files have the object transform
applied to their vertices. This is the previous default behaviour.

When disabled, exported vertices use their local object coordinates.

Pull Request: https://projects.blender.org/blender/blender/pulls/139436
2025-08-15 15:03:44 +02:00
Falk David
d50c0b7942 Cleanup: Fix compiler warning
This was caused by 8c3e81bd9b.
2025-08-14 18:08:20 +02:00
Casey Bianco-Davis
b056d3c85c Grease Pencil: Export other curve types to SVG
This adds support for bézier, NURBS and catmull rom curve
types in SVG exporting.

Note: strokes without uniform width will still be exported as
polylines. This is because the outline code currently does not
support bézier curves.

Pull Request: https://projects.blender.org/blender/blender/pulls/141594
2025-08-14 13:51:27 +02:00
Casey Bianco-Davis
8c3e81bd9b Fix: Grease Pencil: SVG and PDF bounding box size bug
Some times when exporting, the bounding box would have a size of zero.
This made it so that no points were visible.

This PR fixes the bounding size by using the already existing
`ed::greasepencil::retrieve_visible_strokes` function.

Pull Request: https://projects.blender.org/blender/blender/pulls/144516
2025-08-14 13:46:33 +02:00
Jesse Yurkovich
0240a1f32f Cleanup: CMake: Modernize bf_intern_openvdb dependencies
This follows the other CMake "modernization" commits, this time for
`bf_intern_openvdb` and the OpenVDB dependency itself.

The difference with this one is that `intern/openvdb` becomes an
"optional" dependency itself. This is because downstream consumers often
want to include this dependency rather than openvdb directly, so this
target must also be optional. Optional, in this case, means the target
always exists but may be entirely empty.

Summary
- If you are using BKE APIs to access openvdb features, then use the
  `bf::blenkernel` target
- If you are only using `intern/openvdb` APIs then use the
  `bf::intern::optional::openvdb` target (rare)
- For all other cases, use the `bf::dependencies::optional::openvdb`
  target (rare)

context: https://devtalk.blender.org/t/cmake-cleanup/30260
Pull Request: https://projects.blender.org/blender/blender/pulls/137071
2025-08-12 21:26:38 +02:00
Jesse Yurkovich
5a5f768938 Tests: USD: Replace USDZ export test with another for better validation
Move the existing USDZ export test from C++ to Python for better
validation. The resulting file is now run through the `usdchecker`
system and we also check the contents of the resulting archive for the
expected texture file. This helped uncover a pathing issue in the
resulting archive where the 'textures' directory was misnamed on win32;
though it was still functional.

Pull Request: https://projects.blender.org/blender/blender/pulls/144176
2025-08-12 00:21:04 +02:00
Brecht Van Lommel
92b555452b Refactor: Logging: Replace more printf with CLOG
Mainly for images, and a few individual cases in animation, ply, UI, and WM.

Pull Request: https://projects.blender.org/blender/blender/pulls/143447
2025-08-11 14:07:45 +02:00
Campbell Barton
cccc2c77c5 Cleanup: consistent for C-style comment blocks 2025-08-08 07:37:33 +10:00
Jesse Yurkovich
2822b3badf Fix: USD: Use exr instead of hdr for world light texture
The spec for .usdz permits only a small handful of file formats to be
contained in the archive, and HDR is not among those supported[1]. This
also causes validation errors with the `usdchecker` tool (will be
properly tested in a follow up change).

Ignoring the potential for a user to export a .usdz file with materials
referencing unsupported file formats, Blender itself should use only
the supported formats for its business.

[1] https://openusd.org/release/spec_usdz.html#usdz-specification

Pull Request: https://projects.blender.org/blender/blender/pulls/144101
2025-08-07 20:54:22 +02:00
Falk David
4a013194dd Cleanup: Core: Replace FPS scene macro with member function
Replaces the `FPS` macro with `scene->frames_per_second()`.

The macro has two major issues:
* It hides that it depends on a `Scene *` variable named `scene`.
* It makes debugging harder.

This is now replaced with a member function on the scene.

Pull Request: https://projects.blender.org/blender/blender/pulls/144127
2025-08-07 11:30:25 +02:00
Jesse Yurkovich
cb9ae01c69 Cleanup: USD: Remove some redundant property type checks
For cases where we've already checked that the property is holding a
particular type, use UncheckedGet to ensure the type isn't checked a
second time. This matches all the other call sites doing similar.

Pull Request: https://projects.blender.org/blender/blender/pulls/144084
2025-08-06 21:21:24 +02:00
Damien Picard
5998795aa6 UI: Replace contractions with long-form text
Avoid using contractions for can't, aren't, doesn't, and shouldn't.
Following the writing style guide in the Human Interface Guidelines.

Pull Request: https://projects.blender.org/blender/blender/pulls/143852
2025-08-05 11:16:22 +02:00
Bastien Montagne
0e52304772 Fix building (missing include). 2025-08-04 17:54:15 +02:00
Brecht Van Lommel
526b776417 Fix: Build error with USD/Hydra with some build systems
Move API shared between USD and Hydra to usd_private.hh. It seems ninja
added an include directory other build systems don't.
2025-08-04 17:21:09 +02:00
Dawid Kurek
9afa991316 Hydra: Handle dome light rotation
This refactors the code for world to dome light to be shared between USD and
Hydra, and makes rotations work for Hydra the same way they do in USD.

One small behavior change is that missing image files now render black,
matching Cycles and EEVEE more closely.

Co-authored-by: Brecht Van Lommel <brecht@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/143035
2025-08-04 15:58:37 +02:00