Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-10-17Cleanup: replace BLI_join_dirfile with BLI_path_joinCampbell Barton
These functions are almost identical, the main difference being BLI_join_dirfile didn't trim existing slashes when joining paths however this isn't an important difference that warrants a separate function.
2022-10-10IO: support Presets in Alembic, Collada, OBJ, STL, USD importersAras Pranckevicius
The exporters already had Preset functionality, but the importers did not.
2022-10-10OBJ: add global scale factor import settingAras Pranckevicius
Requested in D16095 proposal - also USD & Alembic have import scale option; OBJ has an export scale object but the import scale was not there for some reason.
2022-10-07Cleanup: redundant parenthesisCampbell Barton
2022-09-14Fix T49814: Collada Import Ignores Vertex NormalsMyron Carey
We now import and apply custom normals using a similar strategy to the STL importer. We store custom normal data for each loop as we read each MPoly and then apply it to the mesh after `BKE_mesh_calc_edges()` is called. The new behavior is optional and may be disabled in the Collada import UI. When disabled, we use the old behavior of only using normals to determine whether or not to smooth shade an MPoly. ---- Patch as requested in {T49814}. The Collada import UI now has an additional checkbox, similar to the glTF and FBX import UIs: {F13428264} Here is a test Collada file with a simple test cube with flipped custom normals: {F13428260} {F13428282} And a sphere where the two halves are disconnected geometry, but has custom normals that make the halves appear to be connected: {F13436363} {F13436368} I've tested it on a number of my own meshes, and the custom normals appear to be imported correctly. I'm not too sure about how I've plumbed the option down, though, or whether this is the most proper way to apply custom normals. Reviewed By: gaiaclary Differential Revision: https://developer.blender.org/D15804
2022-09-13obj: implement support for PBR .mtl extensionsAras Pranckevicius
Implement import & export support for "PBR extensions" in .mtl files (T101029, also fixes T86736). Newly supported parameters: - Roughness (Pr, map_Pr) - Metallic (Pm, map_Pm) - Sheen (Ps, map_Ps) - Clearcoat thickness (Pc) and roughness (Pcr) - Anisotropy (aniso) and rotation (anisor) - Transmittance (Tf / Kt) Exporter has an option to enable these additional PBR parameters export; defaults to off since not all software understands that. Exporter UI tweaked and all material-related options were put into their own separate box. Added/extended test files in Subversion repository for test coverage.
2022-09-12USD IO: fixed compiler warningsMichael Kowalski
2022-09-12Fix T100016: Memory leak in USD importer.Michael Kowalski
These changes were implemented by Sonny Campbell. Fixed the first issue by freeing the operator customdata when the import is cancelled. Fixed the second issue by using a character array instead of allocating new memory for the prim_path_mask. Differential Revision: https://developer.blender.org/D15781
2022-09-12UI: Cleanup/Fixes of some UI messages.Bastien Montagne
2022-09-08Fix T100887: Some C++ importers/exporters (e.g. OBJ) reset file dialog Sort ↵Aras Pranckevicius
By mode A couple years ago D8598 made it so that C++ operators generally should use "default" sort mode, which remembers previously used sort setting. Back then all the places that needed it got changed to use this "default" one, but since then some more IO code landed, where seemingly by accident it used "sort by file name": - USD importer, - Grease Pencil exporter, - OBJ importer & exporter, - STL importer. Reviewed By: Julian Eisel Differential Revision: https://developer.blender.org/D15906
2022-09-08Fix T96297: obj: improve layout of UI fields and axis validationAras Pranckevicius
Implement ideas from T96297: - Fix "invalid axis settings" (both forward & up along the same direction) validation: now similar to the Python based code, when invalid axis is applied, the other axis is changed to not conflict. - Make axis enums be expanded inside the row, similar to Collada UI. - Move "selected only" near the top, similar to how it's in Collada, USD, FBX and glTF export UIs. - Move animation export options to the bottom.
2022-09-07Cleanup: factor out "set default filepath" into a ↵Aras Pranckevicius
ED_fileselect_ensure_default_filepath Follow up to D15904, a bunch of places had exact same logic for "is filepath set? if not, set some default one", so factor all that out into a separate ED_fileselect_ensure_default_filepath function.
2022-09-07Fix T100797: C++ exporters do not remember the path on subsequent exportsAras Pranckevicius
Most/all C++ based IO code had a pattern of doing using RNA_struct_property_is_set to check whether a default path needs to be set. However, it returns false for properties restored from "previous operator settings" (property restoration code sets IDP_FLAG_GHOST flag on them, which "is set" sees and goes "nope, not set"). The fix here is to apply similar logic as 10 years ago in the T32855 fix (rBdb250a4): use RNA_struct_property_is_set_ex instead. Reviewed By: Campbell Barton Differential Revision: https://developer.blender.org/D15904
2022-09-05I18n: translate untitled file namesDamien Picard
When saving, the default file name is "untitled" regardless of selected language. This can be translated, like many graphical applications do. This applies to: - blend file - alembic file - collada file - obj file - usd file - rendered image - grease pencil export - subtitles export - other Python exports through ExportHelper Reviewed By: mont29 Differential Revision: https://developer.blender.org/D15868
2022-08-17Fix: build issue with MSVCRay Molenkamp
empty initializers are not allowed in C99 introduced by rB2481be90e38d36abc06501c395105fa1833baf1c
2022-08-17WM: ensure AlembicImportParams are always initializedCampbell Barton
Initialize all members before assignment, ensuring newly added members are never left uninitialized.
2022-08-16Cleanup: use a structure for Alembic import parametersKévin Dietrich
Also renammed some parameters and sprinkled a dash of documentation.
2022-08-11obj: support importing multiple files at onceAras Pranckevicius
Implemented the same way as STL or GPencil SVG importers: loop over the input files, import one by one. Has been requested by the community for quite a long time (e.g. https://blender.community/c/rightclickselect/Jhbbbc/), as well as 3rd party addons to implement just this (https://github.com/p2or/blender-batch-import-wavefront-obj).
2022-08-09Cleanup: sort cmake file-listsCampbell Barton
2022-08-02GPencil: Allow import several SVG at timeAntonio Vazquez
For SVG is very convenient to be able to import several SVG in one operation. Each SVG is imported as a new Grease Pencil object. Also, now the SVG file name is used as Object name. Important: As all SVG imported are converted to Grease Pencil object in the same location of the 3D cursor, the SVG imported are not moved and the result may require a manual fix of location. The same is applied for depth order, the files are imported in alphabetic order according to the File list. Reviewed By: mendio, pepeland Differential Revision: https://developer.blender.org/D14865
2022-08-01Fix T100076: OBJ import: new importer doesn't use //relative/image/pathsAras Pranckevicius
The Python based importer had logic to immediately turn image paths into relative-to-blender-file paths, if user preference for relative paths is used (which is on by default). The new importer code did not have that. Fixes T100076.
2022-06-30Cleanup: Remove scene frame macros (`CFRA` et al.)Julian Eisel
Removes the following macros for scene/render frame values: - `CFRA` - `SUBFRA` - `SFRA` - `EFRA` These macros don't add much, other than saving a few characters when typing. It's not immediately clear what they refer to, they just hide what they actually access. Just be explicit and clear about that. Plus these macros gave read and write access to the variables, so eyesores like this would be done (eyesore because it looks like assigning to a constant): ``` CFRA = some_frame_nbr; ``` Reviewed By: sergey Differential Revision: https://developer.blender.org/D15311
2022-06-19Fix T98874: new obj importer missing an option to import vertex groupsAras Pranckevicius
The old Python OBJ importer had a (somewhat confusingly named) "Keep Vertex Order -> Poly Groups" option, that imported OBJ groups as "vertex groups" on the resulting mesh. All vertices of any face were assigned the vertex group, with a 1.0 weight. The new C++ importer did not have this option. It was trying to do something with vertex groups, but failing to actually achieve anything :) -- the vertex groups were created on the wrong object (later on overwritten by "nomain mesh to main mesh" operation); vertex weights were set to 1.0/vertex_count, and each vertex was only set to be in one group, even when it belongs to multiple faces from different groups. End result was that to the user, vertex groups were not visible/present at all (see T98874). This patch adds the import option (named "Vertex Groups"), which is off by default, and fixes the import code logic to actually do the right thing. Tested on file from T98874; vertex groups are imported just like with the Python importer. Reviewed By: Howard Trickey Differential Revision: https://developer.blender.org/D15200
2022-06-14obj: vertex colors support in importer and exporterAras Pranckevicius
Adds support for vertex colors to OBJ I/O. Importer: - Supports both "xyzrgb" and "MRGB" vertex color formats. - Whenever vertex color is present in the file for a model, it is imported and a Color attribute is created (per-vertex, full float color data type). Color coming from the file is assumed to be sRGB, and is converted to linear upon import. Exporter: - Option to export the vertex colors. Defaults to "off", since not all 3rd party software supports vertex colors. - When the option is "on", if a mesh has a color attribute layer, the active one is exported in "xyzrgb" form. If the mesh has per-face-corner colors, they are averaged on the vertices. Colors are converted from linear to sRGB upon export. Reviewed By: Howard Trickey Differential Revision: https://developer.blender.org/D15159
2022-06-10USD import: Handle material name collisionsMichael Kowalski
This is a partial fix for T90535. Added Material Name Collision USD import menu option, to specify the behavior when USD materials in different namespaces have the same name. The Material Name Collision menu options are - Make Unique: Import each USD material as a unique Blender material. - Reference Existing: If a material with the same name already exists, reference that instead of importing. Previously, the default behavior was to always keep the existing material. This was causing an issue in the ALab scene, where dozens of different USD materials all have the same name, usdpreviewsurface1, so that only one instance of these materials would be imported. Reviewed by: Sybren Differential Revision: https://developer.blender.org/D14869
2022-06-08CMake: optionally disable OBJ, STL & GPencil SVG supportCampbell Barton
The following CMake options have been added (enabled by default), except for the lite build configuration. - WITH_IO_STL - WITH_IO_WAVEFRONT_OBJ - WITH_IO_GPENCIL (for grease pencil SVG importing). Note that it was already possible to disable grease pencil export by disabling WITH_PUGIXML & WITH_HARU. This is intended to keep the lite builds fast and small for building, linking & execution. Reviewed By: iyadahmed2001, aras_p, antoniov, mont29 Ref D15141
2022-06-06STL: Add new C++ based STL importerIyad Ahmed
A new experimentatl STL importer, written in C++. Roughly 7-9x faster than the Python based one. Reviewed By: Aras Pranckevicius, Hans Goudey. Differential Revision: https://developer.blender.org/D14941
2022-06-05Cleanup: assign operator type flags in their initializationCampbell Barton
Some operators OR'ed the existing flags in a way that made it seem the value might already have some values set. Replace this with assignment as no flags are set and the convention with almost all operators is to write the value directly.
2022-06-02USD: Enable operator presets when exportingPhilipp Oeser
This patch enables operator presets for USD exports. The export menu has many options, so enabling the feature will help users manage their export settings in the same way they can with other filetypes. Same as {rB1d668b635632} Differential Revision: https://developer.blender.org/D14896
2022-05-31OBJ: Enable undo for experimental OBJ importerIyad Ahmed
The new OBJ importer operator didn't register an undo event. This commit enables the register and undo flags for the operator. Reviewed By: Bastien Montagne, Aras Pranckevicius, Serhiy Striletksy Differential Revision: https://developer.blender.org/D15051
2022-05-23Fix T98293: Scene stats info not updated after new OBJ importAras Pranckevicius
The importer was not doing a notification that the scene has changed, so the bottom status bar scene stats info was not updated right after the new OBJ import. Reviewed By: Julian Eisel Differential Revision: https://developer.blender.org/D15015
2022-05-17Cleanup: use term 'filepath' for full file pathsCampbell Barton
2022-05-11Merge branch 'blender-v3.2-release'Philipp Oeser
2022-05-11Fix T97947: USD will fail to export without file extensionPhilipp Oeser
Now add a default ".usdc" file extension if no (or the wrong) extension is given instead of presenting the user with the error that "no suitable USD plugin to write is found". This is in line with how other exporters do this. Maniphest Tasks: T97947 Differential Revision: https://developer.blender.org/D14895
2022-05-10Merge branch 'blender-v3.2-release'Aras Pranckevicius
2022-05-10Fix T96399: New 3.1 OBJ exporter is missing Path Mode settingAras Pranckevicius
New OBJ exporter is missing "Path Mode" setting for exporting .mtl files. The options that used to be available were: Auto, Absolute, Relative, Match, Strip Path, Copy. All of them are important. The new behavior (without any UI option to control it) curiously does not match any of the previous setting. New behavior is like "Relative, but to the source blender file, and not the destination export file". Most of the previous logic was only present in Python based code (bpy_extras.io_utils.path_reference and friends). The bulk of this commit is porting that to C++. Reviewed By: Howard Trickey Differential Revision: https://developer.blender.org/D14906
2022-05-07Fix T97751: New OBJ IO - File Browser doesn't filter by .obj/.mtlJulian Eisel
Makes the File Browser filter by .obj and .mtl files by default again. Note that this commit focuses on fixing this specific bug, further refactors/tweaks/fixes are planned (see D14863). Differential Revision: https://developer.blender.org/D14862 Reviewed by: Aras Pranckevicius
2022-05-07Fix T97751: New OBJ IO - File Browser doesn't filter by .obj/.mtlJulian Eisel
Makes the File Browser filter by .obj and .mtl files by default again. Note that this commit focuses on fixing this specific bug, further refactors/tweaks/fixes are planned (see D14863). Differential Revision: https://developer.blender.org/D14862 Reviewed by: Aras Pranckevicius
2022-05-06USD: add volume/VDB exportPiotr Makal
Add support for volume (OpenVDB) USD export: - Allows to export both static and animated volumes. - Supports volumes that have OpenVDB data from files or are generated in Blender with 'Mesh to Volume' modifier. - For volumes that have generated data in Blender it also exports corresponding .vdb files. Those files are saved in a new folder named "volumes". - Slightly changes the USD export UI panel. "Relative Texture Paths" becomes "Relative Paths" (and has separate UI box) as the functionality will now apply to both textures and volumes. Disabling of this option due to "Materials" checkbox being turned off has been removed. Reviewed By: sybren, makowalski Differential Revision: https://developer.blender.org/D14193 Manifest Task: T95407
2022-05-03Alembic: Enable operator presets when exportingEthan-Hall
This patch enables operator presets for Alembic exports. The export menu has many options, so enabling the feature will help users manage their export settings in the same way they can with other filetypes. This also fixes restoring the default operator value for setting the frame range. Differential Revision: https://developer.blender.org/D12849
2022-04-28Fix T97142: When Exporting GPencil, File Dialog Shows No SubfoldersAntonio Vazquez
The export had missing the `FILE_TYPE_FOLDER` flag.
2022-04-22Fix various typos and other UI messages issues.Bastien Montagne
2022-04-17OBJ: further optimize, cleanup and harden the new C++ importerAras Pranckevicius
Continued improvements to the new C++ based OBJ importer. Performance: about 2x faster. - Rungholt.obj (several meshes, 263MB file): Windows 12.7s -> 5.9s, Mac 7.7s -> 3.1s. - Blender 3.0 splash (24k meshes, 2.4GB file): Windows 97.3s -> 53.6s, Mac 137.3s -> 80.0s. - "Windows" is VS2022, AMD Ryzen 5950X (32 threads), "Mac" is Xcode/clang 13, M1Max (10 threads). - Slightly reduced memory usage during import as well. The performance gains are a combination of several things: - Replacing `std::stof` / `std::stoi` with C++17 `from_chars`. - Stop reading input file char-by-char using `std::getline`, and instead read in 64kb chunks, and parse from there (taking care of possibly handling lines split mid-way due to chunk boundaries). - Removing abstractions for splitting a line by some char, - Avoid tiny memory allocations: instead of storing a vector of polygon corners in each face, store all the corners in one big array, and per-face only store indices "where do corners start, and how many". Likewise, don't store full string names of material/group names for each face; only store indices into overall material/group names arrays. - Stop always doing mesh validation, which is slow. Do it just like the Alembic importer does: only do validation if found some invalid faces during import, or if requested by the user via an import setting checkbox (which defaults to off). - Stop doing "collection sync" for each object being added; instead do the collection sync right after creating all the objects. Cleanup / Robustness: This reworking of parser (see "removing abstractions" point above) means that all the functions that were in `parser_string_utils` file are gone, and replaced with different set of functions. However they are not OBJ specific, so as pointed out during review of the previous differential, they are now in `source/blender/io/common` library. Added gtest coverage for said functions as well; something that was only indirectly covered by obj tests previously. Rework of some bits of parsing made the parser actually better able to deal with invalid syntax. E.g. previously, if a face corner were a `/123` string, it would have incorrectly treated that as a vertex index (since it would get "hey that's one number" after splitting a string by a slash), instead of properly marking it as invalid syntax. Added gtest coverage for .mtl parsing; something that was not covered by any tests at all previously. Reviewed By: Howard Trickey Differential Revision: https://developer.blender.org/D14586
2022-04-15UI: Improve wording for some USD export descriptionsHans Goudey
The HIG mentions that redundant words like "Enables" or "Activates" shouldn't be used for tooltips of boolean properties. In this case "When checked" was the redundant language that was implied by the checkbox itself-- convention is to just state what the property does when it's on. Also change a few conjugations to the imperative and simplify wording slightly, in order to be more consistent with language elsewhere in Blender, and to be a bit more direct. Differential Revision: https://developer.blender.org/D14644
2022-04-07Cleanup: clang-formatCampbell Barton
2022-04-05Refactor: Unify vertex and sculpt colors into newJoseph Eagar
color attribute system. This commit removes sculpt colors from experimental status and unifies it with vertex colors. It introduces the concept of "color attributes", which are any attributes that represents colors. Color attributes can be represented with byte or floating-point numbers and can be stored in either vertices or face corners. Color attributes share a common namespace (so you can no longer have a floating-point sculpt color attribute and a byte vertex color attribute with the same name). Note: this commit does not include vertex paint mode, which is a separate patch, see: https://developer.blender.org/D14179 Differential Revision: https://developer.blender.org/D12587 Ref D12587
2022-04-04OBJ: New C++ based wavefront OBJ importerAnkit Meel
This takes state of soc-2020-io-performance branch as it was at e9bbfd0c8c7 (2021 Oct 31), merges latest master (2022 Apr 4), adds a bunch of tests, and fixes a bunch of stuff found by said tests. The fixes are detailed in the differential. Timings on my machine (Windows, VS2022 release build, AMD Ryzen 5950X 32 threads): - Rungholt minecraft level (269MB file, 1 mesh): 54.2s -> 14.2s (memory usage: 7.0GB -> 1.9GB). - Blender 3.0 splash scene: "I waited for 90 minutes and gave up" -> 109s. Now, this time is not great, but at least 20% of the time is spent assigning unique names for the imported objects (the scene has 24 thousand objects). This is not specific to obj importer, but rather a general issue across blender overall. Test suite file updates done in Subversion tests repository. Reviewed By: @howardt, @sybren Differential Revision: https://developer.blender.org/D13958
2022-03-25USD I/O: explicitly set or clear the OPTYPE_UNDO flagSybren A. Stüvel
Exporting USD cannot be undone, but importing should be undo'able.
2022-03-20Fix T96470 new obj exporter writing material groupsAras Pranckevicius
This is patch D14349 from Aras Pranckevicius. The logic in the code was _completely different_ from the documentation and what the python exporter in 3.0 did. The new code assumed that "export material groups" meant "append material name to the object name", and was only ever kicking in when the "export object groups" option was also checked. But the proper behavior (as in 3.0 exporter & the online docs), is to emit g objectname_materialname before each usemtl line. Which is something entirely else.
2022-03-19Make Format ChangesHarley Acheson
Only formatting changes found by running "make format", no functional changes Committed without review, but with verbal approval by Hans Goudey