Empty screen

This commit is contained in:
Lubos Lenco 2015-10-31 12:08:49 +01:00
parent 0e1695151e
commit 2a2033cc5e
4 changed files with 45 additions and 10 deletions

32
Sources/zblend/Root.hx Normal file
View file

@ -0,0 +1,32 @@
package zblend;
import lue.App;
import lue.Eg;
class Root {
//var cam:CameraNode;
public function new() {
// var modelRes = Eg.getModelResource("budha_resource");
// var materialRes = Eg.getMaterialResource("material_resource");
// var lightRes = Eg.getLightResource("light_resource");
// var camRes = Eg.getCameraResource("camera_resource");
// var model = Eg.addModelNode(modelRes, materialRes);
// Eg.setNodeTransform(model, 0, 0, 0, 0, 0, 0);
// cam = Eg.addCameraNode(camRes);
// Eg.setNodeTransform(cam, 0, -5, 4.0, -1.3, 0, 0);
// var light = Eg.addLightNode(lightRes);
// Eg.setNodeTransform(light, -0.5, -4, 2);
App.requestRender(render);
}
function render(g:kha.graphics4.Graphics) {
//Eg.render(g, cam);
}
}

View file

@ -6,6 +6,12 @@ import shutil
import subprocess
import platform
def haxePath():
path = os.getenv('HAXEPATH')
if (path == None):
path = '/usr/lib/haxe'
return os.path.normpath(path)
def runProject(fp, target, name):
os.chdir(fp)
# HTML5
@ -36,7 +42,8 @@ def build():
kha_path = output
node_path = output + "/Tools/nodejs/node-osx"
print(subprocess.check_output([node_path + " " + kha_path + "/make -t html5"], shell=True))
os.system(node_path + " " + kha_path + "/make -t html5 --haxe " + haxePath())
#print(subprocess.check_output([node_path + " " + kha_path + "/make -t html5 --haxe " + haxePath()], shell=True))
# Copy ammo.js if necessary
if target == '3':

View file

@ -422,7 +422,6 @@ def exportGameData():
# f.write(data.to_JSON())
# Write Main.hx
# TODO: move to separate file
#if not os.path.isfile('Sources/Main.hx'):
with open('Sources/Main.hx', 'w') as f:
f.write(
@ -430,8 +429,8 @@ def exportGameData():
package ;
class Main {
public static function main() {
CompileTime.importPackage('zblend.trait');
CompileTime.importPackage('""" + bpy.data.worlds[0]['TargetProjectPackage'] + """');
lue.sys.CompileTime.importPackage('zblend.trait');
lue.sys.CompileTime.importPackage('""" + bpy.data.worlds[0]['TargetProjectPackage'] + """');
#if js
untyped __js__("
function loadScript(url, callback) {
@ -451,12 +450,7 @@ class Main {
}
static function start() {
var starter = new kha.Starter();
starter.start(new zblend.Root("ZBlend", "room1", Game));
}
}
class Game {
public function new() {
zblend.Root.setScene(zblend.Root.gameData.scene);
starter.start(new lue.App("room1", zblend.Root));
}
}
""")

View file

@ -1,5 +1,7 @@
import http.server
import socketserver
import bpy
import os
# Can't use multiprocessing on Windows
#p = Process(target=run_server)