Campbell Barton
aaae90af33
fix [ #28751 ] Item in Enum propertie is grayed out
...
was infact a very old bug where an empty title took the following word for the title, eg: "%t|First Item|Second Item"
the first item would be evaluated as a title.
2011-09-27 16:23:40 +00:00
Campbell Barton
943a026c60
py/rna string subtypes for strings which should be automatically translated:
...
layout.prop("blah", text="Translate Me!")
2011-09-21 13:53:35 +00:00
Campbell Barton
fa2ba5fbf5
- use static vars and functions where possible.
...
- use NULL rather than 0 when used as pointers.
2011-08-28 05:06:30 +00:00
Campbell Barton
de0db6c8da
unit arg for FloatVectorProeprty
2011-08-02 10:56:09 +00:00
Campbell Barton
7cbc4c0dd7
IDProperty python module update
...
- add support for IDProp array slicing, but not resizing.
- rename array attribute type to typecode and use chars 'f', 'd', 'i' which match pythons array module. (was using int's which only have a meaning internally).
- rename function 'convert_to_pyobject' to 'to_dict' and 'to_list' for IDProp group and array types respectively.
- remove 'len' array attribute, calling len(array) is fine.
2011-06-17 05:45:46 +00:00
Campbell Barton
e44ae2c2a9
disable the readonly state while rna property callbacks run.
2011-06-07 16:08:49 +00:00
Campbell Barton
9c8cc9fe60
rna option not to save certain properties for redoing later, currently only used by operator presets.
2011-06-07 10:54:57 +00:00
Campbell Barton
617a08162f
update ctest md5sums for import/export to match changes to the scripts, also some minor formatting change for bpy_props.c
2011-06-07 08:47:33 +00:00
Campbell Barton
8cee328546
Support for update callbacks in python defined RNA properties as discussed last meeting.
...
This means script authors can perform actions using these callbacks rather then on drawing which puts blender in a readonly state.
Simple example:
import bpy
def up_func(self, context):
print("test")
bpy.types.Scene.testprop = bpy.props.FloatProperty(update=up_func)
bpy.context.scene.testprop = 11
# prints -> test
2011-06-06 17:50:20 +00:00
Campbell Barton
7ee9becfa3
disable python/string enum duplication from last commit because the array of duplicated strings can be freed and the pointers to the strings referenced still, the problem with python freeing strings that RNA references remains.
2011-06-03 04:39:18 +00:00
Campbell Barton
089d997cbc
when making the C/RNA copy of the python enum, duplicate all strings since theres no guarantee python wont free them immediately after, though in practice this isn't so common.
2011-06-03 04:21:41 +00:00
Campbell Barton
5332c602c9
pre-allocate the array when converting py/rna enums, also fix for memory leak with bad values.
2011-06-03 03:19:22 +00:00
Campbell Barton
d46da5a09d
mathutils support for color arithmetic, also some minor whitespace edits.
2011-06-02 08:29:16 +00:00
Campbell Barton
78d41d061b
sphinx docstrng formatting (some lines were getting really long)
2011-05-26 19:13:01 +00:00
Campbell Barton
57c3c9e70f
support for dynamic items in bpy.props.EnumProperty(), the items keyword argument can optionally be a function rather then a list.
2011-05-26 16:07:28 +00:00
Campbell Barton
15289c6048
use PyDoc_STRVAR macro, so its possible to build without docstrings.
2011-05-24 16:05:51 +00:00
Campbell Barton
f86565c90e
whitespace edits for bpy api, split some really long lines.
2011-04-30 13:58:31 +00:00
Campbell Barton
f9f771cd01
converted more mixed tab/space indentations to tabs. only whitespace changes.
2011-04-21 15:53:30 +00:00
Campbell Barton
6bb626f253
minor changes
...
- remove some warnings
- fix typos
- cmake allow in-source build (when WITH_IN_SOURCE_BUILD is defined)
- cmake, use an explicit list of rna files (don't glob)
2011-04-21 05:49:47 +00:00
Campbell Barton
cadc1218c8
C, style changes (mostly white space edits), no functional change.
2011-03-19 11:12:48 +00:00
Campbell Barton
e2304a4dbb
move anim functions out of bpy_rna.c, its getting too big.
2011-03-02 04:51:43 +00:00
Nathan Letwory
5a760e22fc
doxygen: blender/python tagged.
2011-02-27 20:10:08 +00:00
Nathan Letwory
5b607701a7
doxygen: prevent GPL license block from being parsed as doxygen comment.
2011-02-23 10:52:22 +00:00
Campbell Barton
6524d27462
py api was raising SystemError exception incorrectly, this is intended for internal interpreter problems.
...
Replace most with RuntimeError.
2011-02-18 06:04:05 +00:00
Campbell Barton
4c35d8d5a8
rename IDPropertyGroup to PropertyGroup
...
also renamed IDProperty to PropertyGroupItem (these are not referenced for common usage and we already have 'Property' defined).
2011-02-16 02:51:56 +00:00
Campbell Barton
d5316768c3
corrention for bpy.props docstrings.
2011-02-15 11:43:35 +00:00
Campbell Barton
72bc3f22b7
python api renaming and added headers for some files which didnt have one, no functionality change.
2011-02-14 04:15:25 +00:00
Campbell Barton
0955c664aa
fix for warnings from Sparse static source code checker, mostly BKE/BLI and python functions.
...
- use NULL rather then 0 where possible (makes code & function calls more readable IMHO).
- set static variables and functions (exposed some unused vars/funcs).
- use func(void) rather then func() for definitions.
2011-02-13 10:52:18 +00:00
Campbell Barton
d272b70ee0
rename ID.update() --> update_tag() since this function only tags for updating and scene.update() executes the update.
2011-02-07 08:13:28 +00:00
Campbell Barton
dc30caab61
fix for crash when assigning unsupported type to collection properties.
2011-01-26 12:44:09 +00:00
Campbell Barton
ba96f02d4a
use fast sequence functions for python's bpy.props.EnumProperty() arg parsing.
2011-01-16 10:36:27 +00:00
Campbell Barton
4dd92a988a
Defining bpy.props.EnumProperty(... , options={'ENUM_FLAG'}) wasnt working right with default values.
2011-01-16 10:08:20 +00:00
Campbell Barton
c9f353956c
use PySequence_Size() rather then PySequence_Length(), this is only kept in python for backwards compatibility.
2011-01-09 14:53:18 +00:00
Campbell Barton
89c9aaaa25
remove references to BKE_utildefines where its not needed.
...
- move GS() define into DNA_ID.h
- add BLI_utildefines as an automatic include with makesrna generated files.
2011-01-07 19:18:31 +00:00
Campbell Barton
8f21a43535
split BKE_utildefines.h, now it only has blender specific defines like GS() MAKE_ID, FILE_MAXDIR, moved the generic defines to BLI_utildefines.h.
...
no functional changes.
2011-01-07 18:36:47 +00:00
Campbell Barton
a4b410af3d
Expose access to PROP_ENUM_FLAG from bpy.props.EnumProperty(), this is exposed as a python set(). The default value is also a python set() so multiple booleans can be used in the 1 property.
...
Also added PROP_ENUM_FLAG support to operator printouts.
2010-12-13 09:10:16 +00:00
Campbell Barton
263830f000
Enabled GCC -Wwrite-strings warning for CMake and replaced many 'char's for 'const char's,.
...
Only one functional change where Transform orientations passed "" to BIF_createTransformOrientation() which could then have the value written into.
2010-12-03 17:05:21 +00:00
Campbell Barton
96dafef228
minor edits to exception formatting (remove ... or \n from suffix)
2010-11-23 16:45:17 +00:00
Campbell Barton
65797d285f
bpy.props: replace common error checks with macros, ugly but better then duplicates.
2010-10-22 13:02:41 +00:00
Campbell Barton
f979bca911
fix for exceptions in recent commit.
2010-10-19 09:50:43 +00:00
Campbell Barton
f3b031314d
[ #24270 ] RNA Properties with long Variable Names
...
disallow registering RNA with names longer then 31 chars.
2010-10-19 07:23:34 +00:00
Campbell Barton
05884e09be
- rna bugfix where ints were not clamped and would overflow, now raise an error and print valid range.
...
- fixed WM_OT_context_cycle_int was causing problems with int overflow, now it cycles properly.
- rename QUOTE macro to STRINGIFY_ARG, and added STRINGIFY, which is used more often since it gives the value as a string.
2010-10-03 01:44:00 +00:00
Campbell Barton
a7fe586c94
patch [ #23749 ] IntVectorProperty missing step [patch]
...
from Dan Eicher (dna), also edited some comments.
2010-09-10 02:46:29 +00:00
Campbell Barton
45cf7633fe
remove class methods for defining properties
...
eg: bpy.types.Scene.BoolProperty()
2010-09-09 06:29:44 +00:00
Campbell Barton
ced3f3ad15
- fix for using ['prop'] in RNA api
...
- fix for testing without USE_PY_METACLASS defined.
2010-09-09 06:06:37 +00:00
Campbell Barton
128bd96c01
py/rna internals
...
- rna internal deferred properties now store the functions as PyObjects rather then C function pointers
- Property functions now allow the first non keyword argument to be a class.
2010-09-08 10:43:36 +00:00
Campbell Barton
6d82951947
bpy.props.* option to pass the first arg as a class.
2010-09-08 08:48:40 +00:00
Campbell Barton
99954545ee
bugfix [ #23656 ] Problems retrieving properties from inside runtime-created PointerProperties
...
cant test if this fix solves the problem matt is having but it at least fixes an error caused by classes created in exec(),
when the properties pointers were copied the hash key still referred to the python object which could be freed. in most cases this wouldnt happen (would be kept in bytecode) but with exec() the property string is freed immediately.
2010-09-06 15:54:08 +00:00
Campbell Barton
0d12c77097
bugfix [ #23635 ] property limits don't work when added via scripting\
...
also fix for bug where soft limits could be greater then hard limits with bpy.props.* functions.
2010-09-02 14:43:22 +00:00
Campbell Barton
39cb1432d8
bugfix [ #23285 ] Exporters not available whel using special characters in path name
...
- ID properties now suopport non utf-8 strings for their values but not their keys.
- moved utility functions into py_capi_utils.c from bpy_utils and bpy_rna.
- import/export paths have to be printed with repr() or %r, so non utf-8 chars are escaped.
2010-09-01 14:13:48 +00:00