Ignore compiled python files
This commit is contained in:
parent
07ff2f8c6e
commit
0ed6161ed8
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
||||||
|
*.pyc
|
|
@ -13,10 +13,6 @@
|
||||||
"command": "clear_target",
|
"command": "clear_target",
|
||||||
"params": ["depth", "color"]
|
"params": ["depth", "color"]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"command": "draw_quad",
|
|
||||||
"params": ["material_resource", "material1", "env_map"]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"command": "draw_geometry",
|
"command": "draw_geometry",
|
||||||
"params": ["forward"]
|
"params": ["forward"]
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -1770,7 +1770,7 @@ class ArmoryExporter(bpy.types.Operator, ExportHelper):
|
||||||
om.instance_offsets = instance_offsets
|
om.instance_offsets = instance_offsets
|
||||||
|
|
||||||
# Export usage
|
# Export usage
|
||||||
if node.static_usage == False:
|
if node.data.static_usage == False:
|
||||||
om.static_usage = False
|
om.static_usage = False
|
||||||
|
|
||||||
# Delete the new mesh that we made earlier.
|
# Delete the new mesh that we made earlier.
|
||||||
|
|
|
@ -6,16 +6,10 @@ import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
import platform
|
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):
|
def runProject(fp, target, name):
|
||||||
os.chdir(fp)
|
os.chdir(fp)
|
||||||
# HTML5
|
# HTML5
|
||||||
if (target == '3'):
|
if (target == '0'):
|
||||||
webbrowser.open("http://127.0.0.1:8080/build/html5",new=2)
|
webbrowser.open("http://127.0.0.1:8080/build/html5",new=2)
|
||||||
|
|
||||||
def build():
|
def build():
|
||||||
|
|
|
@ -37,8 +37,7 @@ def initWorldProperties():
|
||||||
('OSX', 'OSX', 'OSX'),
|
('OSX', 'OSX', 'OSX'),
|
||||||
('Linux', 'Linux', 'Linux'),
|
('Linux', 'Linux', 'Linux'),
|
||||||
('iOS', 'iOS', 'iOS'),
|
('iOS', 'iOS', 'iOS'),
|
||||||
('Android', 'Android', 'Android'),
|
('Android', 'Android', 'Android')],
|
||||||
('Blender', 'Blender', 'Blender')],
|
|
||||||
name = "Target")
|
name = "Target")
|
||||||
bpy.types.World.CGProjectName = StringProperty(name = "Name")
|
bpy.types.World.CGProjectName = StringProperty(name = "Name")
|
||||||
bpy.types.World.CGProjectPackage = StringProperty(name = "Package")
|
bpy.types.World.CGProjectPackage = StringProperty(name = "Package")
|
||||||
|
@ -73,7 +72,7 @@ def draw_play_item(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
layout.operator("cg.play")
|
layout.operator("cg.play")
|
||||||
|
|
||||||
# Menu in tools region
|
# Menu in render region
|
||||||
class ToolsPanel(bpy.types.Panel):
|
class ToolsPanel(bpy.types.Panel):
|
||||||
bl_label = "Cycles Game"
|
bl_label = "Cycles Game"
|
||||||
bl_space_type = "PROPERTIES"
|
bl_space_type = "PROPERTIES"
|
||||||
|
@ -81,7 +80,8 @@ class ToolsPanel(bpy.types.Panel):
|
||||||
bl_context = "render"
|
bl_context = "render"
|
||||||
|
|
||||||
# Info panel play
|
# Info panel play
|
||||||
bpy.types.INFO_HT_header.prepend(draw_play_item)
|
#bpy.types.INFO_HT_header.prepend(draw_play_item)
|
||||||
|
bpy.types.VIEW3D_HT_header.append(draw_play_item)
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
|
@ -129,7 +129,7 @@ def exportGameData():
|
||||||
shader_references = []
|
shader_references = []
|
||||||
for scene in bpy.data.scenes:
|
for scene in bpy.data.scenes:
|
||||||
if scene.name[0] != '.': # Skip hidden scenes
|
if scene.name[0] != '.': # Skip hidden scenes
|
||||||
bpy.ops.export_scene.armory({"scene":scene}, filepath='Assets/' + scene.name + '.json')
|
bpy.ops.export_scene.armory({"scene":scene}, filepath='Assets/generated/' + scene.name + '.json')
|
||||||
shader_references += ArmoryExporter.shader_references
|
shader_references += ArmoryExporter.shader_references
|
||||||
|
|
||||||
# Move armatures back
|
# Move armatures back
|
||||||
|
@ -145,6 +145,9 @@ def exportGameData():
|
||||||
write_data.write_main()
|
write_data.write_main()
|
||||||
|
|
||||||
def buildProject(self, build_type=0):
|
def buildProject(self, build_type=0):
|
||||||
|
# Save blend
|
||||||
|
bpy.ops.wm.save_mainfile()
|
||||||
|
|
||||||
# Save scripts
|
# Save scripts
|
||||||
#area = bpy.context.area
|
#area = bpy.context.area
|
||||||
#old_type = area.type
|
#old_type = area.type
|
||||||
|
@ -166,27 +169,22 @@ def buildProject(self, build_type=0):
|
||||||
fp = os.path.sep.join(s)
|
fp = os.path.sep.join(s)
|
||||||
os.chdir(fp)
|
os.chdir(fp)
|
||||||
|
|
||||||
# Save blend
|
|
||||||
bpy.ops.wm.save_mainfile()
|
|
||||||
|
|
||||||
# Export
|
# Export
|
||||||
exportGameData()
|
exportGameData()
|
||||||
|
|
||||||
# Set build command
|
# Set build command
|
||||||
if (bpy.data.worlds[0]['CGProjectTarget'] == 0):
|
if (bpy.data.worlds[0]['CGProjectTarget'] == 0):
|
||||||
bashCommand = "-t osx"
|
bashCommand = "-t html5"
|
||||||
elif (bpy.data.worlds[0]['CGProjectTarget'] == 1):
|
elif (bpy.data.worlds[0]['CGProjectTarget'] == 1):
|
||||||
bashCommand = "-t windows"
|
bashCommand = "-t windows"
|
||||||
elif (bpy.data.worlds[0]['CGProjectTarget'] == 2):
|
elif (bpy.data.worlds[0]['CGProjectTarget'] == 2):
|
||||||
bashCommand = "-t linux"
|
bashCommand = "-t osx"
|
||||||
elif (bpy.data.worlds[0]['CGProjectTarget'] == 3):
|
elif (bpy.data.worlds[0]['CGProjectTarget'] == 3):
|
||||||
bashCommand = "-t html5"
|
bashCommand = "-t linux"
|
||||||
elif (bpy.data.worlds[0]['CGProjectTarget'] == 4):
|
elif (bpy.data.worlds[0]['CGProjectTarget'] == 4):
|
||||||
bashCommand = "-t ios"
|
bashCommand = "-t ios"
|
||||||
elif (bpy.data.worlds[0]['CGProjectTarget'] == 5):
|
elif (bpy.data.worlds[0]['CGProjectTarget'] == 5):
|
||||||
bashCommand = "-t android_native"
|
bashCommand = "-t android-native"
|
||||||
elif (bpy.data.worlds[0]['CGProjectTarget'] == 6):
|
|
||||||
bashCommand = "-t blender"
|
|
||||||
|
|
||||||
# Build
|
# Build
|
||||||
haxelib_path = "haxelib"
|
haxelib_path = "haxelib"
|
||||||
|
@ -216,10 +214,14 @@ def cleanProject(self):
|
||||||
fp = os.path.sep.join(s)
|
fp = os.path.sep.join(s)
|
||||||
os.chdir(fp)
|
os.chdir(fp)
|
||||||
|
|
||||||
# Remove build dir
|
# Remove build data
|
||||||
if os.path.isdir("build"):
|
if os.path.isdir("build"):
|
||||||
shutil.rmtree('build')
|
shutil.rmtree('build')
|
||||||
|
|
||||||
|
# Remove generated data
|
||||||
|
if os.path.isdir("Assets/generated"):
|
||||||
|
shutil.rmtree('Assets/generated')
|
||||||
|
|
||||||
# Remove compiled nodes
|
# Remove compiled nodes
|
||||||
path = 'Sources/' + bpy.data.worlds[0].CGProjectPackage.replace(".", "/") + "/"
|
path = 'Sources/' + bpy.data.worlds[0].CGProjectPackage.replace(".", "/") + "/"
|
||||||
for node_group in bpy.data.node_groups:
|
for node_group in bpy.data.node_groups:
|
||||||
|
@ -284,8 +286,8 @@ def buildNodeTrees():
|
||||||
|
|
||||||
# Export node scripts
|
# Export node scripts
|
||||||
for node_group in bpy.data.node_groups:
|
for node_group in bpy.data.node_groups:
|
||||||
if type(node_group) == 'nodes.CGTree': # Build only cycles game trees
|
#if type(node_group) == 'nodes.CGTree': # Build only cycles game trees
|
||||||
buildNodeTree(node_group)
|
buildNodeTree(node_group)
|
||||||
|
|
||||||
def buildNodeTree(node_group):
|
def buildNodeTree(node_group):
|
||||||
rn = getRootNode(node_group)
|
rn = getRootNode(node_group)
|
||||||
|
|
|
@ -98,10 +98,10 @@ float LightingFuncGGX_OPT3(vec3 N, vec3 V, vec3 L, float roughness, float F0) {
|
||||||
void kore() {
|
void kore() {
|
||||||
|
|
||||||
float visibility = 1.0;
|
float visibility = 1.0;
|
||||||
if (receiveShadow && lPos.w > 0.0) {
|
//if (receiveShadow && lPos.w > 0.0) {
|
||||||
visibility = shadowSimple(lPos);
|
// visibility = shadowSimple(lPos);
|
||||||
visibility = (visibility * 0.8) + 0.2;
|
// visibility = (visibility * 0.8) + 0.2;
|
||||||
}
|
//}
|
||||||
|
|
||||||
vec4 outColor;
|
vec4 outColor;
|
||||||
vec3 t = pow(matColor.rgb, vec3(2.2));
|
vec3 t = pow(matColor.rgb, vec3(2.2));
|
||||||
|
|
Loading…
Reference in a new issue