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-01Refactor: Rename Object->obmat to Object->object_to_worldSergey Sharybin
Motivation is to disambiguate on the naming level what the matrix actually means. It is very easy to understand the meaning backwards, especially since in Python the name goes the opposite way (it is called `world_matrix` in the Python API). It is important to disambiguate the naming without making developers to look into the comment in the header file (which is also not super clear either). Additionally, more clear naming facilitates the unit verification (or, in this case, space validation) when reading an expression. This patch calls the matrix `object_to_world` which makes it clear from the local code what is it exactly going on. This is only done on DNA level, and a lot of local variables still follow the old naming. A DNA rename is setup in a way that there is no change on the file level, so there should be no regressions at all. The possibility is to add `_matrix` or `_mat` suffix to the name to make it explicit that it is a matrix. Although, not sure if it really helps the readability, or is it something redundant. Differential Revision: https://developer.blender.org/D16328
2022-09-16Cleanup: spelling in commentsCampbell Barton
2022-09-08IDManagement: change `IDTypeInfo.owner_get` to instead return address of the ↵Bastien Montagne
owner_id pointer. Also rename the callback. That way, we can keep moving toward a more generic handling of those embedded IDs (think e.g. about copy code).
2022-07-29Cleanup: Move RNA path functions into own C++ fileJulian Eisel
Adds `rna_path.cc` and `RNA_path.h`. `rna_access.c` is a quite big file, which makes it rather hard and inconvenient to navigate. RNA path functions form a nicely coherent unit that can stand well on it's own, so it makes sense to split them off to mitigate the problem. Moreover, I was looking into refactoring the quite convoluted/overloaded `rna_path_parse()`, and found that some C++ features may help greatly with that. So having that code compile in C++ would be helpful to attempt that. Differential Revision: https://developer.blender.org/D15540 Reviewed by: Brecht Van Lommel, Campbell Barton, Bastien Montagne
2022-07-29Fix (unreported) lib-linking of ID properties not taking library parameter.Bastien Montagne
While this was not a critical issue (that lib pointer is only used for some kind of sanity check that no linked data uses local ID pointers), better to keep `IDP_BlendReadLib` in sync with all other lib-linking code.
2022-06-23Animation: Add function to remove all FCurves from an ActionColin Basnett
Add a `BKE_action_fcurves_clear(action)` function, which removes all the Action's FCurves, and expose it as `ActionFCurves.clear()` in RNA. This is more ergonomic than calling `remove` on f-curves until the list is empty. Reviewed By: sybren Differential Revision: https://developer.blender.org/D14660
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-03-14Auto-generate RNA-structs declarations in `RNA_prototypes.h`Julian Eisel
So far it was needed to declare a new RNA struct to `RNA_access.h` manually. Since 9b298cf3dbec we generate a `RNA_prototypes.h` for RNA property declarations. Now this also includes the RNA struct declarations, so they don't have to be added manually anymore. Differential Revision: https://developer.blender.org/D13862 Reviewed by: brecht, campbellbarton
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-02-04Remove internal proxy code, and deprecate related DNA data.Bastien Montagne
Part of T91671. Not much else to say, this is mainly a massive deletion of code. Note that a few cleanups possible after this proxy removal were kept out of this commit to try to reduce a bit its size. Reviewed By: sergey, brecht Maniphest Tasks: T91671 Differential Revision: https://developer.blender.org/D13995
2022-01-11Cleanup: quite missing-variable-declarations warningsCampbell Barton
2021-12-21Fix T92930: Outliner "Show Active" bone fails in certain situationsPhilipp Oeser
Outliner would frame the armature object instead of the bone if the bone was on a hidden armature layer. Similar to issues reported in e.g. T58068 and T80464, this is due to the fact that `BKE_pose_channel_active` always checks for the armature layer (and returns NULL if a bone is not on a visible armature layer). Now propose to make this layer check **optional** (and e.g. from the Outliner be more permissive). This also introduces `BKE_pose_channel_active_if_layer_visible` which just wraps `BKE_pose_channel_active` with the check being ON. Maniphest Tasks: T92930 Differential Revision: https://developer.blender.org/D13154
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-12-02Merge remote-tracking branch 'origin/blender-v3.0-release'Sybren A. Stüvel
2021-12-02Fix `Action.asset_data["is_single_frame"]` set incorrectlySybren A. Stüvel
The asset metadata custom property `["is_single_frame"]` was set incorrectly. Since this is intended for forward compatibility, including being covered by the asset metadata indexing, it's important to have it set correctly from the first release of Blender that includes the asset browser. Differential Revision: https://developer.blender.org/D13452
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-24Animation: allow marking actions as cyclic for Cycle-Aware Keying.Alexander Gavrilov
When a manual frame range is set, allow marking an action as having Cyclic Animation. This does not affect how the action is evaluated, but the Cycle-Aware Keying option will automatically make any newly added F-Curves cyclic. This allows using the option from the start to build the cycle, rather than only for tweaking an existing loop. The curves are made cyclic when they have only one key, either after inserting the first key, or before adding the second one. The latter case avoids the need to manually make the first added curve cyclic after marking a newly added action cyclic. Differential Revision: https://developer.blender.org/D11803
2021-11-24Animation: allow manually setting the intended playback range for actions.Alexander Gavrilov
Some operations, e.g. adding a new action strip to NLA, require knowing the active frame range of an action. However, currently it can only be deduced by scanning the keyframes of the curves within it. This is not ideal if e.g. curves are staggered for overlap. As suggested by Nathan Vegdahl in comments to T54724, this patch adds Action properties that allow manually specifying its active frame range. The settings are exposed via a panel in the Dopesheet and Action Editor. When enabled, the range is highlighted in the background using a striped fill to distinguish it from the solid filled regular playback range. When set, the frame range is used when adding or updating NLA tracks, and by add-ons using `Action.frame_range`, e.g. FBX exporter. Differential Revision: https://developer.blender.org/D11803
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-11-12Merge remote-tracking branch 'origin/blender-v3.0-release'Sybren A. Stüvel
2021-11-12Assets: Store Action sub-type in asset metadataSybren A. Stüvel
Blender 3.0 will only support single-frame Actions in the pose library. The goal of this patch is to lay the groundwork for making it possible for the Asset Browser to reject/hide "animation snippet" Action assets. Determining whether an Action has one or more frames (i.e. whether it has a single pose or animation) requires inspecting the Action itself, and thus loading the data-block itself. This would make it impossible to quickly determine from the asset browser. To solve this, the Action is inspected before saving, and a `"is_single_frame"` boolean (well, 0/1 integer) IDProperty is added. Reviewed by: Severin Differential Revision: https://developer.blender.org/D13202
2021-10-29LibQuery: Add macro to help break looping when requested.Bastien Montagne
The new `BKE_LIB_FOREACHID_PROCESS_FUNCTION_CALL` execute the given statement and then check status of `LibraryForeachIDData` data, and return in case stop of iteration is requested. This is very similar to the other `BKE_LIB_FOREACHID_PROCESS_` existing macros, and allows us to properly break iteration when a sub-function has requested it. Part of T90922: Fix return policy inconsistency in `scene_foreach_id`.
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-18Cleanup: spelling in commentsCampbell Barton
2021-08-26Cleanup: Use `ID_IS_LINKED` instead of direct `id.lib` pointer check.Bastien Montagne
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-07-09Fix T89435: Reordering FCurves can cause crash or corruptionSybren A. Stüvel
Correctly reset `prev` and `next` pointers of action group FCurves when separating them into distinct `ListBase`s per `bActionGroup`. These `NULL` pointers are necessary to temporarily demarcate the start & end of the `bActionGroup::channels` list. Having them still point to other FCurves caused ordering issues when moving curves towards the start/end of a group. This commit corrects the above issue and adds versioning code to rectify any ordering issues that may have been caused. For this purpose the `BKE_action_groups_reconstruct()` function is rewritten to avoid relying on the `bAction::curves` list order or `prev` link integrity. Differential Revision: https://developer.blender.org/D11811
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-28Cleanup: repeated terms in code comments & error messagesCampbell Barton
2021-06-26Cleanup: full sentences in comments, improve comment formattingCampbell Barton
2021-06-24Cleanup: comment blocks, trailing space in commentsCampbell Barton
2021-06-23Cleanup: reformat trailing comments that caused line wrappingCampbell Barton
2021-06-18Armature: add B-Bone Y scale channel and extra flag fields to DNA.Alexander Gavrilov
In addition to the base bone transformation itself, B-Bones have controls that affect transformation of its segments. For rotation the features are quite complete, allowing to both reorient the Bezier handles via properties, and to control them using custom handle bones. However for scaling there are two deficiencies. First, there are only X and Y scale factors (actually X and Z), while lengthwise all segments have the same scaling. The ease option merely affects the shape of the curve, and does not cause actual scaling. Second, scaling can only be controlled via properties, thus requiring up to 6 drivers per joint between B-Bones to transfer scaling factors from the handle bone. This is very inefficient. Finally, the Z channels are confusingly called Y. This commit adds a B-Bone Y Scale channel and extra B-Bone flag fields to DNA with appropriate versioning (including for F-Curves and drivers) in preparation to addressing these limitations. Functionality is not changed, so the new fields are not used until the following commits. Differential Revision: https://developer.blender.org/D9870
2021-05-11Rigging: Add transform for custom bone shapesYuki Shirakawa
Add translation/rotation/scale parameters for custom bones shapes. The new scale is a 3D vector `custom_shape_scale_xyz`, and replaces the `custom_shape_scale` float. Reviewed By: #animation_rigging, sybren, zeddb Differential Revision: https://developer.blender.org/D10974
2021-04-30Cleanup: rename BKE_pose_channel_{verify => ensure}Campbell Barton
The term `verify` doesn't fit with what this function does and is sometimes used to check data is valid or to control validity checking as with `RNA_define_verify_sdna`. use more common term `ensure`.
2021-04-30Cleanup: rename BKE_pose_channels_hash_{make => ensure}Campbell Barton
Use the term `ensure` since it makes it clear the data is not manipulated if it already exists.
2021-03-30Cleanup: animation, remove `BONE_UNKEYED` flagSybren A. Stüvel
Remove the `BONE_UNKEYED` flag. It was only written (set/cleared) but never actually read. Also remove `framechange_poses_clear_unkeyed()` as its only function was to clear the `BONE_UNKEYED` flag. It wasn't used anywhere either. The only code that used the flag was the `extract_pose_from_action()`, which was removed in 2869ce6cfab3aa4ff471bef6e49ac6fe15426247 (2009). No functional changes.
2021-03-02Fix T85981, part II: bone's custom shape disappear on undo in some cases.Bastien Montagne
Nicely hidden bug in pose read library code, it was using the library from the wrong ID as reference to relink the custom shape object pointer (pose is data from Object, not Armature).
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-04Animation: Add PreviewImage to bAction structSybren A. Stüvel
Make it possible to attach a preview image to an Action. In the #asset_browser_pose_libraries project, poses will be stored as individual Action datablocks. Having a thumbnail for each pose is of course essential. Reviewed By: mont29 Differential Revision: https://developer.blender.org/D10306
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.
2020-11-25Cleanup: remove useless cast.Bastien Montagne
2020-11-06Refactor: move Pose .blend I/O to blenkernelJacques Lucke
Ref T76372.
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-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-10Cleanup: use C comments for descriptive textCampbell Barton
Follow our code style guide by using C-comments for text descriptions.
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.