Commit Graph

14807 Commits

Author SHA1 Message Date
Benoit Bolsee
8916f84622 VideoTexture: Add support for GLSL. FIx small printout bug in Exception printout 2008-11-05 13:22:10 +00:00
Remigiusz Fiedler
3b2a07a866 uniform end-of-line format and set svn:eol-style property to "native" for all scripts 2008-11-05 11:42:34 +00:00
Matt Ebb
633e3e1323 * Updated the 'Consolidate into one image' script to support alpha 2008-11-05 04:48:08 +00:00
Nathan Letwory
f59f5e67a5 * doing some warning cleaning
* accidently left priority tests around.
2008-11-04 23:46:01 +00:00
Nathan Letwory
beea73b110 * enable openjpeg building for win32/msvc
* add support for building redcode on win32/msvc, but disabled for now, as there are linking problems
  - I cleaned the redcode sconscript - the copying of headers within the source tree is not a clean solution
    This needs to be fixed later on. For now, lets use redcode from extern/ until a better way is found.
2008-11-04 23:04:15 +00:00
Nathan Letwory
2d80262759 === SCons ===
* BlenderLib now expects lists for all compiler related flags (release, profile, debug, warn).
  I changed the default config files, but do double-check your user-config files, esp. if you did
  a full copy of an old default platform config
2008-11-04 22:46:43 +00:00
Matt Ebb
a19366f34a * Changed the constant colorband interpolation to work left->right,
rather than right -> left. This is how it works now:

http://mke3.net/blender/etc/constant_ss.png
2008-11-04 22:16:57 +00:00
Nathan Letwory
9196723581 * remove redundant comment 2008-11-04 21:14:54 +00:00
Benoit Bolsee
1886b7bf52 VideoTexture: fix RGB/BGR confusion, make code compatible with big endian CPU, add RGBA source filter. 2008-11-04 12:04:59 +00:00
Benoit Bolsee
6eb3bf53dd VideoTexture: Bug report #17946: add (char*) casting to fix compile error with Python get-set method and module object. 2008-11-04 09:21:27 +00:00
Andre Susano Pinto
ca80578e4e Simple warning fixes 2008-11-04 01:05:44 +00:00
Matt Ebb
1f83dffeb4 Added a new interpolation type for colorbands: Constant
This can be useful for toon shading etc.

Example: http://mke3.net/blender/etc/constant_ss.png
2008-11-04 00:15:27 +00:00
Kent Mein
b7fdf2ab50 Add's GSR's INT64_C fix and removes dos line endings...
Kent
2008-11-03 23:35:41 +00:00
Andre Susano Pinto
ec462b8cea Added Lattice vgroup support to shrinkwrap and simple deform modifier. 2008-11-03 23:17:36 +00:00
Martin Poirier
6cc1466c61 Moving silence_log_ffmpeg to imbuf (it fits better there and fixes the link error in blenderplayer) 2008-11-03 13:33:11 +00:00
Ton Roosendaal
858e2ec776 Bugfix #17921
ALT+select face-loop on mesh with hidden faces ignored the hidden part.
Also caused errors on deleting faces that way.
2008-11-03 13:00:39 +00:00
Benoit Bolsee
17296efd62 VideoTexture: fix compile error with GLint in ImageViewport under osx, part 2 2008-11-02 18:41:24 +00:00
Benoit Bolsee
7d63f5a7fe VideoTexture: fix compile error with GLint in ImageViewport under osx. 2008-11-02 18:31:54 +00:00
Ton Roosendaal
db24487449 Makefile fixes for compiling with new videotexture code.
Also: buttons for logic, controllers, didn't line up correct when 
multiple objects were selected (too little space)
2008-11-02 18:12:45 +00:00
Ton Roosendaal
a775719e23 Bugfix #17942
Python dict error: when trying to access a Bone via a key, and the key
was not found, a wrong error message got printed. Fix provided by
reporter Gregor Riepl. Thanks!
2008-11-02 18:05:11 +00:00
Benoit Bolsee
2973bd8ea2 VideoTexture: use PyObjectPlus.h instead of Python.h for compatibility with Python2.3 2008-11-02 18:02:31 +00:00
Martin Poirier
f180702a12 Quiet ffmpeg log by default. No more ugly stream info in console.
Starting Blender with -d turns info logging back on.
2008-11-02 16:28:34 +00:00
Enrico Fracasso
719e30f70a Disable completely OpenAL if WITH_OPENAL is OFF 2008-11-02 15:16:17 +00:00
Enrico Fracasso
407e38a744 Added bf_videotex to unix libraries (linking error) 2008-11-02 14:54:44 +00:00
Martin Poirier
12b2f1c83c Include path for numpy no longer needed. 2008-11-02 14:36:32 +00:00
Ton Roosendaal
fdc1ef2c25 Bugfix #17902
Black dots appearing in mirroring 3d beveled curves, when using orco
texture coords. Appeared there was memory read just outside of the 
allocation.
2008-11-02 14:03:47 +00:00
Daniel Genrich
752920c531 python25.zip wasn't copied using cmake. Should fix win64 python e.g. "import random" problem 2008-11-02 12:50:11 +00:00
Ton Roosendaal
30016909c7 Bugfix #17920
When entering a wrong expression (or garbish) in a Nkey panel button,
the cursor jumps to the place where the button was clicked. On failure
the button could return a B_NOP, not a 0
2008-11-02 12:27:25 +00:00
Brecht Van Lommel
a4f8f06479 Fix for two proxy + undo related crashes:
* When making a proxy, the lib linked IPO driver was also changed to
  point to the proxy object, and after undo this local proxy object
  was replaced so the pointer became invalid. In fact it is not needed
  at all to change this because the IPO code maps the pointer to the
  local proxy object already.
* Undoing the make proxy operation would crash because the proxy_from
  pointer in the library linked object would still point to the removed
  object. Now it clears all these pointers before undo, because on each
  undo memory file read they will be set again anyway.
2008-11-02 00:25:39 +00:00
Benoit Bolsee
68f50e0c6b VideoTexture: remove numpy dependency. 2008-11-01 22:28:27 +00:00
Benoit Bolsee
e72d6c7bfa VideoTexture: fix NULL pointer crash when material name is not found. 2008-11-01 20:18:15 +00:00
Martin Poirier
b24c6ef70d Adding include path for numpy to sconscript. There must be a better way to do this. 2008-11-01 17:44:12 +00:00
Benoit Bolsee
19cdef1f71 VideoTexture: typo in linux code 2008-11-01 17:26:34 +00:00
Benoit Bolsee
e6a2ab319f VideoTexture: AVFormatContext::pb is not a pointer for avformat library older than 52 (linux uses 51) 2008-11-01 17:15:17 +00:00
Brecht Van Lommel
4870db578b Bug #17912: fix for some SSS floating point precision issues, and also
fix a divide by zero in the subsurf code found in the process.
2008-11-01 17:07:24 +00:00
Martin Poirier
58d0dc21aa Getting video texture closer to compiling under linux 2008-11-01 17:06:36 +00:00
Ton Roosendaal
0aff409d54 Bugfix #17913
Bah... fix for envmaps just before 2.48 release gave good looking envmaps 
only when there was no sky involved...

The alpha in environment maps should be reset to 255... something that was 
never done before, but also didn't show errors until other fixes in image 
rendering were done.
2008-11-01 16:09:36 +00:00
Benoit Bolsee
bd81d96b78 Video Texture: missing newlines at the end of several files. 2008-11-01 15:58:49 +00:00
Benoit Bolsee
5cb16c2d03 Video Texture: remove support for capture device, the linux ffmpeg repository is not ready yet. 2008-11-01 15:42:03 +00:00
Brecht Van Lommel
00b02f055a Patch 17909: 2D Filter texture coordinates changes, by Dalai Felinto:
* The second opengl texture coordinate (gl_TexCoord[1]) are now filled
  in as well, and will give canvas coordinates from 0.0 to 1.0. The
  first texture coordinates still give the coordinates in the texture
  that is being used, which may not match the canvas exactly, so both
  coordinates are needed.
* Also optimization to allow using smaller texture sizes with multiple
  smaller viewports.
* Print the detailed GLSL shader errors (once), for easier debugging.
2008-11-01 14:00:16 +00:00
Benoit Bolsee
54401d36aa BGE Video Texture: fix constant initializer problem with Exception description. Uniformized the line ending. 2008-11-01 12:48:46 +00:00
Remigiusz Fiedler
b590b121d3 fix a bug in matrix.invert() for 2x2 matrices
reported by Hans in http://blenderartists.org/forum/showthread.php?t=139748
2008-11-01 11:35:08 +00:00
Benoit Bolsee
48fb0edc78 Fix Cmake for MSVC 32bit 2008-11-01 11:15:13 +00:00
Brecht Van Lommel
21a0e55c50 RNA compile error and warning fixes for MSVC. 2008-11-01 00:23:08 +00:00
Brecht Van Lommel
7f24dbe5fc RNA / Data API
This is the first code for the Data API, also known as RNA system in the
2.5 Branch. It does not include a user interface, and only wraps some
Scene properties for testing. It is integrated with Scons and Makefiles,
and compiles a 'makesrna' program that generates an RNA.c file.

http://wiki.blender.org/index.php/BlenderDev/Blender2.5/DataAPI
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/RNA

The changes are quite local, basically adding a makesrna module which
works similar to the makesdna module. The one external change is in
moving genfile.c from blenloader to the makesdna module, so that it can
be reused by the RNA code. This also meant changing the DNA makefiles.
It seems to be doing dependencies correct still in my tests, but if
there is an issue with the DNA not being rebuilt this commit might be
the one causing it. Also it seems for scons the makesdna and makesrna
modules are compiling without warnings. Not a new issue but this should
be fixed.

The RNA code supports all types as defined in the Data API design, so
in that sense it is fairly complete and I hope that aspect will not
have to change much. Some obviously missing parts are context related
code, notify() functions for updates and user defined / ID properties.
2008-10-31 23:50:02 +00:00
Benoit Bolsee
a8c4eef326 VideoTexture module.
The only compilation system that works for sure is the MSVC project files. I've tried my best to
update the other compilation system but I count on the community to check and fix them.
 
This is Zdeno Miklas video texture plugin ported to trunk. 
The original plugin API is maintained (can be found here http://home.scarlet.be/~tsi46445/blender/blendVideoTex.html)
EXCEPT for the following:

The module name is changed to VideoTexture (instead of blendVideoTex).

A new (and only) video source is now available: VideoFFmpeg()
You must pass 1 to 4 arguments when you create it (you can use named arguments):

VideoFFmpeg(file) : play a video file
VideoFFmpeg(file, capture, rate, width, height) : start a live video capture

file:
In the first form, file is a video file name, relative to startup directory.
It can also be a URL, FFmpeg will happily stream a video from a network source.
In the second form, file is empty or is a hint for the format of the video capture.
In Windows, file is ignored and should be empty or not specified.
In Linux, ffmpeg supports two types of device: VideoForLinux and DV1394. 
The user specifies the type of device with the file parameter:
   [<device_type>][:<standard>]
   <device_type> : 'v4l' for VideoForLinux, 'dv1394' for DV1394; default to 'v4l'
   <standard>    : 'pal', 'secam' or 'ntsc', default to 'ntsc'
The driver name is constructed automatically from the device types:
   v4l   : /dev/video<capture>
   dv1394: /dev/dv1394/<capture>
If you have different driver name, you can specify the driver name explicitely 
instead of device type. Examples of valid file parameter:
   /dev/v4l/video0:pal
   /dev/ieee1394/1:ntsc
   dv1394:ntsc
   v4l:pal
   :secam

capture: 
Defines the index number of the capture source, starting from 0. The first capture device is always 0.
The VideoTexutre modules knows that you want to start a live video capture when you set this parameter to a number >= 0. Setting this parameter < 0 indicates a video file playback. Default value is -1.

rate: 
the capture frame rate, by default 25 frames/sec

width: 
height: 
Width and height of the video capture in pixel, default value 0.
In Windows you must specify these values and they must fit with the capture device capability. 
For example, if you have a webcam that can capture at 160x120, 320x240 or 640x480, 
you must specify one of these couple of values or the opening of the video source will fail.
In Linux, default values are provided by the VideoForLinux driver if you don't specify width and height.

Simple example
**************
1. Texture definition script:

import VideoTexture

contr = GameLogic.getCurrentController()
obj = contr.getOwner()
if not hasattr(GameLogic, 'video'):
	matID = VideoTexture.materialID(obj, 'MAVideoMat')
	GameLogic.video = VideoTexture.Texture(obj, matID)
	GameLogic.vidSrc = VideoTexture.VideoFFmpeg('trailer_400p.ogg')
	# Streaming is also possible:
	#GameLogic.vidSrc = VideoTexture.VideoFFmpeg('http://10.32.1.10/trailer_400p.ogg')
	GameLogic.vidSrc.repeat = -1
	# If the video dimensions are not a power of 2, scaling must be done before
	# sending the texture to the GPU. This is done by default with gluScaleImage()
	# but you can also use a faster, but less precise, scaling by setting scale
	# to True. Best approach is to convert the video offline and set the dimensions right.
	GameLogic.vidSrc.scale = True
	# FFmpeg always delivers the video image upside down, so flipping is enabled automatically
	#GameLogic.vidSrc.flip = True

if contr.getSensors()[0].isPositive():
	GameLogic.video.source = GameLogic.vidSrc
	GameLogic.vidSrc.play()


2. Texture refresh script:

obj = GameLogic.getCurrentController().getOwner()
if hasattr(GameLogic, 'video') != 0:
  GameLogic.video.refresh(True)

You can download this demo here: 
http://home.scarlet.be/~tsi46445/blender/VideoTextureDemo.blend
http://home.scarlet.be/~tsi46445/blender/trailer_400p.ogg
2008-10-31 22:35:52 +00:00
Benoit Bolsee
77b4c66cc3 Preparation to VideoTexture: everything but the VideoTexture module itself.
Rename PHY_GetActiveScene() to KX_GetActiveScene(): more logical name
Add KX_GetActiveEngine()

new KX_KetsjiEngine::GetClockTime(void) to return current 
render frame time: if the CPU does not keep up with the 
frame rate, up to 5 consecutive logic frames are processed 
between each render frame, so that the logic system stays 
accurate even if the graphic system is slow. For the video 
texture module, it is important to stay in sync with the
render frame: no need to update the texture for logic frame.

BL_Texture::swapTexture(): texture id manipulation
BL_Texture::getTex() : return material texture

Enable video support in ffmpeg for Linux.
2008-10-31 21:06:48 +00:00
Benoit Bolsee
8585813693 Update MSVC project files 2008-10-31 20:50:07 +00:00
Nathan Letwory
44efce4f66 * remove unreferenced var 2008-10-31 20:47:30 +00:00
Nathan Letwory
3f7535d3c3 * silence compiler about warnings for C++ files a bit more.
- from what I can see now, the larger part of warnings is now about conversions "possible loss of data" (ie. double to float, etc).
2008-10-31 20:35:14 +00:00