Runtime error ...
Fou Furieux du Clan
Inscrit:
31/03/2011 14:58
Post(s): 273
Bonjour à tous, je viens de finir la création d'un mini jeu 2.5D fait sous blender. Je vais donc le mettre au format .exe, seulement quand je lance le .exe, un message s'affiche en me disant "Runtime Error" ... C'est vraiment relou ... Je suis sous windows vista 32bits.

Contribution le : 23/11/2011 15:45
Créer un fichier PDF de la contribution Imprimer


Re: Runtime error ...
OverdOzed
Inscrit:
19/01/2008 03:25
De tu voit le nuage sur la carte météo bin j'habite là
Post(s): 2554
il nous faut la suite du message pour t'aider

Contribution le : 24/11/2011 14:48
Créer un fichier PDF de la contribution Imprimer


Re: Runtime error ...
Fou Furieux du Clan
Inscrit:
31/03/2011 14:58
Post(s): 273
Bah Comment faire pour que ce message ne s'affiche plus . Mais j'ai finalement reussi à le résoudre avec l'aide de mon ami Ximun. Il suffisait de faire remonter tout tou les fichier dans le dossier 2.60. Mais maintenant j'ai un autre problème ... quand je lance le .exe, les objets ou des couleurs bizzares, d'autre ne sont pas smooth ... Je voudrai savoir comment faire pour qu'ils retrouvent leur couleur d'origine ??

Contribution le : 24/11/2011 18:41
Créer un fichier PDF de la contribution Imprimer


Re: Runtime error ...
OverdOzed
Inscrit:
17/01/2012 05:04
Post(s): 312
J'ai eu le même soucis essaie de remplacer le script game_engine_save_as_runtime par

# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####

bl_info = {
'name': 'Save As Game Engine Runtime',
'author': 'Mitchell Stokes (Moguri)',
'version': (0, 3, 1),
"blender": (2, 6, 1),
"api": 42107,
'location': 'File > Export',
'description': 'Bundle a .blend file with the Blenderplayer',
'warning': '',
'wiki_url': 'http://wiki.blender.org/index.php/Extensions:2.5/Py/'\
'Scripts/Game_Engine/Save_As_Runtime',
'tracker_url': 'https://projects.blender.org/tracker/index.php?'\
'func=detail&aid=23564',
'category': 'Game Engine'}

import bpy
import os
import sys
import shutil
import tempfile


def CopyPythonLibs(dst, overwrite_lib, report=print):
import platform

# use python module to find pytohn's libpath
src = os.path.dirname(platform.__file__)

# dst points to lib/, but src points to current python's library path, eg:
# '/usr/lib/python3.2' vs '/usr/lib'
# append python's library dir name to destination, so only python's
# libraries would be copied
if os.name == 'posix':
dst = os.path.join(dst, os.path.basename(src))

if os.path.exists(src):
write = False
if os.path.exists(dst):
if overwrite_lib:
shutil.rmtree(dst)
write = True
else:
write = True
if write:
shutil.copytree(src, dst, ignore=lambda dir, contents: [i for i in contents if i == '__pycache__'])
else:
report({'WARNING'}, "Python not found in %r, skipping pythn copy" % src)


def WriteAppleRuntime(player_path, output_path, copy_python, overwrite_lib):
# Enforce the extension
if not output_path.endswith('.app'):
output_path += '.app'

# Use the system's cp command to preserve some meta-data
os.system('cp -R "%s" "%s"' % (player_path, output_path))

bpy.ops.wm.save_as_mainfile(filepath=os.path.join(output_path, "Contents/Resources/game.blend"),
relative_remap=False,
compress=False,
copy=True,
)

# Python doesn't need to be copied for OS X since it's already inside blenderplayer.app


def WriteRuntime(player_path, output_path, copy_python, overwrite_lib, copy_dlls, report=print):
import struct

# Check the paths
if not os.path.isfile(player_path) and not(os.path.exists(player_path) and player_path.endswith('.app')):
report({'ERROR'}, "The player could not be found! Runtime not saved")
return

# Check if we're bundling a .app
if player_path.endswith('.app'):
WriteAppleRuntime(player_path, output_path, copy_python, overwrite_lib)
return

# Enforce "exe" extension on Windows
if player_path.endswith('.exe') and not output_path.endswith('.exe'):
output_path += '.exe'

# Get the player's binary and the offset for the blend
file = open(player_path, 'rb')
player_d = file.read()
offset = file.tell()
file.close()

# Create a tmp blend file (Blenderplayer doesn't like compressed blends)
tempdir = tempfile.mkdtemp()
blend_path = os.path.join(tempdir, bpy.path.clean_name(output_path))
bpy.ops.wm.save_as_mainfile(filepath=blend_path,
relative_remap=False,
compress=False,
copy=True,
)
blend_path += '.blend'

# Get the blend data
blend_file = open(blend_path, 'rb')
blend_d = blend_file.read()
blend_file.close()

# Get rid of the tmp blend, we're done with it
os.remove(blend_path)
os.rmdir(tempdir)

# Create a new file for the bundled runtime
output = open(output_path, 'wb')

# Write the player and blend data to the new runtime
print("Writing runtime...", end=" ")
output.write(player_d)
output.write(blend_d)

# Store the offset (an int is 4 bytes, so we split it up into 4 bytes and save it)
output.write(struct.pack('B', (offset>>24)&0xFF))
output.write(struct.pack('B', (offset>>16)&0xFF))
output.write(struct.pack('B', (offset>>8)&0xFF))
output.write(struct.pack('B', (offset>>0)&0xFF))

# Stuff for the runtime
output.write(b'BRUNTIME')
output.close()

print("done")

# Make the runtime executable on Linux
if os.name == 'posix':
os.chmod(output_path, 0o755)

# Copy bundled Python
blender_dir = os.path.dirname(bpy.app.binary_path)
runtime_dir = os.path.dirname(output_path)

if copy_python:
print("Copying Python files...", end=" ")
py_folder = os.path.join(bpy.app.version_string.split()[0], "python", "lib")
dst = os.path.join(runtime_dir, py_folder)
CopyPythonLibs(dst, overwrite_lib, report)
print("done")

# And DLLs
if copy_dlls:
print("Copying DLLs...", end=" ")
for file in [i for i in os.listdir(blender_dir) if i.lower().endswith('.dll')]:
src = os.path.join(blender_dir, file)
dst = os.path.join(runtime_dir, file)
shutil.copy2(src, dst)

print("done")

from bpy.props import *


class SaveAsRuntime(bpy.types.Operator):
bl_idname = "wm.save_as_runtime"
bl_label = "Save As Game Engine Runtime"
bl_options = {'REGISTER'}

if sys.platform == 'darwin':
# XXX, this line looks suspicious, could be done better?
blender_bin_dir = '/' + os.path.join(*bpy.app.binary_path.split('/')[0:-4])
ext = '.app'
else:
blender_bin_path = bpy.app.binary_path
blender_bin_dir = os.path.dirname(blender_bin_path)
ext = os.path.splitext(blender_bin_path)[-1].lower()

default_player_path = os.path.join(blender_bin_dir, 'blenderplayer' + ext)
player_path = StringProperty(
name="Player Path",
description="The path to the player to use",
default=default_player_path,
subtype='FILE_PATH',
)
filepath = StringProperty(
subtype='FILE_PATH',
)
copy_python = BoolProperty(
name="Copy Python",
description="Copy bundle Python with the runtime",
default=True,
)
overwrite_lib = BoolProperty(
name="Overwrite 'lib' folder",
description="Overwrites the lib folder (if one exists) with the bundled Python lib folder",
default=False,
)

# Only Windows has dlls to copy
if ext == '.exe':
copy_dlls = BoolProperty(
name="Copy DLLs",
description="Copy all needed DLLs with the runtime",
default=True,
)
else:
copy_dlls = False

def execute(self, context):
import time
start_time = time.clock()
print("Saving runtime to %r" % self.filepath)
WriteRuntime(self.player_path,
self.filepath,
self.copy_python,
self.overwrite_lib,
self.copy_dlls,
self.report,
)
print("Finished in %.4fs" % (time.clock()-start_time))
return {'FINISHED'}

def invoke(self, context, event):
if not self.filepath:
ext = '.app' if sys.platform == 'darwin' else os.path.splitext(bpy.app.binary_path)[-1]
self.filepath = bpy.path.ensure_ext(bpy.data.filepath, ext)

wm = context.window_manager
wm.fileselect_add(self)
return {'RUNNING_MODAL'}


def menu_func(self, context):
self.layout.operator(SaveAsRuntime.bl_idname)


def register():
bpy.utils.register_module(__name__)

bpy.types.INFO_MT_file_export.append(menu_func)


def unregister():
bpy.utils.unregister_module(__name__)

bpy.types.INFO_MT_file_export.remove(menu_func)


if __name__ == "__main__":
register()

Contribution le : 17/01/2012 07:00
_________________
The First Day
Créer un fichier PDF de la contribution Imprimer



 Haut   Précédent   Suivant




Enregistrer votre réponse
Compte*
Nom   Mot de passe   Authentification
Message:*



[Recherche avancée]



Sujets récemment répondus
Forums Sujets Réponses Lus Dernières contributions
The Blender Clan 'tchat Inkscape Forum en français ! 0 20 Hier 17:09:08
Papy_Octet 
Mes premières images sous Blender (débutants) (WIP) langue des signes française 6 99 Hier 13:42:42
ArnaudT 
Hors Sujet !! Atelier master : le dernier robot - Meltingman tuto 7 447 24/09 20:28:07
meltingman 
Hors Sujet !! les tutos de Moonboots    [1][2][3]...[31] 309 47914 21/09 11:25:03
moonboots 
Questions & Réponses Timeline: ne peut bouger mes channels up/ down/ to top/ bottom 1 236 19/09 09:39:18
Redstar 
Hors Sujet !! Buy (50 Pieces) New Original Unlocked Apple iPhone 14 Pro Max 5G 128GB $34,950 0 134 17/09 14:19:18
emailychang01 
[WIP] et travaux terminés [WIP] Projet très court métrage Gustave 2 328 16/09 22:21:51
doudoulolita 
Hors Sujet !! Buy (50 Pieces) Apple Watch Series 7 (GPS) 45mm $11,450 0 133 16/09 14:20:37
emailychang01 
Hors Sujet !! Buy (50 Pieces) New Original Unlocked Apple iPhone 14 Pro 5G 128GB $29,950 0 150 15/09 13:07:23
emailychang01 
Hors Sujet !! Buy (500 Pieces) New AirPod Pro (2nd generation) $69,500 0 148 14/09 13:08:35
emailychang01 
Hors Sujet !! Buy (30 Pcs) Apple Watch Ultra (GPS + Cellular) 49mm $14,970 0 154 13/09 09:42:05
emailychang01 
Hors Sujet !! Buy (50 Pieces) New Original Unlocked Apple iPhone 14 Plus 5G 128GB $24,950 0 166 12/09 12:06:46
emailychang01 
Questions & Réponses Link et moteurs de rendu 0 272 11/09 10:04:02
doudoulolita 
Hors Sujet !! Buy (400 Pieces) New AirPod Pro (2nd generation) $67,600 0 192 11/09 09:41:39
emailychang01 
Hors Sujet !! Buy (30 Pcs) Apple Watch Ultra (GPS + Cellular) $14,970 0 195 10/09 13:57:22
emailychang01 
Questions & Réponses Transformation edge loop en cercle 3 370 09/09 20:28:46
moonboots 
Hors Sujet !! Buy (50 Pieces) New Apple iPhone 14 5G 512GB $34,950 Website: www.brianelectronics.com 0 2698 09/09 14:20:04
emailychang01 
Hors Sujet !! Buy (50 Pieces) New Original Unlocked Apple iPhone 13 Pro Max 5G 128GB $29,950 0 244 06/09 10:39:49
emailychang01 
Hors Sujet !! Buy (30 Pieces) New Original Unlocked Apple iPhone 12 Pro Max 5G 512GB $17,970 0 265 05/09 13:08:00
emailychang01 
The Blender Clan 'tchat Avenir du blender clan    [1][2][3]...[45] 447 67715 05/09 11:01:48
Redstar 

Qui est en ligne
115 utilisateur(s) en ligne (dont 74 sur Forums)

Membre(s): 0
Invité(s): 115


plus...
Nouveaux membres
MathiasFul 18/8/2022
VicenteZcl 18/8/2022
OlivaL1007 18/8/2022
Adrian8943 18/8/2022
NorbertoGe 18/8/2022
VeronaKais 18/8/2022
BettieSile 18/8/2022
DarylTier 18/8/2022
BretParkhi 18/8/2022
LeoTrotter 18/8/2022
Dernier Ajout
2020-09-24.jpg

Evènements à venir
Nov 18
Anniversaire de RichDeg
Dec 29
Anniversaire d'ebrain
Jan 7
BUG de Lyon
plus 232 plus d'élément(s)
 Par Mickaël Guédon [ebrain] © 2003-2021 The Blender Clan - hébergé par TuxFamily - Site déclaré à la CNIL sous le numéro 1155445