Commit Graph

95 Commits

Author SHA1 Message Date
41a2b97c30 Minor changes needed for standalone mathutils 2015-12-07 11:09:00 +11:00
d7d1fc5c74 Cleanup: use correct name in prints 2015-11-25 23:54:39 +11:00
00afa02528 PyAPI: remove workaround for Py3.4 bug 2015-11-25 21:54:02 +11:00
4aad17c622 Use PyThreadState_GetDict, avoid Python internals
Works around problems caused by exposing Py internals (Py_BUILD_CORE).

- Build error with GCC, Py3.6 & OpenMP
- Linking error on MSVC
2015-09-26 12:02:17 +10:00
365d8ceac0 Workaround for linking Python on win32 2015-09-23 23:20:15 +10:00
7b9bd5b546 Recent change for Py3.6 compat caused fatal-error
Revert back to old method, and define Py_BUILD_CORE to expose internals.
2015-09-21 23:08:18 +10:00
6844b02a71 Fix for building w/ Python3.6 2015-09-19 17:49:38 +10:00
42d65ef5cc Add bool parser for PyArg_ParseTuple
Use for mathutils.bvhtree
2015-08-03 20:00:16 +10:00
339915a962 Optimize PySequence_Fast usage
Access arrays directly, avoiding type-check every time.
2015-07-29 10:49:35 +10:00
d226a4ba6d Fix leak in PyC_AsArray
Would only happen when the list-length was an unexpected size.

Also add PyC_AsArray_FAST
2015-07-29 10:49:34 +10:00
3ce4a58aa9 Cleanup: duplicate includes 2015-06-18 06:32:01 +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
9fd569a654 PyAPI: add utilities PyTuple_SET_ITEMS, Py_INCREF_RET
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.
2015-01-06 19:09:11 +11:00
43fa4baa6c Refactor: BLI_path_util (part 2)
Use BKE_appdir/tempdir naming prefix for functions extracted from BLI_path_util
2014-11-23 18:55:52 +01:00
9f05588b68 Python: remove redundant casts 2014-07-01 14:10:59 +10:00
87930eb7c2 Hopefully fix compilation with old MSVC2008/WIN32... 2014-06-18 10:32:25 +02:00
f94b87bbb8 New python API for units handling.
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
2014-06-17 16:03:40 +02:00
f2a0062042 Use ARRAY_SIZE to replace (sizeof(a) / sizeof(*a)) 2014-06-17 02:47:57 +10:00
f325ddb0d7 Fix Python fails to execute text-blocks including non-mbcs chars (T35176, D595) 2014-06-16 15:29:25 +10:00
b96d531bc9 Python: move to version 3.4x on all platforms 2014-04-30 23:19:16 +10:00
3d9b4159a4 PyC_RunQuicky: Print filename when its missing 2014-04-29 02:55:59 +10:00
e73d0f57a3 Code cleanup: use 'const' for arrays (python) 2014-04-27 00:25:15 +10:00
90efa345c2 Python API: utility function for filling a tuple with a single value. 2014-01-06 16:46:00 +11:00
6d5024828b add local _PyLong_AsInt() needed for python older then 3.3.2 2013-10-17 09:58:36 +00:00
4dd7d4110a replace macro PYC_INTERPRETER_ACTIVE for PyC_IsInterpreterActive() function call,
(indirectly referenced Python define of ~30 lines, most were optimized out but still caused some code bloat).
2013-09-18 23:21:24 +00:00
f9f7070336 add STREQ macro (commonly used macro like CLAMP, MAX2, STRINGIFY). Use for some areas of the python api, bmesh. 2013-03-10 06:18:03 +00:00
1bf5832dfb code cleanup: warnings and use stdbool for bpy* funcs. 2013-01-07 05:26:12 +00:00
Lukas Toenne
e8b415bdb4 This patch adds support in bpy.props for getter/setter callback functions. 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.
2013-01-05 14:56:37 +00:00
9dbe85c17e expose common extensions for image/movie/audio types, since python scripts 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 ...
2013-01-04 03:47:37 +00:00
3fd388fb06 py api cleanup, replace use...
- PyLong_FromSsize_t --> PyLong_FromLong
- PyLong_AsSsize_t --> PyLong_AsLong

In all places except for those where python api expects PySsize_t (index lookups mainly).

- use PyBool_FromLong in a few areas of the BGE.
- fix incorrect assumption in the BGE that PySequence_Check() means PySequence_Fast_ functions can be used.
2012-11-21 02:28:36 +00:00
2bb174cfa4 style cleanup: indentation 2012-11-09 09:33:28 +00:00
f3ece5a108 style cleanup: trailing tabs & expand some non prefix tabs into spaces. 2012-10-21 05:46:41 +00:00
b26ccf0aff toggle cut through in the knife tool now refreshes (before you had to wave the mouse about to see the result).
also remove print from last commit.
2012-10-06 03:34:52 +00:00
6a164c7f72 fix [#32779] Bmesh module: assigning to bm.select_mode crashes Blender if bmesh is empty
was missing set typecheck
2012-10-06 03:33:11 +00:00
589ada7f0c code cleanup: correct spelling 2012-09-28 06:45:20 +00:00
3804b2d2ba fix [#31856] movieclips.load(filepath=None) or value crash Blender
workaround for python bug/inconsistency
2012-09-04 05:36:07 +00:00
c43583a23a fix for own crash caused by curve refactor, now curve tables are initialized once when the tree is initialized.
thanks to Antony Riakiotakis for providing a fix, though this works a little different.
2012-08-28 10:02:10 +00:00
4bc46b18d1 handy function for getting a python stacktrace while debugging in gdb 2012-07-19 09:55:49 +00:00
32cf7fcdb1 code cleanup: spelling 2012-07-16 23:23:33 +00:00
fc5df9d634 Reverting changes made in r48030 by Campbell's request 2012-06-18 13:46:57 +00:00
35b3736b16 Fix #31856: movieclips.load(filepath=None) or value crash Blender
Disallow running PyUnicode_EncodeFSDefault for None type which seems
to be an issue on Windows.
2012-06-18 12:34:19 +00:00
dfc19a1ff7 BGE patch #28476: Character object physics type
===============================================
This patch adds a new "Character" BGE physics type which uses Bullet's btKinematicCharacter for simulation instead of full-blown dynamics. It is appropiate for (player-controlled) characters, for which the other physics types often result unexpected results (bouncing off walls, sliding etc.) and for which simple kinematics offers much more precision.

"Character" can be chosen like any other physics type in the "Physics" section of the properties window. Current settings for tweaking are "Step Height" (to make the object automatically climb small steps if it collides with them), "Fall Speed" (the maximum speed that the object can have when falling) and "Jump Speed", which is currently not used.

See http://projects.blender.org/tracker/?func=detail&atid=127&aid=28476&group_id=9
for sample blends and a discussion on the patch: how to use it and what influences the behavior of the character object.

Known problem: there is a crash if the "compound" option is set in the physics panel of the Character object.
2012-05-28 21:36:29 +00:00
2f5173887e disable overwriting the PYTHONPATH for windows - reported as [#31506] 2012-05-19 10:10:49 +00:00
11d12d945e style cleanup: python api 2012-03-26 06:55:09 +00:00
81d8f17843 style cleanup: pep8, indentation 2012-03-24 07:36:32 +00:00
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
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
4f19c1a995 spelling cleanup 2012-03-18 07:38:51 +00:00
70d3d1aca6 style cleanup: py/capi 2012-03-16 21:39:56 +00:00
89a963fb7f style cleanup: comment blocks 2012-03-09 18:28:30 +00:00