Age | Commit message (Collapse) | Author |
|
Use rna naming conventions for unit-settings callbacks.
|
|
The python getters for the array already allowed that, but not the
actual C RNA access functions. This is inconsistent, so implement
the fallback in all cases. Now if by default the property should
contain the same value in all positions, it is not necessary to
actually use an array.
Reviewers: campbellbarton
Differential Revision: https://developer.blender.org/D3940
|
|
Differential Revision: https://developer.blender.org/D3719
|
|
|
|
MASS unit was already implemented for the C api. Only making sure it is
accessible in the python api. Also added 'CAMERA' to the documentation as a valid option.
|
|
|
|
Missed when changing callbacks from int to bool type.
|
|
|
|
We were using int's for bool arguments in BKE,
just to avoid having wrapper functions.
|
|
Access to main database is actually rarely needed, but some custom
'apply' functions do need it (like Collections' overriding of objects or
children collections).
|
|
I.e. we can now use REPLACE operation directly on items of an RNA
collection, when those items are ID pointers.
Again, mandatory to support new Collection's objects/children override.
|
|
This is unused currently, but is mandatory for incomming support to
Collections objects and children items override support.
|
|
|
|
|
|
Material slots are a real pain to get working, due to all the black
magic they do to hide object vs. obdata storage of the material...
Currently hitting an order problem - we need to always set 'link' (to
object or obdata) property of the slot first, before we set its
material... *super-sigh*
|
|
We are already running out of available flags in main, generic int, and
everytime I work on static override I find new special cases that will
need new specific propflag, so...
|
|
Needed for use in rna non runtime code.
|
|
Needed for use in rna non runtime code.
|
|
This piece of code remains annoyingly verbose, but at least now we do
not have anymore twice the same logic duplicated between single array
element handling, and non-array properties.
|
|
|
|
Does not yet support applying those operations, only detecting
insertions and generating matching rules was already rather complicated.
Also got rid of ;ost rna_path string allocation in collection diffing
code, could help a bit with speed too.
|
|
Moved another dynamic allocating print into (usually) static one, gives
us another average 8% speedup on Autumn rig.
|
|
Others remain in code for now, just not exposed to user.
|
|
|
|
E.g. typing `bpy.data.bl_rna.properties[8].<tab>` in console would hard-crash
trying to dereference NULL pointer. Was a missing check in rna_Property_tags_itemf().
|
|
We have to check all items of a collection when we want to create
overrides as needed...
|
|
When a name property is defined for collection's struct, but no name is
actually set, we want to also fallback to index case. We cannot handle
empty names to address items of a collection!
|
|
|
|
|
|
E.g. running `bpy.context.active_object.cycles.bl_rna.property` in the
console would crash.
Thanks @lijenstina for reporting!
|
|
Code also handling auto-generation of static overrides.
Aside from some naming consistency cleanup, this commit:
* Is the first step addressing the 'operator' issue with static
overrides, by implementing a first version of the 'restore from
reference' behavior.
* Fixes several issues that were discovered on the way in enhanced
RNA comparision code, like the 'zero-length dynamic array' case, or some
infinite looping caused by some non-ID pointers (that for some
mysterious reasons did not show up previously...).
* Factorizes a bit said RNA comparison code (auto-static override
generation and comparison/check were essentially doing the same thing).
|
|
|
|
|
|
This is essentially a huge refactor/extension of our existing RNA
compare & copy code, since static override needs more advanced handling here.
Note that not all new features are implemented yet, advanced things like
collections insertion/deletion are still TODO (medium priority).
This completes the ground work for overrides, remaining commits will be
about UI and some basic/testing activation of overrides for a limited
set of data-blocks & properties.
For details see https://developer.blender.org/D2417
|
|
Adds support for defining a number of tags as part of the rna-struct
definition, which its properties can set similar to property-flags.
BPY supports setting these tags when defining custom properties too.
* To define tags for a struct (which its properties can use then), define the tags in an `EnumPropertyItem` array, and assign them to the struct using `RNA_def_struct_property_tags(...)`.
* To set tags for an RNA-property in C, use the new `RNA_def_property_tags(...)`.
* To set tags for an RNA-property in Python, use the newly added tags parameter. E.g. `bpy.props.FloatProperty(name="Some Float", tags={'SOME_TAG', 'ANOTHER_TAG'})`.
|
|
Adds support for defining a number of tags as part of the rna-struct
definition, which its properties can set similar to property-flags.
BPY supports setting these tags when defining custom properties too.
* To define tags for a struct (which its properties can use then), define the tags in an `EnumPropertyItem` array, and assign them to the struct using `RNA_def_struct_property_tags(...)`.
* To set tags for an RNA-property in C, use the new `RNA_def_property_tags(...)`.
* To set tags for an RNA-property in Python, use the newly added tags parameter. E.g. `bpy.props.FloatProperty(name="Some Float", tags={'SOME_TAG', 'ANOTHER_TAG'})`.
Actual usage of this will be added in a follow-up commit.
|
|
Practically all access to enum data is read-only.
|
|
Required to generate valid doc for such arrays!
|
|
Only add subclasses of: Menu, Panel, Header, UIList, Operator
This helps avoid unnecessary naming collisions,
See T52599 for details
|
|
Adding structs was checking for duplicates
causing approx 75k string comparisons on startup.
While overall speedup is minimal,
Python access to `bpy.types` will now use a hash lookup
instead of a full linked list search.
See D2774
|
|
internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
|
|
Needed since dynamic arrays would have zero length.
|
|
Some dynamic enums, which do not need a valid context pointer, have their 'itemf'
callback always called. This is annoying for introspection tools (like the ones generating
translations, or API documentation), because it means they never have access to all possible
options (enum items).
So now, there is also an `enum_items_static` accessor to get only statically-defined
enum items.
Note: only i18n tools take advantage of this currently, others are still to be updated.
Reviewers: campbellbarton, sergey
Differential Revision: https://developer.blender.org/D1782
|
|
boolean return.
Since rBbbc7dc169dc365889bad3f3aed7b868efb432710 bool-valued RNA functions are expected to
return only 0 or 1. For flag tests as in these functions the returned int value needs to be
explicitly converted to bool.
|
|
Definitions could shadow local vars.
|
|
|
|
Was returning NULL, auto-completing:
bpy.types.Material.bl_rna.properties["type"].
Would crash, accessing 'default_flag', thanks to @lukastoenne for investigating.
|
|
|
|
Makes usage of those funcs much more clear, we even had mixed '!strcmp(foo, bar)'
and 'strcmp(foo, bar) == 0' in several places...
|
|
|