Campbell Barton
11d12d945e
style cleanup: python api
2012-03-26 06:55:09 +00:00
Campbell Barton
81d8f17843
style cleanup: pep8, indentation
2012-03-24 07:36:32 +00:00
Campbell Barton
5a90ea77bc
style cleanup: follow style guide for formatting of if/for/while loops, and else if's
2012-03-24 06:24:53 +00:00
Campbell Barton
b56d2f9766
fix [ #30623 ] user-defined render presets bug
...
this report exposed multiple bugs in blender when using a non utf8 compatible home directory.
- bpy.utils.script_paths() would crash when homedir wasn't utf8 (reported bug)
- PyC_DefaultNameSpace() - would raise an error when running when __file__ was non utf8.
- preset filepath property was not set to accept non utf8.
- bpy.paths.display_name would raise an error on non utf8 paths, (used for preset draw)
2012-03-21 22:29:49 +00:00
Campbell Barton
4f19c1a995
spelling cleanup
2012-03-18 07:38:51 +00:00
Campbell Barton
70d3d1aca6
style cleanup: py/capi
2012-03-16 21:39:56 +00:00
Campbell Barton
89a963fb7f
style cleanup: comment blocks
2012-03-09 18:28:30 +00:00
Campbell Barton
4f7bdc59d3
style cleanup: spelling.
...
also remove large, duplicate comments from sunsky.h
2012-03-09 00:41:09 +00:00
Campbell Barton
1531e3677a
bmesh py api
...
* add BLI_rfindlink for reverse index lookup (used so bm.select_history[-1] doesn't have to loop the entire list twice).
* add bm.select_history.active so you can get the last selected item or None without having to check seq length.
2012-03-03 22:07:58 +00:00
Campbell Barton
3590076193
style cleanup - comment formatting
2012-03-03 20:36:09 +00:00
Campbell Barton
3fc2fbc333
style cleanup, use { on newline after function definition.
...
spelling 'impliment' -> 'implement'
2012-02-25 16:49:59 +00:00
Campbell Barton
3788adb8cb
utility functions to convert between flags / sets, without depending on RNA API.
2012-02-22 09:15:46 +00:00
Campbell Barton
c4e7cc3287
fix for leak in gpu.export_shader(), wasnt freeing the function.
...
also change the bmesh iterator so its possible to initialize without stepping.
2012-02-20 22:04:29 +00:00
Campbell Barton
4acab3eb33
Code Cleanup: line length and use Py_ssize_t for PyC_AsArray utility function.
2012-02-05 02:04:26 +00:00
Campbell Barton
9c9099a805
formatting edits in py api, no functional changes
2011-12-18 08:50:06 +00:00
Campbell Barton
676c2924d9
fix [ #29319 ] bus error with python with link_append and {}
...
patch from Emil Brink
2011-11-22 14:05:08 +00:00
Campbell Barton
e5647ea196
py operators - don't use the screen as an operators ID anymore, screen's don't store operator instances and operator functions have access to the context if they need the current screen.
...
also add some more py api file descriptions.
2011-11-05 08:40:07 +00:00
Campbell Barton
665f602f15
python string conversion
...
- use _PyUnicode_AsStringAndSize where possible
- use %R for PyErr_Format(...) rather then running repr on the object explicitly
- use const char
2011-11-03 14:09:18 +00:00
Campbell Barton
4a04f72069
remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n
2011-10-23 17:52:20 +00:00
Campbell Barton
ebe63b664b
py api - added PyC_UnicodeFromByteAndSize() to match 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.
2011-10-22 10:49:35 +00:00
Campbell Barton
8d6a554d75
- add BLI_string_utf8.h for unicode functions.
...
- move font.c unicode functions into string_utf8.c and rename to fit with other BLI_string funcs.
2011-10-20 09:47:05 +00:00
Campbell Barton
445279524a
debug build option WITH_PYTHON_UI_INFO, so you can right click and edit the python source for UI layout directly.
2011-10-20 00:48:00 +00:00
Campbell Barton
276e5f7095
formatting edits & remove debug print.
2011-10-13 01:29:08 +00:00
Campbell Barton
018fa1540e
whitespace edits, make formatting for functions consustent at least within the file.
2011-09-28 05:53:40 +00:00
Campbell Barton
d98bcb8a77
fix for py/rna api bug:
...
PyC_UnicodeAsByte(), used for getting python strings as bytes wasnt clearning utf-8 conversion errors.
this would raise an error when getting an operators filepath.
2011-09-27 04:07:48 +00:00
Campbell Barton
264c63ef03
New C/Py api utility function PyC_Err_Format_Prefix() which raises an error 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)
2011-09-15 10:43:55 +00:00
Campbell Barton
5a900be4d6
attempt to have a threadsafe version of PyC_ExceptionBuffer didnt work with UI script errors, reverting r39886.
2011-09-08 02:14:24 +00:00
Campbell Barton
8cc307b4f2
PyC_ExceptionBuffer is now threadsafe, used for converting exceptions into reports.
2011-09-03 06:46:31 +00:00
Campbell Barton
d5984b2d50
fix [ #27683 ] Blender hangs when baking a particle system when a driver is present
2011-07-09 17:41:39 +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
9dda11e0f1
correction for windows.
2011-04-18 10:18:35 +00:00
Campbell Barton
0814cdf54e
fix [ #26951 ] blenderplayer and runtimes will not load
...
blenderplayer wasn't finding bundled python, eg: ./2.57/python/lib
2011-04-18 08:27:50 +00:00
Campbell Barton
a21f46b6d4
new function RNA_warning(), replaces printf with function which may be 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
2011-03-25 04:36:10 +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
471c0c1afb
py-api utf8/filepaths:
...
in function PyC_UnicodeAsByte(), replace code copied from python with PyUnicode_EncodeFSDefault(), new in py3.2.
2011-03-08 01:28:10 +00:00
Campbell Barton
cfd9d6d190
Drop support for python 3.1.
...
for building py3.2 on *nix see:
http://wiki.blender.org/index.php?title=Dev:2.5/Doc/Building_Blender/Linux/Troubleshooting#Python
also fixed possible buffer overrun with getting the fake filepath for a blender textblock.
2011-03-07 11:53:40 +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
8186ba15ab
last commit used py3.2 function, inline for py3.1
2011-02-22 08:29:25 +00:00
Campbell Barton
1e120098fc
pyapi, use direct access to the frame rather then python attributes.
2011-02-22 07:57:18 +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
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
ffe7bde02c
correct fix for bug #23871 , __main__ module was being overwritten in nested 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.
2011-02-01 12:37:53 +00:00
Campbell Barton
0362d19f2d
Pythons path functions - os.walk(). os.path.exists(). etc support bytes for paths as well as strings, support this with blender/rna too.
...
- bpy.data.*.load() functions were only accepting UTF-8 paths.
- rna functions/properties now accept byte values rather then strings for file paths.
- bpy.path.resolve_ncase now supports byte objects.
2011-02-01 04:24:47 +00:00
Campbell Barton
f0951e86ee
fix for PyC_LineSpit() finding the current line of the frame's code object.
2010-12-23 00:19:34 +00:00
Campbell Barton
260687d9b1
use PyUnicode_DecodeFSDefault rather then PyUnicode_DecodeUTF8(str, strlen(str), "surrogateescape"), for converting non utf8 names.
...
this is needed because some UTF8 names didnt resolve on windows when using surrogateescape'd strings.
This meant you couldn't export to models some directories on windows.
2010-12-05 09:20:18 +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
874ffaca7b
typo in function prefix.
2010-10-03 23:29:43 +00:00
Campbell Barton
1615c9e435
python/c utility function for debugging, see http://wiki.blender.org/index.php/Dev:Doc/Debugging/PyFromC
2010-09-19 14:02:45 +00:00
Campbell Barton
db7a4e530e
move namespace creation function into py_capi_utils.c, to be used in more general cases, not just the blender/rna api.
2010-09-18 15:30:03 +00:00