Age | Commit message (Collapse) | Author |
|
This shows the text as part of the assertion message.
|
|
Also use doxy style function reference `#` prefix chars when
referencing identifiers.
|
|
|
|
|
|
This patch fixes many minor spelling mistakes, all in comments or
console output. Mostly contractions like can't, won't, don't, its/it's,
etc.
Differential Revision: https://developer.blender.org/D11663
Reviewed by Harley Acheson
|
|
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
|
|
Differential Revision: https://developer.blender.org/D8908
|
|
|
|
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.
|
|
Use _fn as a suffix for callbacks.
|
|
|
|
As a followup to rBc71a8e837616159735, add a debug-only check for
incorrect range, when the percentage and factor functions were likely
confused.
|
|
This helps avoid copy-paste errors which have happened a few times,
no functional changes.
|
|
|
|
|
|
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...
|
|
This reverts commit f39fbb3e604611b63c69661dd22ca987fb1d8791.
Code is not valid, `DefRNA.laststruct` does not always point to the
proper struct when defined from Python, need to be done differently.
|
|
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.
|
|
|
|
|
|
|
|
This fixes critical bug with liboverride when soe add-ons add some
RNA ID Pointer properties.
ID pointers should **never** have ownership of their ID when defined
from python.
(As a reminder, RNA properties owning their ID pointers are extremely
rare even from C code, only embedded IDs (root node trees, master
collections) and the shape keys snowflakes are concerned.)
|
|
It got left out of {rBc04088fed1b8faea6b2928bb5e09ab3}.
No functional change.
|
|
The data layout remains exactly the same..
This change just gives all the elements in `SDNA->structs` names,
making it more comfortable to work with the data.
Reviewers: campbellbarton
Differential Revision: https://developer.blender.org/D8926
|
|
Also order sizeof(..) first to promote other values to size_t.
|
|
pointer properties.
Since makesrna runs after all properties have been defined, we have to
remember with a new internal flag when we explicitely disable the
'PROP_PTR_NO_OWNERSHIP' flag for a property.
Otherwise there was no way to do so for ID pointer properties...
|
|
|
|
There is in fact no reason not to do so, RNA pointers are either to
other IDs (which is properly handled by default diffing code), or to
sub-structures that should almost always be diffed as well.
Exceptions (like backward ID pointers or strictly runtime caches and
data) are to be handled with proper 'no comparison' flag in any case.
|
|
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.
|
|
|
|
Mistake in 03a4d3c33f82, turns out this actually is called from BPY
(which I didn't think it was). So only error out during makesrna, not at
runtime.
|
|
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
|
|
|
|
Would have prevented T74227 from slipping through
since it didn't crash on some systems.
|
|
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
|
|
We could of course always add checks for more invalid characters, but
I'd say they are more unlikely to happen.
|
|
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.
|
|
|
|
Avoids errors like T70281 slipping through.
|
|
|
|
These are now set from DNA defaults.
|
|
|
|
Use defaults from DNA_*_defaults.h headers, this avoids calling
RNA_def_property_*_default explicitly & having to repeat values.
|
|
Some statements were split across multiple lines because of their
trailing comments.
In most cases it's clearer to put the comments above.
|
|
|
|
Use so we can have a default update function,
that doesn't need to be set for every property.
|
|
Since these are temporary properties, changing them shouldn't cause
undo pushes. There already is a flag to disable that, but since each
operator inherits its own properties from the base, RNA define code
also had to be changed to allow inheriting the flag.
|