diff --git a/MiBlend.blend b/MiBlend.blend index 3022bbcd..582f579d 100644 Binary files a/MiBlend.blend and b/MiBlend.blend differ diff --git a/MiBlend_Source/Data.py b/MiBlend_Source/Data.py index 7ce4dda5..bd29bc89 100644 --- a/MiBlend_Source/Data.py +++ b/MiBlend_Source/Data.py @@ -100,12 +100,16 @@ "Forest": (0.226964, 0.617207, 0.088656), "Birch": (0.242279, 0.396756, 0.16203), "Taiga": (0.25415, 0.467784, 0.250158), + "Dark Forest": (0.021219, 0.03434, 0.003035), + "Bad Land": (0.278893, 0.219526, 0.074214), } Foliage_Color = { "Forest": (0.227161, 0.614651, 0.089036), "Taiga": (0.152925, 0.366253, 0.147027), - "Swamp": (0.144128, 0.16203, 0.040915) + "Swamp": (0.144128, 0.16203, 0.040915), + "Jungle": (0.227161, 0.614651, 0.089036), + "Mangrove": (0.227161, 0.614651, 0.089036), } Emissive_Materials = { diff --git a/MiBlend_Source/MIB_API.py b/MiBlend_Source/MIB_API.py index 6fbf61f9..624fd7f4 100644 --- a/MiBlend_Source/MIB_API.py +++ b/MiBlend_Source/MIB_API.py @@ -40,14 +40,18 @@ def MaterialIn(Array, material, mode="in"): def detect_obj_type(obj_name: str = "", mat_name: str = "") -> str: - if ("block" in obj_name or "block" in mat_name) or bpy.data.objects[obj_name].get("MiBlend ID", None) != "item": - dprint(f"{obj_name}; {mat_name} is a block") - return "block" - - elif ("item" in obj_name or "item" in mat_name) or bpy.data.objects[obj_name].get("MiBlend ID", None) == "item": + if "item" in obj_name or "item" in mat_name or bpy.data.objects[obj_name].get("MiBlend ID", None) == "item": dprint(f"{obj_name}; {mat_name} is an item") return "item" - + + elif "block" in obj_name or "block" in mat_name or bpy.data.objects[obj_name].get("MiBlend ID", None) == "block": + dprint(f"{obj_name}; {mat_name} is a block") + return "block" + + elif "entity" in obj_name or "entity" in mat_name or bpy.data.objects[obj_name].get("MiBlend ID", None) == "entity": + dprint(f"{obj_name}; {mat_name} is a entity") + return "entity" + dprint(f"{obj_name}; {mat_name} is unknown") return "unknown" diff --git a/MiBlend_Source/Materials/Materials.py b/MiBlend_Source/Materials/Materials.py index ef7d95d2..0f2c01ed 100644 --- a/MiBlend_Source/Materials/Materials.py +++ b/MiBlend_Source/Materials/Materials.py @@ -244,6 +244,12 @@ def fix_world(): if "fern" or "spruce" in texture_parts: biome = "Taiga" + elif "dark" in texture_parts: + biome = "Dark Forest" + elif "mangrove" in texture_parts: + biome = "Mangrove" + elif "jungle" in texture_parts: + biome = "Jungle" if "birch" in texture_parts: biome = "Birch" diff --git a/MiBlend_Source/Properties.py b/MiBlend_Source/Properties.py index 19f93da3..70899d7d 100644 --- a/MiBlend_Source/Properties.py +++ b/MiBlend_Source/Properties.py @@ -62,11 +62,6 @@ class ResourcePackProperties(PropertyGroup): default=True, ) - compatibility_mode: BoolProperty( - name="Compatibility Mode", - default=False, - ) - use_additional_textures: BoolProperty( name="Use PBR Textures", # 16.09.2024 This was renamed, but i'm too lazy to change the name in the code LoL default=True, diff --git a/MiBlend_Source/Resource_Packs.py b/MiBlend_Source/Resource_Packs.py index 64818b0c..c1c02471 100644 --- a/MiBlend_Source/Resource_Packs.py +++ b/MiBlend_Source/Resource_Packs.py @@ -125,14 +125,16 @@ def find_image(image_name: str, root_folder: str, obj_type: str = "unknown") -> print("Bad Zip File") else: for dirpath, dirnames, files in os.walk(root_folder): - if obj_type == "unknown": - dprint(f"Warning ! {image_name} is {obj_type}") - elif not r_props.compatibility_mode and 'textures' in os.path.basename(dirpath) == "textures": - dirpath = os.path.join(dirpath, obj_type) + if "textures" not in dirpath: + continue + if obj_type == "unknown": + dprint(f"{image_name} is {obj_type}") + dprint(f"Switching to hybrid mode...") + dirpath = os.path.join(dirpath, obj_type) else: - continue + dprint(f"{image_name} is {obj_type} using texture filter...") if not os.path.exists(dirpath): continue @@ -158,11 +160,14 @@ def zip_unpacker(root_folder: str, image_name: str, obj_type: str , file=None) - infolist = zip_ref.infolist() if obj_type == "unknown": - dprint(f"Warning ! {image_name} is {obj_type}") - - elif not r_props.compatibility_mode: + dprint(f"{image_name} is {obj_type}") + dprint(f"Switching to hybrid mode...") + filtered_infolist = [item for item in infolist if f"textures" in item.filename] + else: + dprint(f"{image_name} is {obj_type} using texture filter...") filtered_infolist = [item for item in infolist if f"textures/{obj_type}" in item.filename] - infolist = filtered_infolist + + infolist = filtered_infolist if r_props.animate_textures: for zip_info in infolist: @@ -182,6 +187,7 @@ def zip_unpacker(root_folder: str, image_name: str, obj_type: str , file=None) - continue texture = os.path.basename(zip_info.filename) + dprint(f"{texture} ; {image_name}") extracted_file_path = os.path.join(extract_path, zip_info.filename) if (texture == image_name) or ("grass" in image_name and (texture == f"short_{image_name}" or texture == image_name.replace("short_", "") or file == image_name)): @@ -285,8 +291,8 @@ def animate_texture(texture_node, new_image_texture_path, ITexture_Animator, Cur if os.path.isfile(animation_file): with open(animation_file, 'r') as file: data = json.load(file).get('animation', {}) - frametime = data.get('frametime') - interpolate = data.get('interpolate') + frametime = data.get('frametime', 20) + interpolate = data.get('interpolate', False) if auvf_node: material.node_tree.nodes.remove(auvf_node) diff --git a/MiBlend_Source/UI.py b/MiBlend_Source/UI.py index 9b284158..ba36ffad 100644 --- a/MiBlend_Source/UI.py +++ b/MiBlend_Source/UI.py @@ -106,9 +106,6 @@ def draw(self, context): row = sbox.row() row.prop(scene.resource_properties, "ignore_dublicates") - row = sbox.row() - row.prop(scene.resource_properties, "compatibility_mode") - row = sbox.row() row.prop(scene.resource_properties, "use_i")