Created
April 12, 2017 10:24
-
-
Save darkwave/d6e9c72a66e728b7ee8fb59555119640 to your computer and use it in GitHub Desktop.
How to acquire webcam as a texture in Blender Game Engine
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#WebCamAsTexture.blend is copyright sean bradley 2014 | |
import bge | |
cont = bge.logic.getCurrentController() | |
obj = cont.owner | |
if not hasattr(bge.logic, 'video'): | |
matID = bge.texture.materialID(obj, 'IMvideolayer.png') | |
bge.logic.video = bge.texture.Texture(obj, matID) | |
bge.logic.video.source = bge.texture.VideoFFmpeg("0", 1) | |
bge.logic.video.source.play() | |
bge.logic.video.refresh(True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment