Age | Commit message (Collapse) | Author |
|
Some RNA structs, like operators or keymaps, are not allowed to have ID
pointer properties. now this check will ignore those, and report an
error message in the console.
Related to T82597.
Notes: While a bit more involved than rBf39fbb3e6046, this commit
remains fairly localized and non-intrusive.
It relies on some rather obscure and weird behaviors of our RNA code
though, a cleaner solution could be e.g. to add a tye to
`StructOrFunctionRNA`, so that we could properly 'rebuild' (re-cast) the
pointer to either `StructRNA` or `FunctionRNA` when needed in internal
code...
|
|
Changes in source/blender/makesrna only.
No functional change.
|
|
Previously, it was kind of a mess. In different places it was using `char`, `short` and `int`.
The changed properties are flags that are operated upon using bit operations. Therefore, the integer type should be unsigned. Since we only use 2 bits of these flags, `uint8_t` is large enough.
Especially note the change I had to make in `RNA_define.h` to make this work.
Reviewers: campbellbarton
Differential Revision: https://developer.blender.org/D8844
|
|
This replaces header include guards with `#pragma once`.
A couple of include guards are not removed yet (e.g. `__RNA_TYPES_H__`),
because they are used in other places.
This patch has been generated by P1561 followed by `make format`.
Differential Revision: https://developer.blender.org/D8466
|
|
Similar to the one allowing to deactivate DNA check, etc.
Will helps reduce verbosity when making many new properties overridable.
Note that pointer properties always remain non-overridable by default,
since basically only ID pointers should be.
Reviewed By: brecht
Maniphest Tasks: T77083
Differential Revision: https://developer.blender.org/D7906
|
|
Makes it more clear that code using this is related to the RNA
integration of a type.
Part of T74432.
Also ran clang-format on affected files.
|
|
|
|
RE_engine_register_pass is sometimes in the headers with type
as an integer parameter, sometimes as eNodeSocketDatatype.
This caused warnings, the root cause was makesrna was not able
to generate the proper type for enums and defaulted to int.
makesrna has been extended with the RNA_def_property_enum_native_type
that allows telling makesrna the native type of an enum, if set it
will be used otherwise it will still fall back to int.
Differential Revision: https://developer.blender.org/D7117
Reviewed By: brecht
|
|
This does not affect the RNA access API, since how the boolean is read from
DNA abstracted away in the API.
Differential Revision: https://developer.blender.org/D7002
|
|
The floating "Move" redo panel showed transform values with less
precision than in other places (e.g. sidebar and properties editor).
With Millimeters as unit it would even round to full integers, which
may be an issue since you typically work at higher precisions with this
unit.
Note that this only applies to the visual precision, internally we use
full floating point `float`s still.
Fixes T70367.
|
|
Use so we can have a default update function,
that doesn't need to be set for every property.
|
|
|
|
Apply clang format as proposed in T53211.
For details on usage and instructions for migrating branches
without conflicts, see:
https://wiki.blender.org/wiki/Tools/ClangFormat
|
|
|
|
While \file doesn't need an argument, it can't have another doxy
command after it.
|
|
Move \ingroup onto same line to be more compact and
make it clear the file is in the group.
|
|
BF-admins agree to remove header information that isn't useful,
to reduce noise.
- BEGIN/END license blocks
Developers should add non license comments as separate comment blocks.
No need for separator text.
- Contributors
This is often invalid, outdated or misleading
especially when splitting files.
It's more useful to git-blame to find out who has developed the code.
See P901 for script to perform these edits.
|
|
The same icons are reused for "hide" and "show" properties, which need
to be in reverse order compared to each other.
|
|
|
|
|
|
We were using int's for bool arguments in BKE,
just to avoid having wrapper functions.
|
|
|
|
|
|
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...
|
|
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.
|
|
|
|
|
|
|
|
Recent changes meant structs that were registered without a name
wouldn't get added to the map.
Now assigning identifiers manages the struct-map.
|
|
|
|
The absence of datablock properties "will certainly be resolved soon as the need for them is becoming obvious" said the [[http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.67/Python_Nodes|Python Nodes release notes]]. So this patch allows Python scripts to create ID Properties which reference datablocks.
This functionality is implemented for `PointerProperty` and now such properties can be created with Python.
In addition to the standard update callback, `PointerProperty` can have a `poll` callback (standard RNA) which is useful for search menus. For details see the test included in this patch.
Original author: @artfunkel
Alexander (Blend4Web Team)
Reviewers: brecht, artfunkel, mont29, campbellbarton
Reviewed By: mont29, campbellbarton
Subscribers: jta, sergey, campbellbarton, wisaac, poseidon4o, mont29, homyachetser, Evgeny_Rodygin, AlexKowel, yurikovelenov, fjuhec, sharlybg, cardboard, duarteframos, blueprintrandom, a.romanov, BYOB, disnel, aditiapratama, bliblubli, dfelinto, lukastoenne
Maniphest Tasks: T37754
Differential Revision: https://developer.blender.org/D113
|
|
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
|
|
Imperial).
Was the case of several Mesh operators actually (and probably others, but cannot check
everything). Added `RNA_def_property_float_distance` helper, avoids having to
set PROP_DISTANCE subtype explicitly each time...
|
|
|
|
|
|
without this - the info space would report an invalid rna-path when showing the string to change a value.
|
|
also set_source_files_properties() wasn't working for rna_*_gen.c files,
set dna.c and generated data files with generated property too.
|
|
PyNodes opens up the node system in Blender to scripters and adds a number of UI-level improvements.
=== Dynamic node type registration ===
Node types can now be added at runtime, using the RNA registration mechanism from python. This enables addons such as render engines to create a complete user interface with nodes.
Examples of how such nodes can be defined can be found in my personal wiki docs atm [1] and as a script template in release/scripts/templates_py/custom_nodes.py [2].
=== Node group improvements ===
Each node editor now has a tree history of edited node groups, which allows opening and editing nested node groups. The node editor also supports pinning now, so that different spaces can be used to edit different node groups simultaneously. For more ramblings and rationale see (really old) blog post on code.blender.org [3].
The interface of node groups has been overhauled. Sockets of a node group are no longer displayed in columns on either side, but instead special input/output nodes are used to mirror group sockets inside a node tree. This solves the problem of long node lines in groups and allows more adaptable node layout. Internal sockets can be exposed from a group by either connecting to the extension sockets in input/output nodes (shown as empty circle) or by adding sockets from the node property bar in the "Interface" panel. Further details such as the socket name can also be changed there.
[1] http://wiki.blender.org/index.php/User:Phonybone/Python_Nodes
[2] http://projects.blender.org/scm/viewvc.php/trunk/blender/release/scripts/templates_py/custom_nodes.py?view=markup&root=bf-blender
[3] http://code.blender.org/index.php/2012/01/improving-node-group-interface-editing/
|
|
code (just realized that flag value was wrong, probably own typo in a previous commit :/ ).
That "trick" was nice when introduced, but it became kind of a pita since we added translation contexts...
|
|
defining many properties - currently use to disable animating brushes and toolsettings.
|
|
suggestions!
This commit adds:
* A new bpy.app.translations module giving some info about locales/translation stuff (current active locale, all locales currently known by blender, all translation contexts currently defined, etc.).
* The ability for addons to feature translations, using the (un)register functions of above module.
* Also cleans up "translate py string when storing into RNA prop" by removing "PROP_TRANSLATE" string's subtype, and adding a PROP_STRING_PY_TRANSLATE flag instead (this way it is no more exposed to python...).
Addon translations work with py dictionaries: each addon features a dict {lang: {(context, message): translation, ...}, ...}, which is registered when the addon is enabled (and unregistered when disabled).
Then, when a key (context, message) is not found in regular mo catalog, a cache dict for current locale is built from all registered addon translations, and key is searched in it.
Note: currently addons writers have to do all the work by hand, will add something (probably extend "edit translation" addon) to automate messages extraction from addons soon(ish)! To get a look to expected behavior from addons, have a look at render_copy_settings/__init__.py and render_copy_settings/translations.py (rather stupid example currently, but...). Once we have a complete process, I'll also update relevant wiki pages.
|
|
over 2000 string lookups on startup and gives overall ~10% speedup for starting blender on my system.
|
|
We already have update callbacks, but generic get/set functions can come in handy in some cases where the functionality is too complex to use a single value.
The current C callback functions are too simple allow a straightforward implementation, in particular they don't receive the PropertyRNA pointer itself as an argument, which means the callback cannot directly access the PropertyRNA's py_data pointers which store the python function objects. For this reason a second runtime variant of these callbacks has been added. It is only used for runtime callbacks and not in makesrna, but otherwise works the same way.
|
|
name), and a first default "Operator" one for all operators' label.
The fact is, operators' label are nearly always verbs, while properties labels are nearly always nouns. So this should already solve many translations' problems regarding noun/verb confusion.
This commit also simplifies a bit i18n usage:
*Now IFACE_ and TIP_ macros (or there context versions, CTX_IFACE_/TIP_) are used nearly everywhere (with one exception, where code is a bit complex and needs to manually test whether ui/tip translations is allowed, so no need to redo it later through those macros).
*Also, those macros are now defined to NOP in case WITH_INTERNATIONAL is false, which avoid testing that define everywhere in code!
|
|
|
|
without the underscores these clogged up the namespace for autocompleation which was annoying.
|