Skip to content

Commit

Permalink
Lazy Biome Color Fix Exclusions
Browse files Browse the repository at this point in the history
  • Loading branch information
Aspirata committed Jul 30, 2024
1 parent 44d207e commit 9d4ddef
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
3 changes: 1 addition & 2 deletions Mcblend Source/MCB_API.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from .Data import *
from .Utils.Absolute_Solver import Absolute_Solver
import time
import atexit

def PBSDF_compability(Input):
if Input == "Subsurface Weight" and blender_version("< 4.0.0"):
Expand Down Expand Up @@ -56,7 +55,7 @@ def dprint(message):
if bpy.context.preferences.addons[__package__].preferences.dev_tools and bpy.context.preferences.addons[__package__].preferences.dprint:
print(message)

def Full_Perf_Time(func):
def Full_Perf_Time(func): # Not Implemented
total_time = 0
call_count = 0

Expand Down
5 changes: 3 additions & 2 deletions Mcblend Source/Materials/Materials.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,9 @@ def fix_world():

if WProperties.lazy_biome_fix:
material_parts = image_texture_node.image.name.lower().replace(".png", "").replace("-", "_").split("_")

if any(part in material_parts for part in ("grass", "water", "leaves", "stem", "lily", "vine", "fern")) or ("redstone" and "dust" in material_parts) and all(part not in material_parts for part in ("cherry", "side", "azalea")):

# Lazy Biome Color Fix Exclusions
if any(part in material_parts for part in ("grass", "water", "leaves", "stem", "lily", "vine", "fern")) and all(part not in material_parts for part in ("cherry", "side", "azalea", "snow")) or ("redstone" and "dust" in material_parts):
if lbcf_node is None:
if "Lazy Biome Color Fix" not in bpy.data.node_groups:
try:
Expand Down
12 changes: 6 additions & 6 deletions Mcblend Source/Resource_Packs.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def apply_resources():
resource_packs = get_resource_packs()
r_props = bpy.context.scene.resource_properties

@ Full_Perf_Time

def fast_find_image(textures_paths, texture_name):
for texture_path in filter(None, textures_paths):
dir_path = os.path.dirname(texture_path)
Expand All @@ -94,7 +94,7 @@ def fast_find_image(textures_paths, texture_name):
return predicted_texture
return None

@ Full_Perf_Time

def zip_unpacker(root_folder, image_name, file=None):
extract_path = os.path.join(resource_packs_directory, os.path.splitext(file if file is not None else os.path.basename(root_folder))[0])
with zipfile.ZipFile(root_folder, 'r') as zip_ref:
Expand All @@ -115,7 +115,7 @@ def zip_unpacker(root_folder, image_name, file=None):
return extracted_file_path
return None

@ Full_Perf_Time

def find_image(image_name, root_folder):
if root_folder.endswith(('.zip', '.jar')):
try:
Expand All @@ -138,7 +138,7 @@ def find_image(image_name, root_folder):
print("Bad Zip File")
return None

@ Full_Perf_Time

def find_texture_users(texture):
Texture_users = []
for obj in bpy.data.objects:
Expand All @@ -156,7 +156,7 @@ def find_texture_users(texture):

return Texture_users

@ Full_Perf_Time

def update_texture(new_image_path, image_texture, texture_node=None, colorspace=None):
Users = None

Expand Down Expand Up @@ -199,7 +199,7 @@ def update_texture(new_image_path, image_texture, texture_node=None, colorspace=
for user in Users:
user.image = user_texture

@ Full_Perf_Time

def animate_texture(texture_node, new_image_texture_path, ITexture_Animator, Current_node_tree, image_path=None):
Texture_Animator = None
image_texture = bpy.data.images.get(os.path.basename(new_image_texture_path))
Expand Down
Binary file modified Mcblend.blend
Binary file not shown.

0 comments on commit 9d4ddef

Please sign in to comment.