Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

Blender Game Engine Tutorial Realtime Video [2.6]

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
1,370
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Nov 26, 2011

Script:


######################################################
#
# Movie.py Blender 2.6
#
# Tutorial for using Video.py can be found at
#
# www.tutorialsforblender3d.com
#
# Released under the Creative Commons Attribution 3.0 Unported License.
#
# If you use this code, please include this information header.
#
######################################################

#import bge
import bge

# get the current controller
controller = bge.logic.getCurrentController()

# get object script is attached to
obj = controller.owner

# check to see variable Video has been created
if "Video" in obj:

# get video
video = obj["Video"]

# update the video
video.refresh(True)




# if variable Video hasn't been created
else:

# get current scene
scene = bge.logic.getCurrentScene()

# get matID for the movie screen
matID = bge.texture.materialID(obj, "MA" + obj['material'])

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

# get the name of the movie
movieName = obj['movie']

# get movie path
movie = bge.logic.expandPath('//' + movieName)

# get movie
video.source = bge.texture.VideoFFmpeg(movie)

# set scaling
video.source.scale = True # save mirror as an object variable
obj["Video"] = video

# check for optional loop property
if "loop" in obj: # loop it forever
if obj['loop'] == True:
video.source.repeat = -1 # no looping
else:
video.source.repeat = 0

# start the video
video.source.play()

  • likes, 1 dislikes

Link to this comment:

Share to:

Uploader Comments (BlenderDesigns)

  • darf ich das script benutzen? oder ist das nciht von dir? mache nämlich bei einem spiele projekt mit nennt sich capra studios... dafür wäre es gut zu verwenden. daher wollte ich das halt sehr gerne wissen.

  • @Proelium1995 Das Script habe ich nicht geschrieben aber es steht unter der "Creative Commons Attribution 3.0 Unported" - Lizens. Ich glaube wenn ihr das ©.... drin behaltet dürft ihr es nehmen

  • @BlenderDesigns glauben heißt nciht wissen und wissen heißt nciht glauben sagte eins ein weißer alter man...wer das auhc immer war.... kann ich das nciht ohne script drauffügen irgednwie? vllt. ab 2.61 wenn man das auch einfach so in default machen kann. Trotzdem danke für deine äußerst shcnelle antwort.

  • @Proelium1995 Sag wenn du ne Lösung ohne Script findest :-)

see all

All Comments (9)

Sign In or Sign Up now to post a comment!
  • @tyron089 sry, dass ich jetzt erst antworte :( Ja es geht natürlich. Du kannst das Video in eine Scene tuten wo nur die scene ist und wenn einen bestimmten punkt erreicht wird (z.b. Property = 0) dann add einfach einen Scene Actuator mit set scene und dort wird dann automatisch das video abgespielt

  • @BlenderDesigns Eine zwischensequenze die mitten im Spiel kommt wenn man einen bestimmten Punkt erreicht, erscheint ein kleines Filmchen die das Spiel etwas Spannender gestalltet. Geht so etwas?

  • @tyron089 was ist eine Cutscene?

  • kann man auch auf dieser Weiße Cutscenes erstellen?

  • danke

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more