1) glCopyTexImage2D - www.opengl.org/sdk/docs/man/xhtml/glCopyTexImage2D.xml
2) dome post_draw. Now dome mode can also use scene.post_draw. It only runs for the last scene. It's really useful. I'm working on a nice showcase for this (a dome visualizer for the dome mode running with bgl. In the mean time this is a (lame) example of both working together (the buffer is being copied and draw on top of the window):
http://blenderecia.orgfree.com/blender/tmp/dome_bgl_copytex2d.jpg
of course it wasn't only a matter of adding the properties in the api :)
The code of validValueForIntervalProperty and modeChange are the same BUT in the future they shouldn't be, for I think it's fine to keep them as separated functions.
Bonus fix: Also we are now checking if the new mode is interval and update the range expression.
Now if you have a VideoTexture.Texture you can use its id and draw it with bgl
The Id is only going to be valid if the obj you are getting the VideoTexture.Texture from has a valid texture. In the examples you will see them as planes, that become invisible at load time, but are needed to validate the texture id.
This is a simple example file:
http://blenderecia.orgfree.com/blender/bind_id_simple.blend
And a (much) more advanced one:
http://blenderecia.orgfree.com/blender/bind_id.blend
(get also this image and save it to the same folder of your blend file - http://blenderecia.orgfree.com/blender/mask.png )
Benoit, I couldn't decide on better names so for now I'm glad with this one.
* 'Export Keying Set' operator works again - a change in the previous commit broke the created code
* Relative Keying Sets don't get their paths shown
* Keying Set paths show options for inserting keyframes too now
---
Another attempt at fixing compile troubles, and removed some commented out + obsolete stuff.
unrelated changes that ended up being more trouble to commit separate...
- removed BLI_split_dirfile(), was nasty, occasionaly modifying the source string, it could create directories and used the $CWD in some cases. was only used in 2 places in filesel.c, if this gives problems can address without bringing back this function.
renamed BLI_split_dirfile_basic --> BLI_split_dirfile
- view3d_operator_needs_opengl was being called for offscreen render when it wasnt needed.
* gameplayer is now probably not going to build without PNG turned ON.
To fix that it would be necessary to use #ifndef NOPNG around the GPC_Canvas::MakeScreenShot.
Since I don't this function it's working in 2.5 yet it's better to wait for that before doing it.
Originally we had 2DFilters (m_filtermanager) stored in RenderTools. That way filters were stored globally and were being called once per each scene. This was producing two big problems: (1) performance and (2) flexibility of use.
(1) Performance - To run the filters 2X == 2X slower
(2) flexibility of use - Very often we want the filter in the scene but not in the UI for example.
For those reasons I believe that 2DFilters with multiple scenes was very useless or unpredictable. I hope they work fine now.
To make it work as before (2.4) you can simply recreate the 2dfilter actuators across the scenes.
* * * * *
Imagine that we have:
(a) Main Scene
(b) Overlay Scene
in Main Scene the Z Buffer and RGB will be from the main scene.
in Overlay Scene the Z Buffer will be from the Overlay Scene and the RBG buffer is from both [(a + 2D Filter) + b].
So in pseudo code if we have a,b,c,d,e scenes we have: (2DFilterE(2DFilterD(2DFilterC(2DFilterB(2DFilterA(a) + b) + c) + d) + e)
ImageBuff([width,height[,color[,scale]]])
width, height: size of buffer in pixel.
default: buffer not allocated.
color: initial value of RGB channels. Alpha channel is 255.
Possible values: 0(black=default) -> 255 (white)
scale: True or False to enable or disable fast scaling
default: False
This constructors eliminates the need to use the load function
when you just want to initialize the image buffer to black or white.
I forgot to say in the last commit that those arguments are only for the BlenderPlayer.
we can now set external warpdata files.
2Do:
(1) convert relative to absolute paths for warpdata files
(2) investigate weird bug on lack of light in blenderplayer with warpmesh
... [old 2Do]
(3) documentation
(4) preserve scene settings (at least scene->gm.dome) even if you load a new file inside the game (e.g. Yo Frankie loading new levels)
2Do:
(1) open external warpdata file
(2) documentation
(3) preserve scene settings (at least scene->gm.dome) even if you load a new file inside the game (e.g. Yo Frankie loading new levels)
otherwise it's a nightmare to update all your files every time you change your projection system. See note.
Maybe SYS_WriteCommandLineInt/Float/String can be used for that. Gotta investigate further.
* Note: an external warpdata file is a must ! Currently every time you need to calibrate your system you have to update the warp file in all your demo files. This is terrible. I'm glad I *now* have a dome near by to test it ;)
* FYI: A recent 'Yo Frankie in a dome' video if you want to see how it works: http://www.vimeo.com/9629626 I'm going to record a better one tomorrow.
- 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.
... what lead me to wonder if we should remove obj.setAngularVelocity, obj.setLinearVelocity, obj.getLinearVelocity and obj.getAngularVelocity.
* this was so Copy and Paste ... anyways tests are welcome (I never used those methods in python myself).
- recode of the whole sequencer audio handling
- encode audio flag removed, instead you choose None as audio codec, added None for video codec too
- ffmpeg formats/codecs: enabled: theora, ogg, vorbis; added: matroska, flac (not working, who can fix?), mp3, wav
- sequencer wave drawing
- volume animation (now also working when mixing down to a file!)
- made sequencer strip position and length values unanimatable
Add optional parameter to VideoTexture.Texture refresh() method
to specify timestamp (in seconds from start of movie) of the frame
to be loaded. This value is passed down to image source and for
VideoFFmpeg source, it is used instead of current time to load
the frame from the video file.
When combined with an audio actuator, it can be used to synchronize
the sound and the image: specify the same video file in the sound
actuator and use the KX_SoundActuator time attribute as timestamp
to refresh: the frame corresponding to the sound will be loaded:
GameLogic.video.refresh(True, soundAct.time)
act.time can set the sound position (float in seconds)
act.is3D RO gives you the dimension of the audio
act.minGain3D, maxGain3D ... set the 3D parameters of the sound
** PyDoc to be done. Jörg Müller (NeXyon) do you want to document them? The file is here:
//source/gameengine/PyDoc/GameTypes.py
+ adding a missing \n to KX_Scene.cpp. (kind of typo)
A btBvhTriangleMeshShape object is created when converting
a mesh to physics, also in case of Soft body although the
soft body will not use it (it only uses the mesh interface).
This patch keeps this system for compatibility with the
KX converter but avoids the creation of the BVH structure,
which consumes a lots of CPU. This should speed up
significantly the conversion of large mesh to softbody.
A secondary optimization is that the sharing of shapeInfo
is extended to rigid body using gImpact. Before it was
only active between static body and soft body.
The problem was: the Blender default camera has DOF distance as 0.0. Since we are using this as Focal Length for the stereo calculation we had terrible stereo by default.
Fix: whenever DOF == 0.0 we use focal length as eye separation * 30.0 (known to be a reasonable value)