Commit Graph

11 Commits

Author SHA1 Message Date
Campbell Barton
4f5f0040c0 Cleanup: back-tick quote file extensions in code-comments 2024-05-04 15:06:46 +10:00
Campbell Barton
761dd6c923 IO: enable mesh validation by default for STL, PLY & OBJ importers
When moving importers from Python to C++ validation was removed
(from PLY) & disabled by default (STL & OBJ) which re-introduces
crashes reported by users such as #31835.

Enable validation by default because crashes caused by imported data
should be avoided, especially since the crashes may happen later when
users enter edit-mode or run certain editing operations.

This does slow down importing, from testing a 236MB .OBJ it takes around
twice as long to import (~1.5 to ~3 seconds). Although validation can
be optimized to reduce the overhead ad well as run in parallel for
importers that load multiple objects.

The defaults for USD and Alembic remain unchanged since this was never
enabled by default, although we could consider enabling these as well.
2024-05-04 14:40:06 +10:00
Jesse Yurkovich
509a7870c3 Collection Exporters: Enable file exporters to be specified on Collections
This implements the ability to have file exporters added and configured on Collections.

Exporting is reachable from several locations:
- Individually on each exporter configuration: The `Export` button in each panel header
- For all exporters on the collection: The `Export All` button in the main panel interface
- For all exporters on all collections in the scene: The `File`->`Export All Collections` button

Visibility of which collections currently have exporters configured is done by ways of an icon added to the Collection row in the Outliner.

Adding multiple exporters for the same file type is permitted. The user is free to setup several exports of the same format but with different file locations or settings etc.

Notes:
Only USD and Wavefront OBJ are enabled for the initial commit. Additional formats, including those implemented in Python will be added as separate commits after this.

Ref #115690
Pull Request: https://projects.blender.org/blender/blender/pulls/116646
2024-04-08 22:10:39 +02:00
Jesse Yurkovich
5ad9f9dc90 Cleanup: unused includes in source/blender/io
Reduce dependence on Blender headers as much as possible and move closer
to an include-what-you-use setup.

- Removes unnecessary includes
- Replaces some includes with more appropriate, narrower, substitutes

Pull Request: https://projects.blender.org/blender/blender/pulls/119234
2024-03-10 04:28:00 +01:00
Jesse Yurkovich
5d9e127234 Fix: Proper error handling for STL, PLY, and OBJ IO
Properly handle exceptions from STL and PLY code to prevent crashes on
invalid file paths.

This will now also Report errors/warnings to the callers of these
formats as well. For the UI this means a Report banner and Info editor
entry. For Python scripts this means an exception instead of silently
continuing.

Related to #117881
Pull Request: https://projects.blender.org/blender/blender/pulls/118731
2024-02-26 20:45:46 +01:00
Aras Pranckevicius
19f4f84005 OBJ: add import option to create collection hierarchy by splitting names with a separator
Implements #105001 - new import option for name separator, e.g. "|" or "/".
Names found in the OBJ file are split by that, and a Collection hierarchy is
made, so you can have e.g. "o House/Roof/Tile" in the OBJ file.

Pull Request: https://projects.blender.org/blender/blender/pulls/115742
2023-12-04 09:54:52 +01:00
Hans Goudey
3d57bc4397 Cleanup: Move several blenkernel headers to C++
Mostly focus on areas where we're already using C++ features,
where combining C and C++ APIs is getting in the way.

Pull Request: https://projects.blender.org/blender/blender/pulls/114972
2023-11-16 11:41:55 +01:00
Hans Goudey
867f99c2af Cleanup: Move depsgraph headers to C++
Pull Request: https://projects.blender.org/blender/blender/pulls/110816
2023-09-22 03:18:17 +02:00
Campbell Barton
8032ee9df2 Revert "Cleanup: Replace IO orientation enum with blenlib type"
This reverts commit 074dbf08cd.

This change caused PLY and OBJ tests not to compile,
even with the identifiers updated some OBJ tests fails
with different rotation values.
2023-09-01 10:35:14 +10:00
Hans Goudey
074dbf08cd Cleanup: Replace IO orientation enum with blenlib type
This helps to document standard behavior, improves type
safety, reduces code duplication, and gets us closer to being
able to remove some of the older C math API.
2023-08-31 13:29:52 -04:00
Hans Goudey
78dd7d91c4 Cleanup: Move IO headers to C++
See #103343
2023-08-31 12:52:04 -04:00