Commit Graph

469 Commits

Author SHA1 Message Date
9307202807 RNA: de-duplciate rna-path create in tooltip code 2015-12-01 10:31:10 +11:00
6e4cb463c4 Cleanup: shadowing (rna, modifiers, *misc*) 2015-11-23 17:40:49 +11:00
d5fb0e517c Cleanup: rename 'datablocks' -> 'data-blocks'
Similar to addons -> add-ons, for reading it fits better to hyphenate.
2015-10-24 02:44:43 +11:00
Julian Eisel
867c49b962 Fix T46345: Registrable props could be modified 2015-10-06 21:51:35 +11:00
477e81128d Show correct syntax for id-properties 2015-09-11 04:29:31 +10:00
2e2dc9b9e3 Refactor translation code out of blenfont
- Add blentranslation `BLT_*` module.
- moved & split `BLF_translation.h` into (`BLT_translation.h`, `BLT_lang.h`).
- moved `BLF_*_unifont` functions from `blf_translation.c` to new source file `blf_font_i18n.c`.
2015-08-18 07:01:26 +10:00
253f416a36 Fix regression of custom nodes not triggering material preview re-render
Issue was introduced in b0df196.It's not the nicest ever solution but it's
quite close to be as nice as we can do it with current custom nodes and
notifier system design.
2015-07-23 11:50:13 +02:00
fc0a576c30 Keyframes on NLA-Strip F-Curves are detected by RNA buttons too 2015-03-29 01:39:52 +13:00
ff1ed872d9 Fix crash using "Copy to selected" on ID-props 2015-03-18 18:53:32 +11:00
fc3de690ac RNA: avoid inefficient array printing 2015-03-13 23:52:47 +11:00
f9a5dab529 RNA: calloc -> malloc when fixbuf is uninitialized 2015-02-20 17:18:41 +11:00
bbc7dc169d RNA: assert when non 0/1 values used as bool
Prepare for using 'bool' type.
2015-02-19 07:08:10 +11:00
86e04c4ca9 RNA: assert on over-sized array index access 2015-02-19 07:01:49 +11:00
9d464a7538 RNA: use __func__ for alloc-id's 2015-02-19 06:57:45 +11:00
4bb331dfd5 RNA API: reuse property lookups 2015-02-17 13:13:59 +11:00
fca515838e Cleanup: strcmp/strncmp -> STREQ/STREQLEN (in boolean usage).
Makes usage of those funcs much more clear, we even had mixed '!strcmp(foo, bar)'
and 'strcmp(foo, bar) == 0' in several places...
2015-01-26 16:59:24 +01:00
aab4f2b762 cleanup: redundant casts & const cast correctness 2015-01-01 23:42:28 +11:00
5148a4d7b5 Uninitialised var warning 2014-11-16 20:24:58 +13:00
2625dc5348 Bugfix T41525: Button keyframe indicators don't work correctly when editing NLA Strips
When the active action is a NLA strip, the keyframe indicator colors for buttons
and the 3D view indicator (i.e. the current frame indicator changes color) didn't
work correctly. This was because they were still checking for keyframes in
"global" time space, whereas they needed to be applying NLA corrections to
"look inside" the remapped action.
2014-11-16 20:24:38 +13:00
d30abdf3ec Fix T42258: Drivers: dimensions.x is always invalid, but dimensions[0] works
'PROP_XYZ_LENGTH' subtype was missing from list of valid '.x/y/z/w' ones.
2014-10-16 16:30:52 +02:00
315c55916b RNA: use static declarations 2014-08-13 08:37:41 +10:00
561f375109 Fix T41409: Copy Custom Property function does nothing with pose bones.
Copying custom IDprops actually never worked, afaik, since previous code was copying 'from'
prop onto itself, in this case!
2014-08-12 17:32:59 +02:00
028fd29eeb Pie Menus C code backend.
This commit merges the code in the pie-menu branch.

As per decisions taken the last few days, there are no pie menus
included and there will be an official add-on including overrides of
some keys with pie menus. However, people will now be able to use the
new code in python.

Full Documentation is in http://wiki.blender.org/index.php/Dev:Ref/

Thanks:
Campbell Barton, Dalai Felinto and Ton Roosendaal for the code review
and design comments

Jonathan Williamson, Pawel Lyczkowski, Pablo Vazquez among others for
suggestions during the development.

Special Thanks to Sean Olson, for his support, suggestions, testing and
merciless bugging so that I would finish the pie menu code. Without him
we wouldn't be here. Also to the rest of the developers of the original
python add-on, Patrick Moore and Dan Eicher and finally to Matt Ebb, who
did the research and first implementation and whose code I used to get
started.
2014-08-11 11:02:26 +02:00
5336e68e11 Fix T41062: "copy to selected" doens't work for all attributes.
The issue was that some properties are no direct children of the struct we support in 'copy to selected'
(RNA_Sequence in this case). Since we can't use the ID of sequences here (it's the scene, while we need
a sequence level of control), we had to add a new API helper to RNA path, which takes a RNA type
and return a path relative to the closest ancester of that type.

This way, we get a path from the RNA_Sequence, and can easily apply it to all other valid sequences
to copy the property.

Review, suggestions and edits by Campbell Barton, thanks!
2014-08-05 19:21:14 +02:00
00b29156e0 Defines: replace ELEM3-16 with ELEM(...), that can take varargs 2014-07-20 01:33:40 +10:00
9296f0c2fe This reverts commit c998d6d4b5. 2014-05-20 21:35:34 +10:00
c998d6d4b5 Fix T40224: Crash moving objects to another layer
passing NULL to BLI_sprintfN crashed in some cases.
2014-05-20 21:01:02 +10:00
39d2cccd65 Fix for strict compiler flags after recent const array changes 2014-04-28 13:25:27 +06:00
7ca74fc1c0 Code cleanup: use 'const' for arrays (blenloader, gpu, imbuf, makesdna, modifiers, nodes) 2014-04-27 00:25:16 +10:00
bca7d15ce0 Code cleanup: use const for rna 2014-04-22 22:55:10 +10:00
f3db0389c0 Correct assert for RNA IDProps 2014-04-07 19:51:43 +10:00
4550731963 RNA: optimization to avoid malloc for iterators.
This mostly helps making Cycles scene synchronization a bit faster.
2014-04-05 14:50:17 +02:00
45b02cee47 Code cleanup: no need to use calloc when memory is initialized after
also replace AT with __func__ since AT expands the full pathname
2014-04-04 14:26:01 +11:00
617557b08e Code cleanup: remove TRUE/FALSE & WITH_BOOL_COMPAT define 2014-04-01 15:22:28 +11:00
1f63b0807b Fix bpy.types.Operator.bl_rna.foobar not working since rBfe094eaf20.
When path to resolve "finishes" on a collection prop, do not erase the returned prop!

This caused py's path_resolve to return same PointerRNA as the one passed as parameter, leading to
inifinte recursion in Operator's accessor func (__getattribute__)...
2014-03-19 12:50:17 +01:00
d7824e435f Fix possible (unlikely) use of uninitialized pointer in RNA resolving 2014-03-13 04:18:50 +11:00
a6bdad699c Fix T39080: copy-to-selected operator fails for pointer properties.
The copy-to-selected operator for RNA buttons uses paths for copying
object pointer properties. Copying other ID data blocks is deliberately
disabled:
https://developer.blender.org/diffusion/B/browse/master/source/blender/editors/interface/interface_ops.c$274

However, the RNA_path_resolve_full function is not properly working for
retrieving pointer properties: it always will dereference pointer
properties in anticipation of further path elements.

In fact the return value of RNA_path_resolve_full has a conflicting
double meaning. It returns `false` when
* the RNA path is invalid
* any of the pointer properties is NULL

This means that it is not capable of returning pointer properties at all.
To make this possible, there is now an internal function for path
parsing, which returns false //only// if the the path is invalid.
On top of this there are 4 wrapper functions for retrieving either
actual property values (RNA_path_resolve, RNA_path_resolve_full) and for
retrieving pointer+property pairs (RNA_path_resolve_property,
RNA_path_resolve_property_full). The latter 2 variants will **not**
dereference pointer properties at the end of the path, so callers can
actually get the property itself. The `***_full` variants include an
array index return value.

Differential Revision: https://developer.blender.org/D396
2014-03-11 14:58:53 +01:00
658f37acd7 Minor cleanup: use rna_ prefix for path_resolve_* functions for
consistency.
2014-03-10 12:46:01 +01:00
fe094eaf20 Cleanup for RNA_path_resolve_full.
* Moved collection key parsing and array index parsing into their own
functions, to make the main path loop easier to follow.
* Unified boolean return values.
2014-03-10 12:26:50 +01:00
d971c5785e Fix root of the issue of bad_cast bug in localization
No need to call l10n stuff when it's disabled in the preferences.

Reviewed by @mont29, thanks!
2014-02-27 15:07:25 +06:00
64664541b6 Fix T38706: dropdown labels in popups not updating
Caused by own recent changes to menu handling
2014-02-19 11:35:45 +11:00
69fb332709 Fix regression that Blender crashes on startup if UI translation is enabled, it was mistake in rB50b2c78ad8b6. 2014-02-18 19:09:44 +09:00
50b2c78ad8 RNA: assert on NULL return values from itemf callbacks 2014-02-17 23:31:59 +11:00
280f9d3b39 Fix T38650: Crash from enum item functions returning NULL instead of a
single terminator item.

Ideally no enum item function should return NULL, but since this is very
common and an intuitive mistake, better handle that case gracefully in
the RNA access function.
2014-02-17 12:19:39 +01:00
77a15aba38 IDProp API: change IDP_NewString so sizeof() can be passed in. 2014-02-15 12:31:58 +11:00
6bad063298 RNA: add RNA_enum_from_identifier, RNA_enum_from_value search functions
also fix leak in RNA_enum_is_equal
2014-02-09 17:31:02 +11:00
27d482425d Fix for RNA stringifying enum-flags freeing wrong pointer. 2014-02-05 23:08:34 +11:00
d900f5be55 Code cleanup: use bools where possible 2014-02-03 19:35:44 +11:00
fc39e895e9 Style Cleanup: whitespace 2014-01-12 22:27:55 +11:00
6734936c13 RNA API: use bool's for enum itemf callbacks. 2014-01-04 18:10:01 +11:00