Commit Graph

629 Commits

Author SHA1 Message Date
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
14ab39c5e0 minor improvements
- calc normals only check flag when needed.
- keymap, dont get name unless its needed.
- keymap, avoid property lookup.
- idprop debug print, include pointer, helpful for troubleshooting.
2013-07-09 00:13:17 +00:00
418011907c remove nan copyrights from code added since blender become opensource (copy paste errors), also remove BKE_script.h 2013-07-02 10:14:59 +00:00
225c5fee6b move BLO_sys_types.h -> BLI_sys_types.h (it had nothing todo with loading)
remove MEM_sys_types.h which was a duplicate.
2013-05-28 19:35:26 +00:00
16b82845ee code cleanup: add 'const' to headers to quiet msvc warnings, also remove (char *) casts that aren't needed now we're on Python3.3 2013-03-17 18:30:31 +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
ddddb7bab1 code cleanup: favor braces when blocks have mixed brace use. 2013-03-09 03:46:30 +00:00
098e4234b1 minor change to own recent commit with transform fcurve centers and some style edits and typo corrections. 2013-02-19 02:30:02 +00:00
12ef1b63e2 fix for building blender as a python module,
changes to internal import behavior of py3.3 broke it.
2013-02-06 13:14:11 +00:00
c80db5878b some fixes for building blender as a python module again (wip, more work needed). 2013-02-06 13:07:45 +00:00
e24443b79a style cleanup 2013-01-09 03:30:15 +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
1a7638fa94 add id property clear function (matching the same python function for dicts/lists) 2013-01-02 23:10:14 +00:00
857df8065f style cleanup 2012-12-28 14:19:05 +00:00
9d0334bc74 add missing bgl and gpu api docstrings (found using docstring completeness checker) 2012-11-22 05:15:52 +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
b867f9f17e style cleanup: comments & spelling 2012-11-18 01:22:31 +00:00
2bb174cfa4 style cleanup: indentation 2012-11-09 09:33:28 +00:00
41bfb62b0f was trying to make py import follow pythons own code more but broke py32 compat. this should fix 2012-11-06 13:29:00 +00:00
92bb31c10e fix for imp.reload() with Python3.3, function was recursively calling its self. 2012-11-06 11:43:19 +00:00
004f8d78ed default to Python3.3 on Linux for SCons and CMake, warn when building with python 3.2x or older.
also remove casts to keep Python3.2 warning quiet.
2012-11-05 13:48:42 +00:00
9b948717b0 code cleanup: float <> double conversion. 2012-11-03 18:23:30 +00:00
25591e958d style cleanup: tabs & whitespace 2012-11-03 15:35:03 +00:00
1bcadda46b fix [#30910] Problems: Add Shortcut(s) for "Ctrl Tab" menu
comparing keymaps was too sloppy or too strict, now sloppy keymap comparison works by setting all the operator
properties to their default values if they are not already set, then compare this with the keymap item (ignoring values missing from either one).

... this way any non default keymap setting wont match with an operator menu item which doesnt set this operator at all (a problem sighted in this bug report).


developer notes:
- IDP_EqualsProperties_ex() function adds an argument to treat missing members of either group to act as if there is a match.
- WM_operator_properties_default() function to reset RNA values to their defaults.
- add IDP_spit(), debug only function to print out ID properties.
2012-10-31 20:29:32 +00:00
c7fbeded4c add IDP_MergeGroup(dst, src, overwrite) function,
like PyDict_Merge()
2012-10-31 19:07:25 +00:00
f3ece5a108 style cleanup: trailing tabs & expand some non prefix tabs into spaces. 2012-10-21 05:46:41 +00:00
8437980b81 optimization for PyObject -> ID-property sequence conversion, use PySequence_Fast. 2012-10-12 03:59:50 +00:00
f97dfdf227 quiet clang static checker warning by returning an error for invalid situation getting an IDProp mapping from a PyObject.
also print the path installed to when installing an addon.
2012-10-12 03:24:47 +00:00
97d4fb4161 code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +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
a9f10b6bc2 style cleanup 2012-09-08 06:40:03 +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
76bea854b6 code cleanup: replace cos(M_PI / 4) and sin(M_PI / 4) with M_SQRT1_2 define
also some minor style cleanup.
2012-07-22 18:40:50 +00:00
9c8edae7d4 fix for separate loose parts doing full depsgraph rebuild for every object split off. 2012-07-19 10:23:25 +00:00
4bc46b18d1 handy function for getting a python stacktrace while debugging in gdb 2012-07-19 09:55:49 +00:00
4408a4aeff remove unneeded externs 2012-07-19 09:23:31 +00:00
32cf7fcdb1 code cleanup: spelling 2012-07-16 23:23:33 +00:00
d8e2c475a0 Fix for [#31396] "bge.logic.LibLoad fails to import text blocks" reported by Leonard Ritter.
Blender's import function check's the Text datablocks in main for additional modules for importing. However, libloaded scenes were 1) not loading Text datablocks and 2) not letting bpy know about them. Text datablocks are now loaded if a Scene is loaded and bpy can now looking through extra Mains to find additional modules.
2012-06-21 05:41:06 +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
65b2385448 py api integration: __import__(... , level=0)
default changed to work with python3.3
2012-05-21 07:00:23 +00:00
2d2d36fe3b code cleanup:
- style - multi-line ifs move braces onto new lines.
- iterators - convert some to macros, other split up and move brace.
2012-05-20 19:49:27 +00:00
2f5173887e disable overwriting the PYTHONPATH for windows - reported as [#31506] 2012-05-19 10:10:49 +00:00
ce45c004a3 classic compile error: GLEW_STATIC needs to be define when we use opengl functions 2012-05-09 09:49:24 +00:00