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-11-08Cleanup: formatChris Blackbourn
2022-11-05Cleanup: Move legacy mesh conversions to proper fileHans Goudey
2022-10-07Cleanup: redundant parenthesisCampbell Barton
2022-09-05Mesh: Remove redundant custom data pointersHans Goudey
For copy-on-write, we want to share attribute arrays between meshes where possible. Mutable pointers like `Mesh.mvert` make that difficult by making ownership vague. They also make code more complex by adding redundancy. The simplest solution is just removing them and retrieving layers from `CustomData` as needed. Similar changes have already been applied to curves and point clouds (e9f82d3dc7ee, 410a6efb747f). Removing use of the pointers generally makes code more obvious and more reusable. Mesh data is now accessed with a C++ API (`Mesh::edges()` or `Mesh::edges_for_write()`), and a C API (`BKE_mesh_edges(mesh)`). The CoW changes this commit makes possible are described in T95845 and T95842, and started in D14139 and D14140. The change also simplifies the ongoing mesh struct-of-array refactors from T95965. **RNA/Python Access Performance** Theoretically, accessing mesh elements with the RNA API may become slower, since the layer needs to be found on every random access. However, overhead is already high enough that this doesn't make a noticible differenc, and performance is actually improved in some cases. Random access can be up to 10% faster, but other situations might be a bit slower. Generally using `foreach_get/set` are the best way to improve performance. See the differential revision for more discussion about Python performance. Cycles has been updated to use raw pointers and the internal Blender mesh types, mostly because there is no sense in having this overhead when it's already compiled with Blender. In my tests this roughly halves the Cycles mesh creation time (0.19s to 0.10s for a 1 million face grid). Differential Revision: https://developer.blender.org/D15488
2022-08-30Attributes: Improve custom data initialization optionsHans Goudey
When allocating new `CustomData` layers, often we do redundant initialization of arrays. For example, it's common that values are allocated, set to their default value, and then set to some other value. This is wasteful, and it negates the benefits of optimizations to the allocator like D15082. There are two reasons for this. The first is array-of-structs storage that makes it annoying to initialize values manually, and the second is confusing options in the Custom Data API. This patch addresses the latter. The `CustomData` "alloc type" options are rearranged. Now, besides the options that use existing layers, there are two remaining: * `CD_SET_DEFAULT` sets the default value. * Usually zeroes, but for colors this is white (how it was before). * Should be used when you add the layer but don't set all values. * `CD_CONSTRUCT` refers to the "default construct" C++ term. * Only necessary or defined for non-trivial types like vertex groups. * Doesn't do anything for trivial types like `int` or `float3`. * Should be used every other time, when all values will be set. The attribute API's `AttributeInit` types are updated as well. To update code, replace `CD_CALLOC` with `CD_SET_DEFAULT` and `CD_DEFAULT` with `CD_CONSTRUCT`. This doesn't cause any functional changes yet. Follow-up commits will change to avoid initializing new layers where the correctness is clear. Differential Revision: https://developer.blender.org/D15617
2022-07-11Cleanup: spelling in commentsCampbell Barton
2022-06-30Cleanup: spelling in commentsCampbell Barton
2022-03-30Cleanup: spelling in commentsCampbell Barton
2022-03-25Cleanup: rename ParticleSettings.child_nbr => child_percentCampbell Barton
child_nbr was used as a percentage as well as the final number of particles. Rename to avoid confusion.
2022-03-08Cleanup: spelling in comments, use C++ comments for disabled codeCampbell Barton
2022-02-18Cleanup: Rename original curve object type enumHans Goudey
This commit renames enums related the "Curve" object type and ID type to add `_LEGACY` to the end. The idea is to make our aspirations clearer in the code and to avoid ambiguities between `CURVE` and `CURVES`. Ref T95355 To summarize for the record, the plans are: - In the short/medium term, replace the `Curve` object data type with `Curves` - In the longer term (no immediate plans), use a proper data block for 3D text and surfaces. Differential Revision: https://developer.blender.org/D14114
2022-02-11File headers: SPDX License migrationCampbell Barton
Use a shorter/simpler license convention, stops the header taking so much space. Follow the SPDX license specification: https://spdx.org/licenses - C/C++/objc/objc++ - Python - Shell Scripts - CMake, GNUmakefile While most of the source tree has been included - `./extern/` was left out. - `./intern/cycles` & `./intern/atomic` are also excluded because they use different header conventions. doc/license/SPDX-license-identifiers.txt has been added to list SPDX all used identifiers. See P2788 for the script that automated these edits. Reviewed By: brecht, mont29, sergey Ref D14069
2022-01-17Baking: new method to generate margin, based on adjacent facesMartijn Versteegh
This significantly reduces discontinuities on UV seams, by giving a better match of the texture filtered colors on both sides of the seam. It works by using pixels from adjacent faces across the UV seam. This new option is called "Adjacent Faces" and is the default. The old option is called "Extend", and extends border pixels outwards. Differential Revision: https://developer.blender.org/D13303
2021-12-08Cleanup: move public doc-strings into headers for 'blenloader'Campbell Barton
Ref T92709
2021-11-02Images: refactor how failed image load attempts are rememberedJacques Lucke
Previously, `ImageTile->ok` and `ImageUser->ok` were used to indicate whether an image failed to load. There were three possible values which (probably) had the following meanings: * `0`: There was an error while loading the image. Don't try to load again. * `1`: Default value. Try to load the image. * `2`: The image was loaded successfully. This image-wide flag did not make sense unfortunately, because loading may work for some frames of an image sequence but not for others. Remember than an image data block can also contain a movie. The purpose of the `->ok` flag was to serve as an optimization to avoid trying to load a file over and over again when there is an error (e.g. the file does not exist or is invalid). To get the optimization back, the patch is changing `MovieCache` so that it can also cache failed load attempts. As a consequence, `ibuf` is allowed to be `NULL` in a few more places. I added the appropriate null checks. This also solves issues when image sequences are used with the Image Texture node in Geometry nodes (also see D12827). Differential Revision: https://developer.blender.org/D12957
2021-08-25Cleanup and remove SEQ_ALL_BEGIN macroSebastian Parborg
We now use a for_each function with callback to iterate through all sequences in the scene. This has the benefit that we now only loop over the sequences in the scene once. Before we would loop over them twice and allocate memory to store temporary data. The allocation of temporary data lead to unintentional memory leaks if the code used returns to exit out of the iteration loop. The new for_each callback method doesn't allocate any temporary data and only iterates though all sequences once. Reviewed By: Richard Antalik, Bastien Montagne Differential Revision: http://developer.blender.org/D12278
2021-08-21Refactor low-level blendfile reading into separate filesLukas Stockner
Instead of handling mmap, compression etc. all directly in readfile.c, refactor the code to use a generic FileReader. This makes it easier to add new compression methods or similar, and allows to reuse the logic in other places (e.g. thumbnail reading). Reviewed By: campbellbarton, brecht, mont29 Differential Revision: https://developer.blender.org/D5799
2021-08-05Cleanup: remove redundant parenthesisCampbell Barton
2021-07-03Cleanup: consistent use of tags: NOTE/TODO/FIXME/XXXCampbell Barton
Also use doxy style function reference `#` prefix chars when referencing identifiers.
2021-06-26Cleanup: full sentences in comments, improve comment formattingCampbell Barton
2021-05-11Cleanup: remove unused baking struct members from soft-bodyCampbell Barton
2021-03-31Cleanup: Remove SEQ_CURRENT_BEGIN macroRichard Antalik
Use LISTBASE_FOREACH instead. SEQ_CURRENT_BEGIN did null checks, so now these must be explicit. Reviewed By: campbellbarton Differential Revision: https://developer.blender.org/D10823
2021-02-14Cleanup: spellingCampbell Barton
2021-02-14Cleanup: correct/update commentsCampbell Barton
2020-12-19Cleanup: Split SEQ_sequencer.h fileRichard Antalik
2020-12-15Cleanup: reduce indirect DNA header inclusionCampbell Barton
Remove DNA headers, using forward declarations where possible. Also removed duplicate header, header including it's self and unnecessary inclusion of libc system headers from BKE header.
2020-11-06Refactor: move Object .blend I/O to IDTypeInfo callbacksJacques Lucke
2020-11-06Cleanup: use ELEM macroCampbell Barton
2020-11-01Rename BKE_sequencer.hRichard Antalik
Reviewed By: sergey Differential Revision: https://developer.blender.org/D9349
2020-10-22Multires: Remove legacy compatibility codeSergey Sharybin
It was rather a huge chunk of code, which started to become more harder to maintain with the transition to OpenSubdiv based implementation. Because of this transition, the compatibility was also rather on a poor side. Remove compatibility support for pre-2.50.9 multires. Ref T77107 Reviewed By: brecht, mont29 Differential Revision: https://developer.blender.org/D9238
2020-10-19Spelling: Then Versus ThanHarley Acheson
Corrects incorrect usages of the words 'then' and 'than'. Differential Revision: https://developer.blender.org/D9246 Reviewed by Campbell Barton
2020-10-10Cleanup: use macro for comparing file versionsCampbell Barton
Already done in most of the versioning code.
2020-10-10Cleanup: use C comments for descriptive textCampbell Barton
Follow our code style guide by using C-comments for text descriptions.
2020-08-26Cleanup: add SEQ_ALL_BEGIN, SEQ_CURRENT_BEGIN to .clang-formatCampbell Barton
These were missed in 70500121b457d which caused reformatting.
2020-08-21Cleanup: rename iterators over sequences to be more clear about what they do.Bastien Montagne
No functional changes expected.
2020-08-08Cleanup: use array syntax for sizeof with fixed valuesCampbell Barton
Also order sizeof(..) first to promote other values to size_t.
2020-08-07Cleanup: Versioning: silence Clang-Tidy readability-function-sizeSybren A. Stüvel
This adds `NOLINT` markers to explicitly silence warnings from Clang-Tidy's `readability-function-size` rule for versioning functions. Technically these could be refactored and split up into smaller bits, but generally they are hardly ever looked at once they're a few releases old. No functional changes.
2020-08-01Cleanup: use term init instead of initialize/initialiseCampbell Barton
The abbreviation 'init' is brief, unambiguous and already used in thousands of places, also initialize is often accidentally written with British spelling.
2020-07-21Cleanup: CodeQuality: Replace OB_DRAWXRAY by OB_DRAW_IN_FRONTClément Foucault
This is to match the option name and to avoid confusion with workbench xray mode.
2020-07-19Cleanup: spellingCampbell Barton
2020-06-23Cleanup: rename 'name' to 'filepath' for DNA typesCampbell Barton
Using 'name' for the full path of a file reads badly, especially when id.name is used in related code.
2020-05-08Cleanup: clang-formatCampbell Barton
2020-05-08Fix T76498: Refactoring - Rename BKE modifiers funtionsAntonio Vazquez
2020-04-03Cleanup: Rename bScreen variables from sc/scr to screenJulian Eisel
Part of T74432. Mostly a careful batch rename but had to do few smaller fixes. Also ran clang-format on affected files.
2020-04-03Cleanup: Rename ScrArea variables from sa to areaJulian Eisel
Follow up of b2ee1770d4c3 and 10c2254d412d, part of T74432. Now the area and region naming conventions should be less confusing. Mostly a careful batch rename but had to do few smaller fixes. Also ran clang-format on affected files.
2020-03-19Cleanup: `make format` after SortedIncludes changeDalai Felinto
2020-03-06Cleanup: use 'BKE_' prefix for BKE_deform API callsCampbell Barton
- Use 'BKE_object_defgroup' prefix for object functions. - Rename 'defvert_verify_index' to 'defvert_ensure_index' since this adds the group if it isn't found.
2020-02-19readfile: Move ID refcounting to libquery.Bastien Montagne
Having that extra ID users handling at readfile level, besides generic one ensured by libquery, has been something bothering me for a long time (had to fix my share of bugs due to mismatches between those two areas). Further more, work on undo speedup will require even more complex ID refcount management if we want to keep it in readfile.c area. So idea is instead to generalize what we did for linked data already when undoing: recompute properly usercount numbers after liblink step, for all IDs. Note that extra time required here is neglectable in a whole .blend file reading (few extra milliseconds when loading a full production scene e.g.). Notes: * Some deprecated data (IPOs) are not refcounted at all anymore, this should not be an issue in pratice since the are supposed to get deleted after doversion anyway. * Refcounting happens after `do_versions_after_linking`, i.e those functions won't get valid ID usercounts currently. Again, this is not a problem in current code, if needed we could recompute refcount before, and then ensure `do_versions_after_linoiing()` actually handles properly usercount, which it does not currently. Differential Revision: https://developer.blender.org/D6881
2019-12-16Mantaflow [Part 6]: Updates in /blender/sourceSebastián Barschkis
A collection of smaller changes that are required in the /blender/source files. A lot of them are also due to variable renaming. Reviewed By: sergey Maniphest Tasks: T59995 Differential Revision: https://developer.blender.org/D3855
2019-11-24Preferences: disable changing 'U' on blend file versioningCampbell Barton
Would have prevented T71612