- Use BGL buffer instead of string for image data.
- Add buffer interface to image source.
- Allow customization of pixel format.
- Add valid property to check if the image data is available.
The image property of all Image source objects will now
return a BGL 'buffer' object. Previously it was returning
a string, which was not working at all with Python 3.1.
The BGL buffer type allows sequence access to bytes and
is directly usable in BGL OpenGL wrapper functions.
The buffer is formated as a 1 dimensional array of bytes
with 4 bytes per pixel in RGBA order.
BGL buffers will also be accepted in the ImageBuff load()
and plot() functions.
It is possible to customize the pixel format by using
the VideoTexture.imageToArray(image, mode) function:
the first argument is a Image source object, the second
optional argument is a format string using the R, G, B,
A, 0 and 1 characters. For example "BGR" means that each
pixel will be 3 bytes, corresponding to the Blue, Green
and Red channel in that order. Use 0 for a fixed hex 00
value, 1 for hex FF. The default mode is "RGBA".
All Image source objects now support the buffer interface
which allows to create memoryview objects for direct access
to the image internal buffer without memory copy. The buffer
format is one dimensional array of bytes with 4 bytes per
pixel in RGBA order. The buffer is writable, which allows
custom modifications of the image data.
v = memoryview(source)
A bug in the Python 3.1 buffer API will cause a crash if
the memoryview object cannot be created. Therefore, you
must always check first that an image data is available
before creating a memoryview object. Use the new valid
attribute for that:
if source.valid:
v = memoryview(source)
...
Note: the BGL buffer object itself does not yet support
the buffer interface.
Note: the valid attribute makes sense only if you use
image source in conjunction with texture object like this:
# refresh texture but keep image data in memory
texture.refresh(False)
if texture.source.valid:
v = memoryview(texture.source)
# process image
...
# invalidate image for next texture refresh
texture.source.refresh()
Limitation: While memoryview objects exist, the image cannot be
resized. Resizing occurs with ImageViewport objects when the
viewport size is changed or with ImageFFmpeg when a new image
is reloaded for example. Any attempt to resize will cause a
runtime error. Delete the memoryview objects is you want to
resize an image source object.
* fix for audio: added missing defines for WITH_OPENAL, WITH_JACK, WITH_SDL
* fixed linking for OpenAl, was still linking OpenAl32.dll instead of wrap_oal.dll
Should now work same as other buildsystems.
Quick test showed Yay! Sound in sequencer back :)
* added renamed files in revision 25337
* renamed BLI_util.h -> BLI_path_util.h for consistency
* cleanup of #includes: removed BLI_blenlib.h in favour of direct includes of the needed headerfiles in a few places.
* removed debug print in sequencer.c
* added missing include in blenkernel/blender.c -> bad dependency, needs to be fixed still
Removed the Start/End Settings and the effect_fader from the sequencer transform strip.
The transform strip can now only be animated directly by keying the Scale X, Scale Y, Translate X, Translate Y and Rotation values.
Caveat:
The uniform scale re-uses the Scale X value, so when changing the animation on Scale X in the non-uniform scaling case, the uniform scaling will be affected too. This was done to not break files for Durian.
Note:
As much as I would have liked to clean up the TransformVars, it caused crashes of earlier versions of blender when opening the file.
The rna identifiers were also kept as to not break any existing animation on those keys.
* update for sculpt merge
NOTE: BLI_blenlib now uses functions in BL_gpu - I added the necessary include path to make it compile, but I'm not sure if this dependency shouldn't be avoided.
1. MSVC 9 projectfiles update (graph_header.c, action_header.c and nla_header.c removed)
2. Fix for opening the filebrowser when saving file for the first time (untitled.blend) from file menu
3. Add CROSS effect sequence type back to menu. (Durian fix)
Note: Removed SEQ_EFFECT from rna, since this no actual sequence type, but rather used to check for the effect bit.
Even a static mesh can be used as replacement: the mesh
will be instantiated with the soft body settings of the
object. The position and orientation of the soft body
is preserved after the replacement.
Known limitation: the velocity of the soft body is reset
aftet the replacement. This is because soft body don't
have a well defined velocity.
* Added GLEW_STATIC where necessary to make Blender compile again
* First attempt at compiling blenderplayer again - compiles, but doesn't link yet
* removed deprecated SND_ functions from blenderplayer
* the code for BLI_is_dir can be shared on Windows, no need of extra implementation - error was usage of BLI_exists instead of BLI_exist!
* left BLI_is_dir in since it's nicer to read and understand
* also removed deprecated outliner_header from MSVC projectfiles.
Appending and Linking
* Linking Operator, invokes filebrowser for Append/Link
* Separated the append/link function into three parts:
** BLO_library_append_begin finds main for appending
** BLO_library_append_named_part appends one Object,Group, Material, ...
** BLO_library_append_end actually reads and expands the libraries
NOTE 1:
I also changed the returned properties for the filebrowser operators to the following convention:
"path" - the full path to a file or directory, means what is in directory + filename buttons in filebrowser
"directory" - the content of the directory button in filebrowser
"filename" - the content of the filename button in filebrowser
Usually only path should be required, but in some cases it might be more convenient to retrieve the parts separately.
Ton, Brecht: If you have time to take a look, let me know if anything needs to be fixed.
* Split object_edit.c into multiple files:
object_add.c, object_edit.c, object_hook.c, object_relations.c,
object_select.c, object_transform.c.
* Rename files to have consistent object_ and mball_ prefix:
object_shapekey.c, object_lattice.c, object_vgroup.c, mball_edit.c.
* Added operators:
* vertex group menu and set active
* apply location, rotation, scale, visual transform (location is new)
* make local
* make vertex parent
* move to layer
* convert to curve/mesh (not finished yet)
* Many small fixes for marked issues, but still much code to be cleaned
up here...