Commit Graph

262 Commits

Author SHA1 Message Date
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
1bf5832dfb code cleanup: warnings and use stdbool for bpy* funcs. 2013-01-07 05:26:12 +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
ea2224e28d changes needed for EDL import to work again.
- add sequence.update(data=False) function.
- made some sequence vars editable.
- correct some comments.

also rename rna function sequence.getStripElem() --> strip_elem_from_frame()
2013-01-02 16:15:45 +00:00
71dbd39891 remove workaround for [#31555], forcing PYTHONIOENCODING was causing stdout to be lost on exit - no MEM_printmemlist_stats() 2012-12-28 00:54:22 +00:00
d0667c70dd fix for python button evaluation not restoring the __main__ module. 2012-12-04 19:58:13 +00:00
60cd5ee412 fix for typo when overwriting pythons stdout/stderr, also print errors if they happen here now. 2012-12-04 11:21:33 +00:00
4302cde8ff re-apply a workaround for [#31555] Username with special chars in Windows 7
this time keep the stderr/stdout so there FD's are not closed (causing [#32720]).

This workaround is ugly but saves us from using a patched python.
2012-12-03 10:01:09 +00:00
0e3de1df4b fix [#31661] Custom properties do no respect min/max values
also renamed function added prev commit
2012-10-26 10:54:02 +00:00
0e6f8e3e25 fix for crash when a python operator or render engine was freed in the C code and then referenced from python.
now further access in python gives an exception at the line when the freed data is accessed.
2012-10-26 10:33:57 +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
75fff05348 revert fix for [#31555] Username with special chars in Windows 7
this breaks and causes bug: [#32720], where sys.stdout becomes invalid and print() does nothing.

On investigation - python is not getting the environment variable from blender (aparently because its a DLL?) so this should be resolved rather then overwriting sys.stdout.
2012-10-02 13:24:28 +00:00
b04b8fd0e8 fix for crash found when attempting to setup testing environment to find crashes :)
scripts that have `Register` enabled and load another blend file would crash blender.
2012-10-01 14:14:21 +00:00
552cd4b7e7 fix for crash executing a python script.
nice obscure case, when a script executes, frees its self (by loading a file for eg), then has a python error.

... in this case blender would fetch the python exception and attempt to move the cursor in the freed textblock to the error line, crashing blender.
2012-09-23 06:25:39 +00:00
537c3375b5 fix for crash getting a member from the operator context override, in some cases python didnt hold the GIL. 2012-09-21 22:31:02 +00:00
cf5da37e3c fix for a bug running a script, then opening a new file.
BPY_text_free_code() could run outside the python interpreter which abort()'s blender.
2012-09-10 23:32:46 +00:00
e2eea6c38d fix/workaround [#31555] Username with special chars in Windows 7
Theres a bug where python/windows ignores PYTHONIOENCODING, workaround this by manually overriding the stdout/stderr.
2012-09-05 09:33:15 +00:00
0a35e050f3 code cleanup: remove redundant calls to CTX_data_main() 2012-08-05 14:11:51 +00:00
cfb7aee017 style cleanup 2012-07-07 22:51:57 +00:00
2f60d9b0b9 fix for un-handled exception when entering in multiple values to a button, floats were not correctly checked for. 2012-06-09 16:45:42 +00:00
ed7dbbdfe9 fix for buffer overrun on windows by kjym3 on IRC. 2012-06-07 09:05:51 +00:00
352cd241a3 fix [#31597] Operator Preset: Python Warning whenever a preset is executed (seen on Windows) 2012-05-25 14:08:50 +00:00
dab1d8e487 style cleanup 2012-05-22 22:03:41 +00:00
af3e348430 code cleanup: use TRUE/FALSE rather then 1/0 for better readability, also replace do prefix with do_ for bool vars. 2012-05-19 13:28:19 +00:00
181f3670c9 patch [#31507] site not automatically imported when using external python package
made some modificatons to normal python startup also.
2012-05-18 10:19:49 +00:00
d9ce1cda94 Python/context: python could get invalid bpy.data in scene update handler after
undo.

The way this got updated from the context is a bit unreliable, and for handlers
the update couldn't happen because there is no context passed in. Now it's
updated from setup_app_data, which is where the change actually happens. I left
in the other updates to be sure but they should not be needed anymore.
2012-05-08 22:07:06 +00:00
5c89138684 style cleanup: comments 2012-04-22 11:54:53 +00:00
6701933f5c style cleanup 2012-04-21 12:51:47 +00:00
6520aa97a9 add 'idprop' module so we can document idprop.types.*, currently doc generator has no access to ID Property types. 2012-04-15 14:54:15 +00:00
440f449265 Fix #30858: UI losing buttons at some random moment after using Blender for a
while. This may not fix all cases but should at least solve the issue when
rendering with cycles.

The cause was a race condition on C->data.recursion, with multiple threads
accessing context at the same time. Cycles itself does not access context
from the render thread, but the bpy api would do a context update for any
callback in case e.g. a new file got loaded. Disabled that now in non-main
threads.

The ideal solution would be to not allow any context access at all from threads
but that's not so simple to implement, especially not this close to release.
2012-04-13 16:03:52 +00:00
5b88712ff9 move debug flag into its own global var (G.debug), split up debug options.
--debug
  --debug-ffmpeg
  --debug-python
  --debug-events
  --debug-wm

This makes debug output easier to read - event debug prints would flood output too much before.

For convenience:
  --debug-all turns all debug flags on (works as --debug did before).

also removed some redundant whitespace in debug prints and prefix some prints with __func__ to give some context.
2012-03-31 00:59:17 +00:00
abf551b1a5 style cleanup: py api 2012-03-26 20:41:54 +00:00
f11a6d3a84 Adds support for utf paths on Windows.
Not all file formats/calls are supported yet. It will be expended.

Please from now on use BLI_fopen, BLI_* for file manipulations.
For non-windows systems BLI_fopen just calls fopen.
For Windows, the utf-8 string is translated to utf-16 string in order to call UTF version of the function.
2012-03-20 02:17:37 +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
4f7bdc59d3 style cleanup: spelling.
also remove large, duplicate comments from sunsky.h
2012-03-09 00:41:09 +00:00
3590076193 style cleanup - comment formatting 2012-03-03 20:36:09 +00:00
b9b0c3dfb4 bmesh python api - add/improve rst docstrings. 2012-02-24 04:59:13 +00:00
e0a6d273d0 bmesh py api - generalize bmesg sequences to use the iterator type and optionally another bmesh element.
This allows BMFace.verts to be added without defining a new sequence type.
2012-02-22 10:41:07 +00:00
e7d98179ea initial bmesh python api.
corrently allows to create and loop over verts/edges/faces, access selection and selection modes.

this is still WIP, access to face, edge verts is still missing, no access to UV's, no access to editing operations yet.

When the api is ready it will be documented by sphinx like mathutils, blf, aud.
2012-02-22 09:19:53 +00:00
af6f753400 fix for segfault with bpy compiled as python module (dont register atexit)
update `make lite` built target to remove some newly added features.
2012-01-17 15:19:11 +00:00
d7932ceea8 Cycles: multi GPU rendering support.
The rendering device is now set in User Preferences > System, where you can
choose between OpenCL/CUDA and devices. Per scene you can then still choose
to use CPU or GPU rendering.

Load balancing still needs to be improved, now it just splits the entire
render in two, that will be done in a separate commit.
2012-01-09 16:58:01 +00:00
e17fd46c71 formatting edits only to use more consisted style 2011-12-26 12:26:11 +00:00
33bd38ebc7 minor edits to cycles c/python module
- rename 'bcycles' --> '_cycles', since this is the python convention when a py module uses a C module internally.
- use macros for returning None
- make with_osl an attribute rather then a function.
- changes methods METH_VARARGS --> METH_O when single args are used.
2011-12-24 02:47:13 +00:00
f95d7c9e66 patch [#29421] Python Noise Module Updates
from Andrew Hale (trumanblending)

Tracker description
*******************

The current python noise module included with Blender has yet to be updated to the new Py API. This patch does so, with the following major points:

- The noise module has now been moved to a submodule of mathutils, it can be accessed by mathutils.noise. It was moved from it's own module as it will now return mathutils types and also have greater visibility to the user.
- All functions which return vectors will now return mathutils.Vector types to be consistent with the rest of the API. Previously (x, y, z) tuples were returned.
- A different implementation of random_unit_vector is now used, this allows 2D, 3D and 4D vectors to be returned. Previously only 3D was possible.
- Some function names have been changed to remove ambiguities and make naming consistent within the module. noise.vector is now noise.noise_vector and noise.vl_vector is now noise.variable_lacunarity
- Doc strings have been updated to be compatible with auto docs.
- Code style and internal naming has been changed to match the conventions in other mathutils code.

Thanks,
Andrew
2011-11-29 10:28:52 +00:00
d52a811052 minor bpy api edits
- strict check for rna properties
- formatting edits (120 line width)
- use PyDoc_STRVAR macros for getset docstrings
2011-11-26 15:18:30 +00:00
6736576f6d replace FILE_MAXDIR + FILE_MAXFILE with FILE_MAX 2011-11-26 04:07:38 +00:00
dca15b215d Cycles: svn merge -r41613:41627 ^/trunk/blender 2011-11-07 17:13:32 +00:00
5ef9039b7e Cycles: svn merge -r41531:41613 ^/trunk/blender 2011-11-07 15:23:08 +00:00
2b939904ab documentation - brief descriptions for bpy api files. 2011-11-05 08:21:12 +00:00