Commit Graph

68 Commits

Author SHA1 Message Date
ebebc4ded1 Correct own fix reference before assignment
3rd fix for silly exception conversion!
2015-06-03 17:11:01 +10:00
2be3ebd15d Correct own recent error printing Python exception 2015-06-03 13:42:44 +10:00
8299284389 Correct own recent error, uninitialized var use 2015-05-26 21:36:49 +10:00
29aae4db38 UI: errors in buttons now show in info report
Mistakes in button expressions were previously only printed to the console.
2015-05-18 10:02:29 +10:00
e73d0f57a3 Code cleanup: use 'const' for arrays (python) 2014-04-27 00:25:15 +10:00
1bf5832dfb code cleanup: warnings and use stdbool for bpy* funcs. 2013-01-07 05:26:12 +00:00
c9dade4fe0 Big i18n commit: add "reports" from bmesh/readfile/tracking/dynapaint (and a few others), and another bunch of UI messages tweaks/fixes, as well as some BKE_report()<->BKE_reportf()... 2012-10-26 17:32:50 +00:00
da9394f596 code cleanup: define sizes of vectors for function args and use C style comments 2012-10-15 09:11:17 +00:00
b7f4c69ef7 More UI messages and BKE_reportf->BKE_report fixes... 2012-10-14 15:29:09 +00:00
ed1cda9a6c style cleanup 2012-09-30 06:12:47 +00:00
abf551b1a5 style cleanup: py api 2012-03-26 20:41:54 +00:00
e17fd46c71 formatting edits only to use more consisted style 2011-12-26 12:26:11 +00:00
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
2b939904ab documentation - brief descriptions for bpy api files. 2011-11-05 08:21:12 +00:00
4a04f72069 remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
276e5f7095 formatting edits & remove debug print. 2011-10-13 01:29:08 +00:00
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
f86565c90e whitespace edits for bpy api, split some really long lines. 2011-04-30 13:58:31 +00:00
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
cadc1218c8 C, style changes (mostly white space edits), no functional change. 2011-03-19 11:12:48 +00:00
90d42e114c py/rna: BPy_reports_to_error() now takes the exception type as an argument and returns -1 as an error value 2011-03-12 15:18:08 +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
9416daf97e remove unused functions,
note: BPY_class_validate() could come in handy later if we need to check classes for properties/functions but for now there is no point in keeping it in.
2011-02-23 09:12:55 +00:00
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
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
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
cdefce51f5 update python api with changes from Joshua's commit r33917. translate reports into python errors. 2010-12-31 05:40:30 +00:00
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
b45c3363fd fix for some pedantic warnings. 2010-12-03 01:52:28 +00:00
96dafef228 minor edits to exception formatting (remove ... or \n from suffix) 2010-11-23 16:45:17 +00:00
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
04f619d8af - PyLineSpit() - used to print the filename and line number for internal errors now works when executing class functions in a module.
- replaced PySys_GetObject("modules") with PyImport_GetModuleDict()
- use defaults for keymap import/export rather then setting the same value every time from the UI scripts.
2010-08-14 05:33:20 +00:00
46ed51ce26 made argument conversion for much more verbose, wasnt giving enough info with bad operator args.
(commit 27432 by Campbell from render25 branch)
2010-03-16 17:19:42 +00:00
431db9d478 remove unused includes 2010-03-14 16:06:43 +00:00
081c1205a3 correct fsf address 2010-02-12 13:34:04 +00:00
53f8bbd798 bpy.props.IntVectorProperty & BoolVectorProperty 2010-02-01 10:51:34 +00:00
453945e9e3 remove python api cruft from custom operator registration 2009-12-30 22:51:44 +00:00
764c4c94fa use sets rather then tuples for enum/flags so you can use bitfield operators 2009-12-07 02:20:55 +00:00
1c806f6bb4 workaround for an error with BKE_reportf (actually BLI_dynstr_vappendf)
fixes a crash that happens when formatting a python exception into a report. - for now use pythons string formatting function.

happens when running the simple operator template so not sure if its worth re-tagging :S
2009-11-23 17:36:44 +00:00
de7504807c fix error with python exceptions in BPy_errors_to_report 2009-11-10 16:17:49 +00:00
e6ea68a31c - missing return values
- more detailed exceptions (always give file:line incase the python exception doesnt)
- fix some errors in the edit docs

editing docs still fails, need to figure out why.
2009-11-04 22:36:46 +00:00
ac3f0695a2 remove Py_CmpToRich (copy of py3.0 function), instead only support == and != for PyRNA and KX_PySequence types.
mesh1 > mesh2 # will raise an error.
2009-09-03 01:52:10 +00:00
314b14301f 2.5: warning fixes
Directories intern/ and source/blender/ now compile warning
free again here with scons/gcc.
2009-08-15 16:36:25 +00:00
7084be920a fix for build problem with audiospace and implicit declaration. 2009-08-10 04:50:48 +00:00
7440fee85c remove python2.x support 2009-08-10 00:07:34 +00:00
d9a7e5144f Python operators
- simplified C operator API bpy.__ops__ since its wrapped by python now.
- needs the class to have an __idname__ rather then __name__ (like menus, headers)
- convert python names "console.exec" into blender names "CONSOLE_OT_exec" when registering (store the blender name as class.__idname_bl__, users scripters wont notice)
- bpy.props.props ???, removed
2009-07-19 13:32:02 +00:00
b1d01dae36 PyApi
* refcount error if StringIO or io modules could not be imported
* importing python modules like math didnt work because the script registration overwrote the script path. now just prepend the path.
2009-07-11 13:57:56 +00:00
2e3e044d27 RNA
* Enums can now be dynamically created in the _itemf callback,
  using RNA_enum_item(s)_add, RNA_enum_item_end. All places asking
  for enum items now need to potentially free the items.
* This callback now also gets context, this was added specifically
  for operators. This doesn't fit design well at all, needed to do
  some ugly hacks, but can't find a good solution at the moment.
* All enums must have a default list of items too, even with an
  _itemf callback, for docs and fallback in case there is no context.

* Used by MESH_OT_merge, MESH_OT_select_similar, TFM_OT_select_orientation.
* Also changes some operator properties that were enums to booleas
  (unselected, deselect), to make them consistent with other ops.
2009-07-10 19:56:13 +00:00
bce3f7e019 PyAPI Mathutils Vector callbacks, referencing other PyObjects rather then thin wrapping vectors which is crash prone.
in short, vectors can work as if they are thin wrapped but not crash blender if the original data is removed.

* RNA vector's return Mathutils vector types.
* BGE vectors for GameObject's localPosition, worldPosition, localPosition, localScale, worldScale, localInertia.
* Comment USE_MATHUTILS define to disable returning vectors.

Example...

* 2.49... *
 loc = gameOb.worldPosition
 loc[1] = 0
 gameOb.worldPosition = loc

* With vectors... *
 gameOb.worldPosition[1] = 0


* But this wont crash... *
 loc = gameOb.worldPosition
 gameOb.endObject()
 loc[1] = 0 # will raise an error that the objects removed.

This breaks games which assume return values are lists.

Will add this to eulers, matrix and quaternion types later.
2009-06-22 04:26:48 +00:00