diff --git a/README.md b/README.md index a37bc4e3..2a35a208 100755 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -cyclesgame +armory ============== Note: The engine is still in development and will not work yet. diff --git a/blender/nodes_material.py b/blender/nodes_material.py index a6b5f0d2..9485e30c 100644 --- a/blender/nodes_material.py +++ b/blender/nodes_material.py @@ -2,6 +2,9 @@ import bpy import math from armory import Object +def is_pow(num): + return ((num & (num - 1)) == 0) and num != 0 + def find_node_by_link(node_group, to_node, target_socket): for link in node_group.links: if link.to_node == to_node and link.to_socket == target_socket: @@ -86,8 +89,9 @@ def parse_from(self, material, c, defs, surface_node): def make_texture(self, id, image_node, material): tex = Object() tex.id = id - if image_node.image is not None: - tex.name = image_node.image.name.rsplit('.', 1)[0] # Remove extension + image = image_node.image + if image is not None: + tex.name = image.filepath.rsplit('/', 1)[1].rsplit('.', 1)[0] # Extract file name without extension tex.name = tex.name.replace('.', '_') tex.name = tex.name.replace('-', '_') tex.name = tex.name.replace(' ', '_') @@ -98,9 +102,16 @@ def make_texture(self, id, image_node, material): tex.min_filter = 'anisotropic' tex.mipmap_filter = 'linear' tex.generate_mipmaps = True - #image_node.extension = 'Repeat' # TODO + if image_node.extension != 'REPEAT': # Extend or clip + tex.u_addressing = 'clamp' + tex.v_addressing = 'clamp' + else: + if is_pow(image.size[0]) == False or is_pow(image.size[1]) == False: + print('Armory Warning: ' + material.name + '/' + image.name + ' - non power of 2 texture can not use repeat mode') + tex.u_addressing = 'clamp' + tex.v_addressing = 'clamp' - if image_node.image.source == 'MOVIE': # Just append movie texture trait for now + if image.source == 'MOVIE': # Just append movie texture trait for now movie_trait = Object() movie_trait.type = 'Script' movie_trait.class_name = 'MovieTexture' diff --git a/blender/project.py b/blender/project.py index 556e1950..c66b48e9 100755 --- a/blender/project.py +++ b/blender/project.py @@ -223,7 +223,7 @@ def buildProject(self, build_type=0): #prefix = haxelib_path + " run kha " - output = subprocess.check_output([haxelib_path + " path cyclesgame"], shell=True) + output = subprocess.check_output([haxelib_path + " path armory"], shell=True) output = str(output).split("\\n")[0].split("'")[1] scripts_path = output[:-8] + "blender/" raw_path = output[:-8] + "raw/" diff --git a/blender/write_data.py b/blender/write_data.py index ee9df6f5..10c5a31a 100644 --- a/blender/write_data.py +++ b/blender/write_data.py @@ -17,7 +17,7 @@ project.addSources('Sources'); project.addShaders('Sources/Shaders/**'); project.addAssets('Assets/**'); -project.addLibrary('cyclesgame'); +project.addLibrary('armory'); """) for ref in shader_references: # Shaders diff --git a/blender/write_probes.py b/blender/write_probes.py index bfdf06c3..a0096351 100644 --- a/blender/write_probes.py +++ b/blender/write_probes.py @@ -25,10 +25,10 @@ def write_probes(image_name, disable_hdr, cached_num_mips, generate_radiance=Tru # if platform.system() == 'Darwin': # haxelib_path = "/usr/local/bin/haxelib" - # output = subprocess.check_output([haxelib_path + " path cyclesgame"], shell=True) + # output = subprocess.check_output([haxelib_path + " path armory"], shell=True) # output = str(output).split("\\n")[0].split("'")[1] # cmft_path = output[:-8] + "tools/cmft/" - cmft_path = 'Libraries/cyclesgame/tools/cmft/' + cmft_path = 'Libraries/armory/tools/cmft/' kraffiti_path = 'Kha/Kore/Tools/kraffiti/' generated_files = [] output_gama_numerator = '1.0' if disable_hdr else '2.2' diff --git a/haxelib.json b/haxelib.json index 57db3375..1d5c2f0d 100644 --- a/haxelib.json +++ b/haxelib.json @@ -1,6 +1,6 @@ { - "name": "cyclesgame", - "url" : "https://github.com/luboslenco/cyclesgame/", + "name": "armory", + "url" : "https://github.com/luboslenco/armory/", "license": "LGPL", "tags": ["kha", "3d"], "description": "Blender game engine",