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
2021-12-16Cleanup: Move curve.c to C++Hans Goudey
I need this for a refactor I'm looking into for bounding boxes. It may be helpful in the future when using `CurveEval` in more places. Differential Revision: https://developer.blender.org/D13596
2021-12-07Cleanup: move public doc-strings into headers for 'blenkernel'Campbell Barton
- Added space below non doc-string comments to make it clear these aren't comments for the symbols directly below them. - Use doxy sections for some headers. - Minor improvements to doc-strings. Ref T92709
2021-11-29Refactor BKE_bpath module.Bastien Montagne
The main goal of this refactor is to make BPath module use `IDTypeInfo`, and move each ID-specific part of the `foreach_path` looper into their own IDTypeInfo struct, using a new `foreach_path` callback. Additionally, following improvements/cleanups are included: * Attempt to get better, more consistent namings. ** In particular, move from `path_visitor` to more standard `foreach_path`. * Update and extend documentation. ** API doc was moved to header, according to recent discussions on this topic. * Remove `BKE_bpath_relocate_visitor` from API, this is specific callback that belongs in `lib_id.c` user code. NOTE: This commit is expected to be 100% non-behavioral-change. This implies that several potential further changes were only noted as comments (like using a more generic solution for `lib_id_library_local_paths`, addressing inconsistencies like path of packed libraries always being skipped, regardless of the `BKE_BPATH_FOREACH_PATH_SKIP_PACKED` `eBPathForeachFlag` flag value, etc.). NOTE: basic unittests were added to master already in rBdcc500e5a265093bc9cc. Reviewed By: brecht Differential Revision: https://developer.blender.org/D13381
2021-11-24Cleanup: `IDTypeInfo` new `asset_type_info` member.Bastien Montagne
Two issues addressed here: I) `asset_type_info` is sub-data, not a callback. Therefore, move it before the callbacks in the `IDTypeInfo` struct. II) More important, initialize this new attribute in *ALL* `IDTypeInfo` instances. No member of this struct should ever be left implicitely uninitilazed, ever. Aftermath of rBa84f1c02d251.
2021-10-26Cleanup: LibQuery: Rename `BKE_LIB_FOREACHID_PROCESS` to ↵Bastien Montagne
`BKE_LIB_FOREACHID_PROCESS_IDSUPER`. More in-line name with the rest of that macro-based API, especially since this will be extended in the future.
2021-10-20Cleanup: use elem macrosCampbell Barton
2021-10-06Cleanup: rename BKE_font.h -> BKE_vfont.hCampbell Barton
Match API naming prefix (BKE_vfont_*) and DNA_vfont_types.h.
2021-09-23Fix default surface resolution U/V mis-matchCampbell Barton
The resolution for surfaces was 12 for U, 4 for V, where both should have been set to 4. Regression in 9a076dd95a01135ea50f9ccc675668db9f2155f4
2021-09-22Initial implementation of local ID re-use when appending.Bastien Montagne
This commit adds to ID struct a new optional 'weak reference' to a linked ID (in the form of a blend file library path and full ID name). This can then be used on next append to try to find a matching local ID instead of re-making the linked data local again. Ref. T90545 NOTE: ID re-use will be disabled for regular append for the time being (3.0 release), and only used for assets. Therefore, this commit should not change anything user-wise. Differential Revision: https://developer.blender.org/D12545
2021-09-13Fix T90736: Problem applying scale to curvesGermano Cavalcante
Curve Points of handle of type `Auto` on curves not uniformly scaled cause the shape of the curve to be modified after applying the scale. So change these handles to `Aligned` in these cases. Reviewed By: campbellbarton Maniphest Tasks: T90736 Differential Revision: https://developer.blender.org/D12281
2021-08-19Cleanup: Blendwrite: Move code deciding if an ID should be written out of ID ↵Bastien Montagne
callbacks. This was not really useful, and added estra useless steps in case and ID should not actually be written. Further more, it prevented clearing the usercount on write, which can be cause a false positive 'chanhged' detection in undo/redo case.
2021-08-19Fix T71137: curve minimum twist producing wrong geometryCampbell Barton
Originally D11886 by @ghaspias with minor edits applied.
2021-08-12Cleanup: use C++ style comments for disabled codeCampbell Barton
2021-08-06Cleanup: use MEM_SAFE_FREE macroCampbell Barton
2021-07-19Cleanup: Remove unused function, unused declarationHans Goudey
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-29Cleanup: resolve discarded-qualifier warningCampbell Barton
2021-06-28Curve: Add functions to retrieve const access to spline listHans Goudey
While the const correctness of `ListBase` is quite limited, it's helpful to have a way to retrieve the `Nurb` list from curve object data without casting away const from the curve.
2021-06-28Cleanup: Use const argumentsHans Goudey
2021-06-28Cleanup: repeated terms in code comments & error messagesCampbell Barton
2021-06-24Cleanup: comment blocks, trailing space in commentsCampbell Barton
2021-06-09Cleanup: redundant/unused assignmentsCampbell Barton
2021-04-12Fix unreported: Flat Surface objectsGermano Cavalcante
Before rBf674976edd88, the flag indicating whether a curve was 2D or 3D was ignored by Surfaces objects. So it can be said that Surfaces objects were always 3D. We could remove updates to 2D on Surface objects, so the behavior is identical to what it was before. But this would also cause the return of `data.dimensions` to be misleading, complicate the code a bit and add a micro overhead. So the solution here is just to init all Surface objects as 3D. Surface objects can now be constrained to 2D with the command: ``` data.dimensions = '2D' ```
2021-04-01Curve: Remove 'CU_2D' flag used for nurbsGermano Cavalcante
This fixes T86440 As the CU_2D flag is set for nurbs, a Curve can have 2D nurbs mixed with 3D. But the UI does not allow this mixing. It updates all nurbs to 2D or 3D when set. So remove this specific flag for nurbs. This may break old files, since 2D curves with mixed 3D are now set as 3D. Differential Revision: https://developer.blender.org/D10738
2021-04-01Cleanup: Use const arguments in curve codeHans Goudey
2021-03-31Cleanup: Remove remaining unused code for DispList "bevel_split"Hans Goudey
This was added in rB93aeb6b318a7, last changed in rB8f0a44a5d55d, and removed in rB51b796ff1528. I assume it was a way for curves to have split edges at corners. As far as I can tell it only ever worked in Blender Internal, and that has been gone for years. Another possible route here would be restoring this functionality, but it's generally preferrable to reduce complexity in this area of curve code than adding it back, especially in the context of other improvements planned related to curves in geometry nodes. Differential Revision: https://developer.blender.org/D9966
2021-02-25Refactor: IDTypeInfo: Add `owner_get` to get owner of embedded IDs.Bastien Montagne
This concerns currently only collections (`master_collection` of scenes) and root node trees. It removes the matching type-specific helpers (`BKE_collection_master_scene_search` and `BKE_node_tree_find_owner_ID`). No functional change expected here. NOTE: Current implementation of `owner_get` is far from optimal, we could probably do it better, see {T69169}. NOTE: While it could also have it, shapekeys IDTypeInfo was left out of this change for now. Mainly because it sould not be used currently, and we ultimately want to demote shape keys from ID status anyway.
2021-02-14Cleanup: correct/update commentsCampbell Barton
2021-01-22LibOverride: Add an 'post apply' callback to IDTypeInfo.Bastien Montagne
Currently this is needed to properly tag PointCache's for info update (fixes an issue reported in T82503). Suspect we may need this in more cases in the future though, RNA assign/update processes are not always 100% enough to deal with complicated corner cases.
2021-01-20Cleanup: remove extra in trailing asteriskCampbell Barton
Comment blocks not conforming to convention.
2020-12-08Fix T83117: Curve bevel not handle aligned at end-pointsCampbell Barton
Caused by fix for T80742, 4987b7d347a885916916a888c18401ea2fe552f4. Keep the fix that calculates the start/end direction from adjacent points but only use it as a fallback.
2020-11-28Fix Auto Clamped limits when smoothing the transition of cyclic curves.Alexander Gavrilov
The value of l[count-1] should be ready by the time hmin/hmax is computed. Otherwise the left limit for the transition key would be scaled wrong.
2020-11-28Fix some naming and comments in F-Curve smoothing code.Alexander Gavrilov
2020-11-06Cleanup: use ELEM macroCampbell Barton
2020-11-05Merge branch 'blender-v2.91-release'Campbell Barton
2020-11-05Fix T80742: curve bevel fails with zero length handles at end-pointCampbell Barton
Initialize the direction on the first/last points of the curve. The fix from 23a4149778c87 exposed this error.
2020-11-04Cleanup: spelling in curve.cCampbell Barton
2020-11-04Merge branch 'blender-v2.91-release'Campbell Barton
2020-11-04Fix T49850: Detailed curves are heavily reducedCampbell Barton
Divide the threshold by the resolution to prevent duplicates being detected in high resolution curves.
2020-11-03Add a callback to `IDTypeInfo` to allow preservation of some data accross ↵Bastien Montagne
memfile undos This is essentially adding that new callback, and using it only for already existing Scene's 3DCursor. Note that the place where this is called has been moved again, after all have been lib-linked, such that those callbacks may also work on ID pointers. Maniphest Tasks: T71759 Differential Revision: https://developer.blender.org/D9237
2020-10-25Cleanup: Use LISTBASE_FOREACH in curve codeHans Goudey
This is a followup to rBa308607a533, using the macro in a few places that were missed.
2020-10-24Cleanup: Return early in some curve functionsHans Goudey
This commit uses continue in loops and returning early to reduce indentation in long functions, only where this results in a significant improvement. Also includes a few LISTBASE_FOREACH macros.
2020-10-22Cleanup: Use LISTBASE_FOREACH macro in curve codeHans Goudey
These changes should result in more readable and undestandable code, especially where while loops were use instead of for loops. They are not comprehensive, and I skipped wherever the change was not obvious.
2020-10-19Spelling: It's Versus ItsHarley Acheson
Corrects incorrect usage of contraction for 'it is', when possessive 'its' was required. Differential Revision: https://developer.blender.org/D9250 Reviewed by Campbell Barton
2020-10-15Fix T81743: Changed behaviour in RGB Curves node interpolationSybren A. Stüvel
Restore the old `correct_bezpart()` (pre-rBda95d1d851b4) function as `BKE_curve_correct_bezpart()`, and use that where the old behaviour was desired (that is, curve maps like used by the RGB Curves shader node). The new (post-rBda95d1d851b4) function is also renamed to `BKE_fcurve_correct_bezpart()` to avoid confusion.
2020-10-10Cleanup: use C comments for descriptive textCampbell Barton
Follow our code style guide by using C-comments for text descriptions.
2020-10-09Revert "CleanUp: Introduce `eMeshBatchDirtyMode` enum"Jeroen Bakker
This reverts commit 0796807720882731cdb70be144aa182e9b0b9ee5.
2020-10-08Cleanup/refactor: `BKE_libblock_alloc` -> `BKE_id_new` in ID creation code.Bastien Montagne
Better use higher-level code from common ID management when possible. Helps to de-duplicate logic, and reduces outside usages of more 'dangerous' functions. Note that we could get rid of many of those `BKE_<id_type>_add` functions now, but on the other hand several of those take extra parameters and perform additional actions, so think we can keep them all for now as 'non-standard ID specific creation functions'.
2020-10-07Refactor: remove `BKE_<id_type>_copy` functions.Bastien Montagne
Those were only shallow wrappers around `BKE_id_copy`, barely used (even fully unused in some cases), and we want to get rid of those ID-specific helpers for the common ID management tasks. Also prevents weird custom behaviors (like `BKE_object_copy`, who was the only basic ID copy function to reset user count of the new copy to zero). Part of 71219.
2020-10-07Refactor `BKE_id_copy` to return the new ID pointer.Bastien Montagne
No reasons to keep the new ID pointer as parameter here. Part of T71219.