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-05-28Fix T88499: Copy data path operator does not consider library affiliationPhilipp Oeser
When using the operator `ui.copy_data_path_button(full_path=True)` ({key ctrl shift Alt C} on hover) the copied path does not consider the library origin. That means that when there is a name clash the data path is not accurate and refers to the local item instead. This patch adds the library (if the ID is linked) of the returned string from RNA_path_full_ID_py. bpy.data.objects["Cube", "//library.blend"] instead of bpy.data.objects["Cube"] note: parsing this happens in pyrna_prop_collection_subscript_str_lib_pair_ptr Maniphest Tasks: T88499 Differential Revision: https://developer.blender.org/D11412
2021-05-17UI: add non-linear slider supportHenrik Dick
This patch introduces non linear sliders. That means, that the movement of the mouse doesn't map linearly to the value of the slider. The following changes have been made. - Free logarithmic sliders with maximum range of (`0 <= x < inf`) - Logarithmic sliders with correct value indication bar. - Free cubic sliders with maximum range of (`-inf < x < inf`) - Cubic sliders with correct value indication bar. Cubic mapping has been added as well, because it's used for brush sizes in other applications (Krita for e.g.). To make a slider have a different scale type use following line in RNA: `RNA_def_property_ui_scale_type(prop, PROP_SCALE_LOGARITHMIC);` or: `RNA_def_property_ui_scale_type(prop, PROP_SCALE_CUBIC);` Test the precision, step size and soft-min if you change the scale type of a property as it will feel very different and may need tweaking. Ref D9074
2021-04-16RNA: add STRUCT_NO_CONTEXT_WITHOUT_OWNER_ID flagCampbell Barton
This flag is needed so PointerRNA structs that aren't part of the current context can access enum values without inspecting the context. This is needed for keymap access, so the keymap UI and keymap export doesn't depend on the current context.
2021-03-16Fix T86332: Error using lambda in annotations in Python 3.10Campbell Barton
Callbacks used in `bpy.props` didn't hold a references to the functions they used. While this has been the case since early 2.5x it didn't cause any problems as long as the class held a reference. With Python 3.10 or when using `from __future__ import annotations`, the annotations are no longer owned by the class once evaluated. Resolve this by holding a reference in the module, which now supports traverse & clear callbacks so the objects are visible to Python's garbage collector. Also refactor storage of Python data, moving from an array into a struct.
2021-03-05Cleanup: Rename func occurences to _fnSebastián Barschkis
Use _fn as a suffix for callbacks.
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-05Cleanup: correct spelling in commentsCampbell Barton
2021-01-13RNA: allow editing pointer IDProperty values from the UI.Alexander Gavrilov
Currently it is not possible to edit bare IDProperty pointer values which are not explicitly defined through python via UI fields. This is likely mostly because, unlike numeric values, pointers aren't marked PROP_EDITABLE by default. However there are also some bugs in the RNA code that need fixing. The Geometry Nodes modifier uses bare properties to store input settings for the node group it wraps, so supporting Object and Collection sockets requires editable pointers. This patch marks bare IDProperties editable, and ensures that changing ID pointers rebuilds the dependency graph. A type check is needed because an IDPROPERTY PointerPropertyRNA can actually wrap a group value rather than an ID pointer. Making pointers editable is not likely to accidentally affect UI fields that were not intended to be editable, because a simple `layout.prop` cannot determine which datablocks to display in the menu and remains read-only. The PROP_NEVER_UNLINK flag is also removed: it seems it was added because the edit field that couldn't produce a menu to set the pointer used to still display the unlink button, but that seems not to be the case anymore. Actual support for Object & Collection inputs in the modifier is added in D10056, which can be used to test this code. Differential Revision: https://developer.blender.org/D10098
2021-01-13RNA: fix a crash when setting bare IDProperty pointers.Alexander Gavrilov
The rna_idproperty_check call should be done before accessing the prop pointer so that it can detect IDProperty values and replace them with the actual PointerPropertyRNA object. Ref D10098
2020-12-29Cleanup: Use proper `RNA_pointer_is_null` helper.Bastien Montagne
Followup to rB7f3601e70dd and rBad63d2f60e2.
2020-12-28Cleanup/refactor `rna_idp_path` code.Bastien Montagne
Factorize common processes and checks, early `continue` in invalid cases, etc.
2020-12-28Fix T84091: IDProperties/RNA: Crash due to colliding name between custom ↵Bastien Montagne
data and static RNA property. We have to check that the RNAProperty found in `rna_idp_path` from the currently checked IDProperty name is actually a real runtime RNA-defined one, and not a static C-defined RNAProperty...
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-12-11Cleanup: clang-formatHarley Acheson
Forgot to run Make Format on recent spelling changes
2020-12-11UI: Use 'and' Instead of '&' in DescriptionsYevgeny Makarov
Use 'and' instead of ampersand in descriptions and comments. Differential Revision: https://developer.blender.org/D9797 Reviewed by Aaron Carlisle
2020-12-10Fix missing string escaping in RNA_path_appendCampbell Barton
This was escaping the '[' character, which isn't needed for quoted text.
2020-12-10BLI_string: extract quote utility into BLI_str_escape_find_quoteCampbell Barton
Duplicate logic for this exists in BLI_str_quoted_substrN, which doesn't properly support escaping.
2020-12-10Cleanup: remove unnecessary vars in RNA token readingCampbell Barton
2020-12-10Cleanup: declare variables when used (RNA)Campbell Barton
2020-12-10RNA: use BLI_str_unescape utility for parsing escaped stringsCampbell Barton
2020-12-10Cleanup: rename BLI_strescape to BLI_str_escapeCampbell Barton
Prepare for `BLI_str_unescape` which doesn't read well without the separator.
2020-12-09Fix RNA un-escaping multiple slashes and strings ending with a slashCampbell Barton
Fix for T78823 resolved the issue reported but didn't properly support multiple back-slashes.
2020-12-09Fix T78823: Slash in custom property name does not workCampbell Barton
This fixes inserting key-frames for any collection names containing a back-slash too (bones, modifiers, sequence strips etc).
2020-12-02Geometry Nodes: initial scattering and geometry nodesJacques Lucke
This is the initial merge from the geometry-nodes branch. Nodes: * Attribute Math * Boolean * Edge Split * Float Compare * Object Info * Point Distribute * Point Instance * Random Attribute * Random Float * Subdivision Surface * Transform * Triangulate It includes the initial evaluation of geometry node groups in the Geometry Nodes modifier. Notes on the Generic attribute access API The API adds an indirection for attribute access. That has the following benefits: * Most code does not have to care about how an attribute is stored internally. This is mainly necessary, because we have to deal with "legacy" attributes such as vertex weights and attributes that are embedded into other structs such as vertex positions. * When reading from an attribute, we generally don't care what domain the attribute is stored on. So we want to abstract away the interpolation that that adapts attributes from one domain to another domain (this is not actually implemented yet). Other possible improvements for later iterations include: * Actually implement interpolation between domains. * Don't use inheritance for the different attribute types. A single class for read access and one for write access might be enough, because we know all the ways in which attributes are stored internally. We don't want more different internal structures in the future. On the contrary, ideally we can consolidate the different storage formats in the future to reduce the need for this indirection. * Remove the need for heap allocations when creating attribute accessors. It includes commits from: * Dalai Felinto * Hans Goudey * Jacques Lucke * Léo Depoix
2020-11-26Fix T83055: setting rna pointer properties can create bogus custom propertiesPhilipp Oeser
This was reported in the form of the eyedropper of the 'Parent' property creating a custom property 'parent' if self was picked. Problem arises when certain checks for setting rna pointer properties failed (for example: the PROP_ID_SELF_CHECK check) and then a different code path was entered (which was only meant for IDProperties). Problem was introduced in rBa7b3047cefcb. To solve, now first enter the branch for rna-based pointer properties, then perform the sanity-checks (and if these fail: dont enter the other unrelated codepath but instead do nothing) Maniphest Tasks: T83055 Differential Revision: https://developer.blender.org/D9652
2020-11-07Cleanup: Clang-tidy, readability-else-after-returnAnkit Meel
2020-11-07Cleanup: Clang-tidy, readability-non-const-parameter.Ankit Meel
2020-11-07Cleanup: Clang-tidy else-after-returnAnkit Meel
2020-10-20Cleanup: makesrna, Clang-tidy else-after-return-fixes.Ankit Meel
It got left out of {rBc04088fed1b8faea6b2928bb5e09ab3}. No functional change.
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-09-30Cleanup: convert gforge task ID's to phabricator formatValentin
Cleanup old tracker task format to the new. e.g: [#34039] to T34039 Ref D8718
2020-09-20LibOverride: add checks to RNA collections editing utils.Bastien Montagne
Collections of liboverride data only support insertion of new items (and deleting or moving those around). No operation on existing items from linked data is allowed. Reflect that in RNA functions used to edit py-defined RNA collections. Note that this is not ideal currently, it does the job but feedback to user is rather poor. Ideally add-ons should implement higher-level checks for override cases in their operators.
2020-09-20RNA access: Add utils to search a collection item from its name, and get ↵Bastien Montagne
both item pointer and its index in the collection.
2020-07-13RNA property management: tweak to 'is set' information.Bastien Montagne
Only consider a full IDProperty as set if it actually exists in given PointerRNA data.
2020-07-10Refactor override code to properly deal with runtime rna properties too.Bastien Montagne
The triplet static RNA / runtime RNA / custom properties is a real pain to deal with... Using the new `PropertyRNAOrID` struct helps clarifying and properly dealing with all three cases. Note that this makes override of py-defined RNA properties working (support for that will be committed next). Differential Revision: https://developer.blender.org/D8249
2020-07-10RNA: refactor how we get 'ensured' RNA properties.Bastien Montagne
Introduce new PropertyRNAOrID structure, storing most useful data about an 'opaque' PropertyRNA in relation with a given PointerRNA struct. It deals with all the three cases (pure static RNA, runtime RNA where data is actually stored in IDProperties, and pure IDProperties, aka custom data.
2020-06-30Custom Properties: support default values for stringsDemeter Dzadik
Differential Revision: https://developer.blender.org/D8102
2020-06-30Cleanup: LibOverride: Replace raw pointers checks by proper macros.Bastien Montagne
This is cleaner, but also crucial to avoid weird issues when behaviors of those checks are modified...
2020-06-27Docs: correct invalid doxygen params & referencesCampbell Barton
2020-06-20Cleanup: use const args for property name/description accessCampbell Barton
2020-06-05Code Cleanup: fcurve function namingJeroen Bakker
2020-05-22RNA: Make enum properties compatible with raw access.Bastien Montagne
This will allow to use foreach_get/set on enums of RNA collection items, which can save a lot of time in some cases (see incoming FBX updates).
2020-04-17Cleanup: use colon after doxygen parameters, spellingCampbell Barton
2020-04-15Cleanup: remove (unused) RNA update cachePhilipp Oeser
Introduced in 2011 in rB6a392e8cb505, it was disabled again soon after in rBb062056c05a3 and traces to it partly removed in rB21744217cea9. Now remove completely. quote @sergey: We shouldn't be having partially working unused code. If we ever need some sort of update cache it would need to have clear design first, and the code could be resurrected from history if needed. Differential Revision: https://developer.blender.org/D7432
2020-04-03Cleanup: Animation, move AnimData API to `anim_data.c`/`BKE_anim_data.h`Sybren A. Stüvel
The `BKE_animsys.h` and `anim_sys.c` files already had a an "AnimData API" section. The code in that section has now been split off, and placed into `BKE_anim_data.h` and `anim_data.c`. All files that used to include `BKE_animsys.h` have been adjusted to only include the animation headers they need (sometimes none). No functional changes.
2020-03-19Cleanup/refactor: remove BKE_idcode, in favour of BKE_idtype.Bastien Montagne
Mpving utils from idcode to idtype proved to be somewhat painful for some reasons, but now all looks good. Had to add a fake/empty shell for the special snowflake too, `ID_LINK_PLACEHOLDER/INDEX_ID_NULL`...
2020-03-19Cleanup: `make format` after SortedIncludes changeDalai Felinto
2020-03-11Cleanup: rename 'private' to 'embedded' for sub-data IDs.Bastien Montagne
'Private' can be a rather confusing term, especially when considering its meaning in programming languages. So now root node trees and master collections are 'embedded' IDs instead.
2020-02-26Docs: expand comment on tagging id properties to updateCampbell Barton
Addresses issue from T74000.
2020-02-17Fix many typos and other issues in UI messages.Bastien Montagne