Bug - VideoTexture module broken in recent versions?

Hey, I was wondering if it’s just how I’m doing things / my local system configuration, or if it’s something that can be confirmed. I just updated my Blender to the most recent version today or yesterday or so, but found that Moguri’s BGUI module no longer worked. Investigating a bit, it seems that the bge.texture module’s ImageFFmpeg() function to load an image via Python no longer actually returns an image - it just returns None.

Is it just me / my computer, or can others confirm? I’m running a very recent build of Blender from the Buildbot from the 14th of April, 2014, Windows 32-bit.

EDIT: The script I’m using to test this is just:



from bge import logic, texture


tex = texture.ImageFFmpeg("C:/blahblahblahblah/image.png")


print(tex.image) # Returns None, instead of an array of numbers representing the image, I believe


EDIT: Tested it in a build of my own, and I think the issue’s still there. It’s not there in Blender 2.69, though, which confirms that there was some sort of difference between that version and the current one that broke Python-based texture loading.

Try loading a tga image and see if you have the same problem - I cannot load png images with my builds

Sent from my Nexus 5 using Tapatalk

I’ve found that the VideoTexure module is not that great for loading images. Its error messages give no indication why an image failed to load. In the past, I’ve had images fail to load if they were too small, which was rather strange. I’d actually like to see the VideoTexture module go with the features better integrated into the BGE; that module always felt like a hack to me.

As for your specific problem, I think there is a related issue in the BGE tracker.

Hm, I see. Do you perhaps plan to move BGUI to another image loading Python module? Maybe the texture module could be re-created with better documentation this time around, perhaps for a GSoC (though the next GSoC Projects have already been decided upon)?

EDIT: @Agoose - Thanks for the suggestion, I’ll check.

Currently I’ve found several issues with the VideoTexture module:

  • PNG files sometimes fail to load.
  • Textures don’t work on objects that are subclasses of KX_GameObject. It has to do with the checking of the type of object in the Texture class and BlendType class.
  • The Texture refresh code can take up a lot of logic time depending on the resolution of the source -> this can be threaded as my tests show.

@Moguri
I’m working on refactoring the VideoTexture and I’d appreciate it if you can give me some guidelines so the patch can be readily accepted.

I never got around to mentioning this; might it be best to start from first principles? I personally dislike the VideoTexture source code style, and it seems to do a lot of bizarre things. This might be the best time to readdress the situation