Age | Commit message (Collapse) | Author |
|
|
|
Adds categories "bpy.context" & "bpy.rna"
|
|
Move function error printing utility into py_capi_utils.
|
|
This allows to have different macro headers without them sharing
similar names to regular C modules.
|
|
Was already used in two other headers, remove underscore prefix.
|
|
So we can use in headers without pulling in many other defines.
|
|
Would cause problems if args included function calls.
|
|
This was meant to be generic but introduced possible type errors
and unnecessary complication.
Replace with typed PyC_Tuple_PackArray_* functions.
Also add PyC_Tuple_Pack_* macro which replaces some uses of
Py_BuildValue, with the advantage of not having to parse a string.
|
|
|
|
Recent inclusion caused build error with the BGE.
|
|
Python's C-API doesn't provide functions to get
int's at specific integer sizes.
Leaving the caller to check for overflow,
which ended up being ignored in practice.
Add API functions that convert int/uint 8/16/32/64, also bool.
Raising overflow exception for unsupported ranges.
|
|
Utility to execute a string and get the resulting string,
matching BPY_execute_string_as_number.
Not used just yet but generally useful function.
|
|
|
|
Read the string length from Python directly when assigning id-properties
|
|
Use BPY_execute_* prefix for all Python execution commands
|
|
Use for mathutils.bvhtree
|
|
Would only happen when the list-length was an unexpected size.
Also add PyC_AsArray_FAST
|
|
Mistakes in button expressions were previously only printed to the console.
|
|
Setting all values of a tuple is such a common operation that it deserves its own macro.
Also added Py_INCREF_RET to avoid confusing use of comma operator.
|
|
Exposes all supported unit systems & types, and to_value()/to_string() functions.
Reviewed and enhanced by CampbellBarton, many thanks!
Differential Revision: https://developer.blender.org/D416
|
|
|
|
|
|
|
|
call,
(indirectly referenced Python define of ~30 lines, most were optimized out but still caused some code bloat).
|
|
|
|
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.
|
|
had to do this internally.
- bpy.path.extensions_image
- bpy.path.extensions_movie
- bpy.path.extensions_audio
eg:
if os.path.splitext(filename)[1].lower() in bpy.path.extensions_image:
... we have an image ...
|
|
|
|
had a typo too.
|
|
split off.
|
|
|
|
also change the bmesh iterator so its possible to initialize without stepping.
|
|
without the underscores these clogged up the namespace for autocompleation which was annoying.
|
|
|
|
http://markmail.org/message/fp7ozcywxum3ar7n
|
|
PyUnicode_FromStringAndSize()
also made RNA_property_string_get_alloc() return the length of the new string to avoid having to run strlen on it after.
|
|
python source for UI layout directly.
|
|
with the existing error as a suffix.
Use this to raise errors when assigning a string property fails even though the value to assign *is* a string.
Before:
TypeError: bpy_struct: item.attr= val: Object.name expected a string type, not str
After:
TypeError: bpy_struct: item.attr= val: Object.name error assigning string, UnicodeEncodeError('utf-8' codec can't encode character '\udce9' in position 23: surrogates not allowed)
|
|
present
|
|
- 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.
|
|
blenderplayer wasn't finding bundled python, eg: ./2.57/python/lib
|
|
called via python.
Now this gives the line number of the scripts thats running, eg:
uiItemFullO: unknown operator 'some.operator'
/c/bin/2.56/scripts/startup/bl_ui/space_view3d_toolbar.py:73
|
|
|
|
|
|
functions, so on returning from calling operators the __main__ module could be cleared and imported modules turn into None
calling
bpy.ops.wm.read_factory_settings()
... would clear a scripts namespace if running directly, not in a module.
Fix by backing up and restoring the __main__ module.
Also found BKE_reportf wasnt printing all reports in background mode as BKE_report() was doing.
|
|
'const char's,.
Only one functional change where Transform orientations passed "" to BIF_createTransformOrientation() which could then have the value written into.
|
|
|
|
http://wiki.blender.org/index.php/Dev:Doc/Debugging/PyFromC
|
|
* Fix var declaration in bpy_interface.c
* Remove forward declarations from py_capi_utils.h: they are unnecessary and break compiles (there were probably many warnings about this during compile with GCC).
|
|
general cases, not just the blender/rna api.
|