Video textures game engine OSX

I am trying to create a walkthrough in the blender game engine that inovlves videos playing on planes and have recently discovered that you can’t have videos as textures in the game engine. There is a fantastic plugin written for the windows platform that works on DirectShow apparently but this is no good to me as I’m in OSX. I saw vague mention in the archives of image sequences or uncompressed AVI’s being used as textures in the game engine, but this was in exceptionally poor english and in passing so I wasn’t sure what was being said. Does anyone know of any kind of workaround for getting moving images as textures in OSX in the latest blender release game engine? Nothing fancy, just diffuse/emit maps kinda stuff. Also, video formats are not an issue. I can get it into uncompressed, DVCPRO, Mpeg4, image sequence, whatever works.

I suggest you wait a little and prepare your content, Ashsid is actualy porting the plugin from directshow to OpenCV, wich is cross-platform… (we need it on linux too :slight_smile: )


the main problem is compilation of blendVideoTex plug-in for MacOS (I have no access to any Mac comp). Currently I’m doing linux port with OpenCV (right now is OpenCV working on Win). But present version of plug-in is capable of using any Python module, that can provide individual images (tested with PIL).
If you want to use this plug-in, you should be able to compile it on Mac. You can use stripped version of plug-in sources (all TexPlayer* classes excluded, only TexImage class is needed). I have no knowledge on how to compile plug-in on Mac, but I can help you with dependecies (on Blender sources).

Hello ashid
just want to thank you for working on a cross-platform of your very useful plugin

Ashsid, while you work on the video texture plugin, isn’t it possible to also receive the graphics on the screen from the game engine and use that as an overlay? Like you want to apply some sort of glow, you could create a plane in front of the camera, get the graphics from the game engine, apply with PIL or something else a Blur and put that on the plane, make it alpha and viola you have glow. I thought that way glow worked in game engines as well getting rid of the pixelated edges as well. (forgot the technical name for it)

It would be cool and the plugin would have a 2nd function as well. :slight_smile:

realtime postprocessing will not work the way you suggest. Just because renderer isn’t able to break rendering on multiple parts and to allow run python script inbetween. As I mentioned earlier in original Texture Video Plug-in thread, I tested rendering to texture in GameBlender, but it requires plug-in to be hooked on specific points in renderer, so that to make grabbing of rendered image possible.

Aaah ok, didn’t knew that, althougt it would have been something really cool. :slight_smile: Then wait for ogre :wink:

I’m totally down to try compiling this thing myself (famous last words, right?). Would I just have to compile the plugin as a separate thing, or would I have to compile it into Blender itself? I’m pretty ignorant as far as this stuff goes; I once owned a linux computer and used compiled and installed Yafray many moons ago thanks to a ./install script but this is literally the only occasion when I’ve sucessfully compiled anything. That said, I like to live on the edge, so I’m willing to try this. I do know that when you compile things like this, you need certain libraries; tell me what libraries I would need and I’ll give it a shot.
My needs here are very modest; I need video textures to play on plane surfaces on loop and I need to get the sound into the program as well, although I think that’s already possible.
Finally, let me say that I really really appreciate the work you’re doing on this. You’re making a valuable contribution to the community and it’s very nice to have you help me work this out.

First, I have to warn you, compilation of this plugin will be a hard task. I have compiled it on WinXP only, and just now I’m trying to get it work on Linux. I have no idea on how to compile it on Mac and what problems can appear.
I can only give you suggestions and describe how it is compiled on Win:

  1. DirectShow isn’t available on Mac (I believe), so you’ll need to use OpenCV. You have to download precompiled version of OpenCV or compile it on your Mac.

  2. Download actual sources of plugin from its page. It depends on 3 components:

  • Python24 libraries - plugin is python module
  • OpenCV libraries - used to access video and camera sources
  • Blender 2.43 sources - used to hook on internal structures of GameBlender to be able to work with its materials and textures.
    You need to have these components ready before you try compile this plugin.
  1. You need to have c++ compiler on Mac, the same that was used to compile Blender (I think. it’s gcc).

  2. You need to define dependencies to compile plugin - look into file blendVideoTex.vcproj (VisualC++ project file) and there are directories that have to be included (AdditionalIncludeDirectories key) and what libraries have to be linked (AdditionalDependencies). Omit libraries and directories that are needed for DirectShow (folders with ‘Microsoft’ in their name, libraries strmiids.lib, strmbase.lib, Winmm.lib).

  3. Read instructions on how to compile Python module on Mac - it’s in Python documentation, and follow them to compile this plugin.

  4. There can appear many errors during compilation (caused by the fact that plugin isn’t written with portability in mind and that it was compiled on VC++ only). I’m prepared to help you sort out these errors as far as I will be able to.

okay, i compiled and installed OpenCV today and it seemed like it went OK, so the next step is going to be changing the dependencies. i’ll let you know how it goes; i’m also using an intel mac btw and remember reading something weird about openCV not being entirely compatible yet… who knows. i’ll keep you updated. i usually just download the precompliled blender applications; were you saying i need to build it from source to make this work?

good luck.

er… I have Xcode on my computer but it doesn’t seem to recognize the .vcproj file as anything more than text; is this a problem? Is this the only place to change these directory dependencies or can I do it in the other files in the folder too? Also- where should I look for info about compiling python plugins?

.vcproj file is project file for Visual C++, I don’t think it can be used in any other development tool. But i’s in XML format, and necessary informations can be easily ripped from it. Just look into this file and copy folder dependencies into your IDE.

On compiling Python plugins: First try to read Python manual - Distributing Python modules, it contains guide how to build Python module from sources…