Commit Graph

272 Commits

Author SHA1 Message Date
fa51f02be3 minor changes to the script auto-execution based on Brecht's suggestions. 2013-06-12 00:10:56 +00:00
31e74d00c1 fix [#35691] Context Override replaces instead of overrides 2013-06-10 12:17:36 +00:00
412c043474 Python script auto-execution changes:
- script execution is off by default

- if a blend file attempts to execute a script
  this shows a message in the header with the action
  that was suppressed (script/driver/game-autostart) and 2 buttons to either reload the file trusted, or to ignore the message.

- the file selector will always default to use the trust setting in the user preferences,
  but reloading an open file will keep using the current setting (whatever was set before or set on the command-line).

- added SCons setting WITH_BF_PYTHON_SECURITY, this sets the default state for the user prefereces not to trust blend files on load.
  ... this option was in CMake before, but always off, now its enabled by default for SCons and CMake, and forced on in CMake for now.
2013-06-10 00:42:16 +00:00
e7a487d1e9 code cleanup: group python reset functions in BPY_python_reset() 2013-06-09 23:31:53 +00:00
03905043c6 minor changes to get numpy working with locally bundled python.
- enable site-packages for bundled python distrobution, py3.2 had a problem where it would try to parse headers we didnt include, but its resolved now.
- workaround for glitch I was having on arch-linux where lib64 would be be used for the bundled python directory when it was just a symlink.
2013-04-23 13:51:20 +00:00
660be3da39 use gcc warning -Wredundant-decls, exposes some odd/duplicate declarations which have been removed. 2013-03-11 20:27:38 +00:00
013a176c52 patch [#34103] use booleans for extensions testing.
bli_testextensie.patch - from Lawrence D'Oliveiro (ldo)
2013-03-04 18:36:37 +00:00
7f1ae2497b fix [#34275] Text autocomplete cuts words with accents or special characters
autocomplete is now unicode aware, using python api's checks for now. eventually we should have our own.
2013-02-19 16:13:41 +00:00
8d47c2a208 fix for regression in bpy-api, python context passed to operators couldn't override collections. 2013-02-07 04:04:12 +00:00
296444e1dc style cleanup: some warnigs & spelling. 2013-02-06 14:02:19 +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
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