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-06-14Fix T85729: Crash when exporting for USD and AlembicSonny Campbell
Ensure the "null" node graph, which is the root node of the export graph, always exists. The crash occured when "Use Settings For" was set to Render, "Visible Objects Only" was ticked, and a single parent object is in the scene but disabled for render. Because the only object attached to the root of the project was disabled for export, there was no "null" root node added to the export graph. This change will always add an empty "null" node with no children to the graph at the start. Other objects will get added to its children as required. Reviewed By: sybren Maniphest Tasks: T85729 Differential Revision: https://developer.blender.org/D15182
2022-06-14Cleanup: Variable name style in STL importerHans Goudey
Designate private variable names as described by the style guide, and also add `num` at the end of variable names rather than at the beginning, as discussed in T85728.
2022-06-14obj: disable vertex color tests until it produces identical results across ↵Aras Pranckevicius
platforms
2022-06-14Fix T98782: ignore OBJ face normal indices if no normals are presentAras Pranckevicius
Some OBJ files out there (see T98782) have face definitions that contain vertex normal indices, but the files themselves don't contain any vertex normals. The code was doing a "hey, that's an invalid index" and skipping these faces. But the old python importer was silently ignoring these normal indices, so do the same here. Reviewed By: Howard Trickey Differential Revision: https://developer.blender.org/D15177
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-13IO: update documentation for `HierarchyIterator::weak_export`Sybren A. Stüvel
The documentation for `HierarchyIterator::weak_export` mentions a feature that was removed at some point. Another example is used to illustrate its functionality. No functional changes.
2022-06-10Fix T97362: forward slashes in USD texture pathsMichael Kowalski
Ensuring that relative paths to textures in exported USDs use forward slash separators, for cross-platform compatibility.
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-10Cleanup: Clang tidyHans Goudey
2022-06-09Cleanup: use C-style comments, add missing doxy sectionCampbell Barton
2022-06-09Cleanup: spelling in comments & variablesCampbell Barton
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-07OBJ: Use filename as the default object nameJesse Yurkovich
To match the existing Python .obj importer, and to make it easier for the user to determine which object is which, use the filename for the default object name instead of "New object". Differential Revision: https://developer.blender.org/D15133
2022-06-07Cleanup: spelling in comments, additional white spaceCampbell Barton
2022-06-07Cleanup: compiler warnings: unused args, missing include, parenthesisCampbell Barton
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-04Cleanup: Use const for retrieved custom data layersHans Goudey
2022-06-04Cleanup: Use const, make formatHans Goudey
2022-06-03Constraints: introduce wrapper functions to access target lists.Alexander Gavrilov
Instead of directly accessing constraint-specific callbacks in code all over blender, introduce two wrappers to retrieve and free the target list. This incidentally revealed a place within the Collada exporter in BCAnimationSampler.cpp that didn't clean up after retrieving the targets, resulting in a small memory leak. Fixing this should be the only functional change in this commit. This was split off from D9732. Differential Revision: https://developer.blender.org/D13844
2022-06-03Cleanup: spelling in commentsCampbell Barton
2022-06-01Cleanup: use 'e' prefix for enum typesCampbell Barton
- CustomDataType -> eCustomDataType - CustomDataMask -> eCustomDataMask - AttributeDomain -> eAttrDomain - NamedAttributeUsage -> eNamedAttrUsage
2022-05-23obj: remove unneeded CTX_data_ensure_evaluated_depsgraphAras Pranckevicius
As discussed on the chat and pointed out in D15015, that call is not needed there (none of the other importers do it either).
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-23Merge branch 'blender-v3.2-release'Aaron Carlisle
2022-05-20Fix wrong USD image color space export with non-default OpenColorIO configBrecht Van Lommel
The names of color spaces in OpenColorIO configs can be arbitrary, so don't use hardcoded names from our default config.
2022-05-18Cleanup: formatCampbell Barton
2022-05-17Cleanup: use term 'filepath' for full file pathsCampbell Barton
2022-05-16Fix std::optional value() build error on older macOS SDKBrecht Van Lommel
No longer happens on the buildbot, but for users building with an older Xcode, still need to avoid using value(). Differential Revision: https://developer.blender.org/D14883
2022-05-14Fix: Build error due to previous commitHans Goudey
2022-05-14Cleanup: Further use of const for retrieved custom data layersHans Goudey
Similar to cf69652618fefcd22b2cde9a2.
2022-05-13Cleanup: Use const when retrieving custom data layersHans Goudey
Knowing when layers are retrieved for write access will be essential when adding proper copy-on-write support. This commit makes that clearer by adding `const` where the retrieved data is not modified. Ref T95842
2022-05-13Cleanup: spelling in comments, capitalize tagsCampbell Barton
Also add missing task-ID reference & remove colon after \note as it doesn't render properly in doxygen.
2022-05-12OBJ: improve new importer file parsing performance on windowsAras Pranckevicius
The OBJ parser was primarily using StringRef for convenience, with functions like "skip whitespace" or "parse a number" taking an input stringref, representing an input line, and returning a new stringref, representing the remainder of the line. This is convenient, but does more work than strictly needed -- while parsing, only the "beginning" of the line ever changes by moving forward; the end of the line always stays the same. We can change the code to take a pair of pointers (begin of line, end of line) as input, and make the functions return the new begin of line pointer. This makes the return value neatly fit into a processor register, which StringRef did not. On Windows, this does result in non-trivial speedups in the actual OBJ file parsing part, due to Windows calling convention where return values larger than 64 bits are returned via memory. Does not measurably affect performance on Mac/Linux, because the calling convention there uses a pair of 64-bit registers to return a StringRef. End-to-end times of importing several test files, on Windows (VS2022 build, Ryzen 5950X): - Monkey subdivided to level 6, no normals (220MB file): 1.25s -> 0.85s - Rungholt minecraft level (270MB file): 7.0s -> 5.8s - Blender 3 splash scene (2.4GB file): 49.1s -> 45.5s The full import process has a lot of other overhead besides actual OBJ file parsing (mostly creating actual blender objects out of parsed data). In pure parsing, in the monkey test scene above, the parsing part goes 1.0s -> 0.6s. Reviewed By: Howard Trickey Differential Revision: https://developer.blender.org/D14936
2022-05-12Merge branch 'blender-v3.2-release'Campbell Barton
2022-05-11Cleanup: fix compiler warnings on macOSLoren Osborn
Differential Revision: https://developer.blender.org/D14917
2022-05-11Cleanup: formatCampbell Barton
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-06obj: move parsing utilities out of io_common, since they are fairly obj specificAras Pranckevicius
As pointed out in https://developer.blender.org/rB213cd39b6db387bd88f12589fd50ff0e6563cf56#341113, the utilities are quite OBJ specific due to treating backslash as a line continuation character. It's unlikely that other formats need that. No functionality changes, just pure code move (and renamed tests so that their names reflect obj). Reviewed By: Campbell Barton Differential Revision: https://developer.blender.org/D14871
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-05Merge branch 'blender-v3.2-release'Aras Pranckevicius
2022-05-05Fix T97863: new OBJ importer issues with extra whitespace after "f" keywordsAras Pranckevicius
While possible extra whitespace after all OBJ/MTL keywords was properly skipped, it was not done for the "f" (face definition) keyword. While at it, also support indented keywords, i.e. extra whitespace at the beginning of the line. There's a tiny bit of performance drop while importing (e.g. importing blender 3.0 splash scene: 53.38sec -> 54.21sec on my machine). But correctness is more important. Reviewed By: Howard Trickey Differential Revision: https://developer.blender.org/D14854
2022-05-05Cleanup: sort cmake file listsCampbell Barton
2022-05-04Merge branch 'blender-v3.2-release'Aras Pranckevicius
2022-05-04Fix T97794: new OBJ importer does not handle quoted MTL pathsAras Pranckevicius
Fixes T97794 (which is a reintroduction of an older issue T67266 that has been fixed in the python importer, but the fix was not in the C++ one). Some software produces OBJ files with mtllib statements like mtllib "file name in quotes.mtl", and the new importer was not stripping the quotes away. While at it, I noticed that MTLParser constructor was taking a StringRef and treating it as a zero-terminated string, which is not necessarily the case. Fixed that by explicitly using a StringRefNull type. Reviewed By: Howard Trickey Differential Revision: https://developer.blender.org/D14838
2022-05-03Merge branch 'blender-v3.2-release'Aras Pranckevicius
2022-05-03Fix T97793, Fix T97795: Use correct defaults for missing values in new OBJ ↵Aras Pranckevicius
importer - Fix T97793: when a UV coordinate after vt is missing, use zero. While at it, also use zeroes for positions & normals, since "maximum possible float" is very likely to cause issues in imported meshes. - Fix T97795: use 1.0 default if -bm value is missing, instead of zero. Reviewed By: Howard Trickey Differential Revision: https://developer.blender.org/D14826
2022-05-03Fix T97757: Some MTL import correctness issues in the new OBJ importerAras Pranckevicius
Fix several correctness issues where the new OBJ/MTL importer was not producing the same results as the old one, mostly because the code for some reason had slightly different logic. Fixes T97757: - When .obj file tries to use a material that does not exist, the code was continuing to use the previous material, instead of creating new default one, as the previous importer did. - Previous importer was always searching/parsing "foo.mtl" for a "foo.obj" file, even if the file itself does not contain "mtllib foo.mtl" statement. One file from T97757 repros happens to depend on that, so resurrect that behavior. - When IOR (Ni) or Alpha (d) are not specified in .mtl file, do not wrongly set -1 values to the blender material. - When base (Kd) or emissive (Ke) colors are not specified in the .mtl file, do not set them on the blender material. - Roughness and metallic values used by viewport shading were not set onto blender material. - The logic for when metallic was set to zero was incorrect; it should be set to zero when "not using reflection", not when "mtl file does not contain metallic". - Do not produce a warning when illum value is not spelled out in .mtl file, treat as default (1). - Parse illum as a float just like python importer does, as to not reintroduce part of T60135. Reviewed By: Howard Trickey Differential Revision: https://developer.blender.org/D14822
2022-05-03Cleanup: spelling in commentsCampbell Barton
2022-05-01Fix T97644: new 3.2 obj importer does not set blend mode for eeveeAras Pranckevicius
The old python importer had a "if do_transparency, set blend_method to BLEND" type of logic. This bit was missing in the new importer; it was only setting the eevee blend method when a transparency texture was present, but not in other cases of transparency (as driven by MTL "illum" mode). Reviewd By: Howard Trickey Differential Revision: https://developer.blender.org/D14783