Exemplo n.º 1
0
def init_video(video_obj, blank_obj):
    matID = VT.materialID(video_obj, 'MAvideo')

    G.video = VT.Texture(video_obj, matID)

    url = G.expandPath("//media/trailer_400p.ogg")
    video_source = VT.VideoFFmpeg(url)
    video_source.repeat = -1
    video_source.scale = True
    video_source.flip = True

    G.video.source = video_source

    G.video_screen = video_obj
    G.video_blank = blank_obj

    G.video_screen.visible = False
def main():
    cont = bge.logic.getCurrentController()
    obj = cont.owner
    novideo = cont.actuators["novideo"]
    try:
        import VideoTexture
        print('Playing video. Enjoy!')
    except:
        cont.activate(novideo)
        print('Video failed to play. :(')

    #if not hasattr(bge.logic, 'video'):
    matID = VideoTexture.materialID(obj, 'IMplaceholder.jpg')
    bge.logic.video = VideoTexture.Texture(obj, matID)
    movie = bge.logic.expandPath("//../textures/videos/team_aurora_intro.ogg")
    bge.logic.video.source = VideoTexture.VideoFFmpeg(movie)
    #bge.logic.video.source.scale = True

    bge.logic.video.source.play()
    print(movie)
Exemplo n.º 3
0
import VideoTexture
from bge import logic as GameLogic
contr = GameLogic.getCurrentController()
obj = contr.owner

# -- Check if the "video" property has been defined in the object
if 'video' not in obj:
    #-- Get the material that is using our texture
    #matID = VideoTexture.materialID(obj, 'MAa_video2014-02-20-17-41-16-163')
    # -- Create the video texture
    # GameLogic.video = VideoTexture.Texture(obj, matID)
    # Suppose 1st material is the video one
    obj['video'] = VideoTexture.Texture(obj, 0)

    # -- Get the path to the video file from the 'video_path' object property
    movie = GameLogic.expandPath(obj['video_path'])

    # -- Load the file
    obj['video'].source = VideoTexture.VideoFFmpeg(movie)

    # play video in loop
    obj['video'].source.repeat = -1

    # -- play the video
    obj['video'].source.play()
Exemplo n.º 4
0
obj = controller.owner
# check to see video has been added
if "Video" in obj:  #
    # get video
    video = obj["Video"]

    # update the video
    video.refresh(True)

# if video hasn't been added
else:  #
    # get matID for the movie screen
    matID = VideoTexture.materialID(obj, "MA" + obj['material'])

    # get the texture
    video = VideoTexture.Texture(obj, matID)

    movieName = obj['movie']

    # get movie path
    movie = GameLogic.expandPath('c:/Movie/' + movieName)

    # get movie
    video.source = VideoTexture.VideoFFmpeg(movie)

    # set scaling
    video.source.scale = True

    # save mirror as an object variable
    obj["Video"] = video
Exemplo n.º 5
0
    # update the texture
    obj["RenderToTexture"].refresh(True)

# if RenderToTexture hasn't been added
else:

    # import VideoTexture module
    import VideoTexture

    # get a list of objects in the scene
    objList = scene.objects

    # get camera name being used for render to texture
    camName = obj['cam']

    # get camera object
    cam = objList[camName]

    # get the texture material ID
    matID = VideoTexture.materialID(obj, "MA" + obj['material'])

    # set the texture
    renderToTexture = VideoTexture.Texture(obj, matID)

    # get the texture image
    renderToTexture.source = VideoTexture.ImageRender(scene, cam)

    # save RenderToTexture as an object variable
    obj["RenderToTexture"] = renderToTexture