Commit Graph

694 Commits

Author SHA1 Message Date
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
14c9899a69 Fix T37903: Operator log serialization broken for sets.
Was a mistake in rB9d6f05ed style edits (TRUE became false ;) ).
2013-12-20 23:35:28 +01:00
afffa9bc39 RNA: Add assert to ensure the idprop is correct size on array get/set 2013-12-12 21:01:20 +11:00
02f90c0001 User Interface: don't show macro args in tooltips
was often making much too big strings to show in a tip.
2013-11-26 09:00:24 +11:00
ad34a5cc1b Fix [#34675] *AFTER 2.69* Info view shows duplicate operators with incorrect values of args
Refactored a bit WM api to generate operator's pystring, now it can also handle correctly macro operators. Thanks to Campbell for the review!
2013-11-06 20:56:18 +00:00
089d0ad8f9 add IDP_FreeFromGroup(), replaces IDP_RemFromGroup(), IDP_FreeProperty(), MEM_freeN(). 2013-10-16 05:29:28 +00:00
46b807b231 fix [#37072] Crash on RMB click on bone's custom property 2013-10-14 19:53:28 +00:00
752c1a8214 Fix [#36788] changing the built in keying set prints "attempt to free NULL pointer" to console. 2013-09-21 07:37:11 +00:00
Lukas Toenne
37b82a2d26 Fix #36226, Select Linked works not in touch with Prefs.
When setting keymap properties to values equalling the RNA default, they will
get "unset" and automatic operator behavior is used. There is no way to
explicitly set the default value as a user.

1) To allow distinguishing uninitialized (not set) properties in the keymap
items, a few changes to the RNA struct comparison function are needed: Instead
of allowing only strict/non-strict comparison of 2 properties A and B in a
struct, this now has 3 modes:
* STRICT: compare only the actual property values (same as 'strict' before)
* UNSET_MATCH_ANY: if either A or B is unset, consider them a match (same as
non-strict before)
* UNSET_MATCH_NONE: if one property is set and the other not, consider them a
mismatch.

The new UNSET_MATCH_NONE mode is useful for keymaps, because it allows keeping
user-defined property values in the keymap even if they match the default
property value (see wm_keymap_diff function in wm_keymap.c)

2) A new operator is added for unsetting ID properties in the RMB context menu
and in user preferences next to keymap properties. This only works on ID
properties and deletes the ID property storage, so that the default value is used.

In the user preferences for keymaps the properties are shown in an inactive
layout to indicate that the default value is used (which some operators such as
the "select linked" op from the report use to trigger automatic behavior). When
the user sets a property it gets set and stays that way until explicitly "unset"
using the new operator.
2013-09-20 09:10:17 +00:00
9d6f05edb8 fix relating to bug [#36758],
When printing operator reports, ommit unset properties.
This is needed because in some cases operators check if a value is set or not, so filling in default arguments may change behavior.
2013-09-18 01:22:28 +00:00
29cbf93b07 correct error in libmv stub, also correct typo. 2013-09-13 03:49:11 +00:00
734eaab545 Fix #36327: cycles render layers exclude layers animation did not work well.
This is kind of another way to animate layers which is disabled, but add an
exception to make this case work.
2013-09-10 20:26:34 +00:00
c93750d893 RNA fixes regarding dynamic array properties in functions parameters (reviewed by Brecht, thanks!):
* It was not clear that RNA_parameter_length_get() & co only affected dynamic properties, renamed them to RNA_parameter_dynamic_length_get() and such.

* Fixed RNA_function_find_parameter(), we can't use BLI_findstring() here, need to call RNA_property_identifier()!

* Fixed RNA_parameter_get() and RNA_parameter_set(), which were completely wrong for dynamic properties.

* Fixed RNA_parameter_dynamic_length_get/set_data(), they did not check the property was actually a dynamic one and were using again ugly blackmagic casting intead of ParameterDynAlloc structure!

* makesrna was still using an ugly hackish (and perhaps not always working) code when handling dynamic parameters, now synchronized with RNA_parameter_dynamic_length_get_data and RNA_parameter_get code.
2013-08-26 16:08:03 +00:00
3cf14f0b3a style cleanup: space around for loop wrappers 2013-08-24 10:05:29 +00:00
33686720f2 Fix RNA parameter passing issue with dynamic arrays, was computing the wrong
size in some cases.
2013-08-11 15:49:27 +00:00
6864f2c285 move suspicious break statement in drawDispListsolid() to prevent falling through. 2013-07-28 11:15:26 +00:00
6c0d97fbcf fix [#35806] Unable to check "Correct UVs" option in "Loop Cut and Slide" (Keymap Editor) 2013-07-09 00:08:18 +00:00
7e73b6b701 fix for error reading defaults from custom properties, would read out of bounds memory.
recent change to animsys r57904 exposed this error in some sintel files.
2013-07-02 08:06:45 +00:00
2a195b7825 fix [#35501] Operator log: some property changes log as [...].(null) = ... 2013-06-03 00:46:20 +00:00
88d1067f58 code cleanup: use BM_elem_flag_test rather then accessing 'ele->head.hflag' 2013-05-17 12:43:58 +00:00
71775dc2a4 Fix another cases where painting long brush strokes with small radius was slowed
down, this time by the operator properties getting converted to a string for
display in the info window.

With 1000+ stroke points this can get slow, and takes up too much space anyway,
so now it's (somewhat arbitrarily) limited to printing only 10 points.
2013-05-15 14:37:01 +00:00
cfbf9c324b style cleanup 2013-05-14 06:58:35 +00:00
359edc27d3 style cleanup 2013-05-11 01:06:01 +00:00
3e1e76a2c1 Fix #35289: UV layout export to image was extremely slow for large meshes. This
was due to slow implementation of slice operation for things like mesh uv data.
Made that faster now for cases where the internal storage is an array.
2013-05-10 22:05:47 +00:00
91ba6c9ced adjustment to own commit r56463.
when strings use 'PROP_NEVER_NULL' we still want them to show an unlink button.
2013-05-02 21:27:19 +00:00
e22c52af16 Fix [#34545] Render layer name is unwantedly translated in composite node editor
Some enums' items actually are generated from data (like the render layers of compo nodes), so they should not be translated. Added a PROP_ENUM_NO_TRANSLATE new RNA flag to tag those enums (only found those for nodes, but may be more of them around).

Also fix similar issue in main list of render layers (Py UI code! :P ).
2013-04-25 17:40:08 +00:00