Python:
* adds bpy.app.handlers which contains lists, each for an event type:
render_pre, render_post, load_pre, load_post, save_pre, save_post
* each list item needs to be a callable object which takes 1 argument (the ID).
* callbacks are cleared on file load.
Example:
def MyFunc(scene): print("Callback:", data)
bpy.app.handlers.render_post.append(MyFunc)
C:
* This patch adds a generic C callback api which is currently only used by python.
* Unlike python callbacks these are not cleared on file load.
* Windows installer not working for non-admin users and multiple users
* Addon scripts not installing next to user configuration
* Portable install not being taken into account in all places
The main problem was the windows installer was installing system scripts in
AppData next to the user configuration directory, which is not shared between
users. Now these are installed in ProgramFiles, and only addon scripts added
by the users go to AppData.
On all platforms, addon scripts were sometimes getting installed between
system scripts, because the scripts folder in the executable directory was
given precedence over the user configuration folder, that is no longer done
now. So addons now behave like user configuration, they are preserved even
if you download a newer build of the same blender version.
If you have an installation of 2.57 on windows, the addon install location
will not change until we do the version bump to 2.58, to avoid conflicts with
the existing the installed 2.57 version.
The old behavior of giving precedence to the local folder was done to support
portable install, where all configuration is written to the local folder. This
is now implemented differently: if and only if a "config" folder exists in the
local folder, portable install will be assumed, and files will only be written
to that local folder.
Nothing is changed by default but some linux distributions want to have executing python be opt-in.
This keeps the same functionality but disables auto-run from factory settings and in background mode unless its enabled as a command line argument.
This CMake option is marked as advanced and wont show in the regular options list so its less likely to be enabled by people that like to turn everything ON without reading descriptions :)
submitted by Tom Edwards
This patch introduces a switch -con and its longer version --start-console. When giving this on cmd-line you'll get the black console window. The new behaviour is to hide it by default. We'll still see briefly the console at startup and during exit, but that's something that cannot be changed.
If you start blender from a cmd.exe, the console will not be hidden.
submitted by Tom Edwards
Fix [#25473] 64bit Windows installer for version 2.56 is not working
patch submitted by Caleb (Dobz)
The thumbnail patch adds a thumb handler DLL that adds .blend thumbnail support in Windows Explorer. A -r option is added to do registration in background. The patch also improves icon building and metadata for blender.exe.
Caleb fixes and cleans up our installer to an acceptable state. The patch uses the new -r option to do the .blend extension and thumbnailer registration.
Thanks to both Caleb and Tom for their efforts!
restore, would not get their dependencies updated when they became visible.
It happend with a shrinkwrap modifier in these reports, but could happen with
other modifiers too.
Now we keep track of which layers have ever been updated since load, and tag
objects on them to be recalculated when they become visible.
- opening a file with blender by passing it as an argument would and loading it once in blender left script auto execute flag in a different state.
- command line args --enable/disable-autoexec were being overridden by the user prefs.
CMake build option WITH_PYTHON_MODULE, will build ./bin/bpy.so
This allows 'bpy' to be imported from python or other applications/IDE's which embed python, eg:
python -c "import bpy ; bpy.ops.render.render(write_still=True)"
This runs in background mode and has similar restrictions to running a script:
blender --background --python test.py
TODO:
- install to site-packages with blender scripts
- add support for imp.reload()
- 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.
- modifier code was using sizeof() without knowing the sizeof the array when clearing the modifier type array.
- use BLI_snprintf rather then sprintf where the size of the string is known.
- particle drawing code kept a reference to stack float values (not a problem at the moment but would crash if accessed later).
Added because CTest has no convenient way to set environment vars for commands it runs.
--env-system-config -> BLENDER_SYSTEM_CONFIG
--env-system-datafiles -> BLENDER_SYSTEM_DATAFILES
--env-system-scripts -> BLENDER_SYSTEM_SCRIPTS
--env-system-plugins -> BLENDER_SYSTEM_PLUGINS
--env-system-python -> BLENDER_SYSTEM_PYTHON
from Alexander Kuznetsov (alexk) with edits.
From the report:
Blender assumed that all files are .blend as retval = 0;
Now retval is initialized as file cannot be open (-1) for gzopen fail and directory case
retval = -2; is defined for not supported formats
This must be assigned before #ifdef WITH_PYTHON because this part can be missing
Finally retval = 0; if it is a .blend file
---
also made other edits.
- exotic.c's blend header checking was sloppy, didn't check data was actually read, only checked first 4 bytes and had a check for "blend.gz" extension which is unnecessary.
- use defines to help readability for BKE_read_exotic & BKE_read_file return values.
- no need to check for a NULL pointer before calling BKE_reportf(). (will just print to the console)
- print better reports when the file fails to load.
- bpy.app.driver_namespace, read-only dictionary, edit in-place.
- reset on file load and new file.
- on errors the namespace used to be reset, this should not be needed.
simple example.
def driverFunc(val):
return val * val
bpy.app.driver_namespace['driverFunc'] = driverFunc
... now all drivers can access this function.
Added extend option to lasso.
also...
- selecting bones wasn't checking their layer of if they were hidden in a number of places.
- fixed memory leak.
small unrealed changes
- added PBONE_VISIBLE macro
- renamed functions used for paint selectoin from *_tface to paintface_*. sine they no longer have anything todo with tface's.
- removed scanfill include from BLI_blenlib.h, this is only used in very few places and quite specific.
Noticed lasso select is broken for metaballs and face mask mode but this has been the case for a while, will look into it next.