From 5129366c7b68a6ea54112d6fc35c239848eb5ac6 Mon Sep 17 00:00:00 2001 From: Trung <0znightlord0@gmail.com> Date: Wed, 18 Dec 2024 01:16:15 +0700 Subject: [PATCH] init --- .../MCprep_resources/mcprep_data_update.json | 2 +- MCprep_addon/materials/generate.py | 6 +++++- MCprep_addon/spawner/mcmodel.py | 14 +++++++++++++- mcprep_data_base.json | 2 +- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/MCprep_addon/MCprep_resources/mcprep_data_update.json b/MCprep_addon/MCprep_resources/mcprep_data_update.json index bee49f90..fc32cc25 100644 --- a/MCprep_addon/MCprep_resources/mcprep_data_update.json +++ b/MCprep_addon/MCprep_resources/mcprep_data_update.json @@ -4274,7 +4274,7 @@ 0.614651, 0.089036 ], - "colormap/grass": [ + "short_grass": [ 0.227161, 0.614651, 0.089036 diff --git a/MCprep_addon/materials/generate.py b/MCprep_addon/materials/generate.py index 5dc54375..6add11ac 100644 --- a/MCprep_addon/materials/generate.py +++ b/MCprep_addon/materials/generate.py @@ -101,6 +101,10 @@ def get_mc_canonical_name(name: str) -> Tuple[str, Optional[Form]]: # mixed up with the new "water": "painting/water" texture. general_name = "water_still" + if general_name == "grass": + # Pre version format 22 + general_name = "short_grass" + if general_name in env.json_data["blocks"]["block_mapping_mc"]: canon = env.json_data["blocks"]["block_mapping_mc"][general_name] form = "mc" if not jmc_prefix else "jmc2obj" @@ -588,7 +592,7 @@ def get_textures(material: Material) -> Dict[str, Image]: def find_additional_passes(image_file: Path) -> Dict[str, Image]: """Find relevant passes like normal and spec in same folder as image.""" - print("What is this?", image_file) + # print("What is this?", image_file) # just gonna comment this out for now abs_img_file = bpy.path.abspath(str(image_file)) # needs to be blend file relative env.log(f"\tFind additional passes for: {image_file}", vv_only=True) if not os.path.isfile(abs_img_file): diff --git a/MCprep_addon/spawner/mcmodel.py b/MCprep_addon/spawner/mcmodel.py index dc71e3aa..34c6c702 100644 --- a/MCprep_addon/spawner/mcmodel.py +++ b/MCprep_addon/spawner/mcmodel.py @@ -18,6 +18,7 @@ import os import json +import re from mathutils import Vector from math import sin, cos, radians from pathlib import Path @@ -456,7 +457,18 @@ def update_model_list(context: Context): # Filter out models that can't spawn. Typically those that reference # #fire or the likes in the file. - if "template" in name: + # Template base of that block for example candle, cake with candles + # Orient blocks base + # cube same as orientable + # Shulkers, Hanging Signs, Signs are entities. Filter it out for now. + # Light blocks are just special no geometry block with 15 states + is_contains = re.search(r"template_|orientable|cube|_shulker_box|_sign|light_0|light_1", name) + if is_contains: + print(name) + continue + # Single word condition filter + # block single block parent, base parent of most MC contain gui displays + if name in ["block", "air", "conduit", "barrier", "structure_void"]: continue # Filter the "unspawnable_for_now" # Either entity block or block that doesn't good for json diff --git a/mcprep_data_base.json b/mcprep_data_base.json index 18ef19ff..c0f31fe1 100644 --- a/mcprep_data_base.json +++ b/mcprep_data_base.json @@ -36,7 +36,7 @@ "desaturated":{ "vine": [0.227161, 0.614651, 0.089036], "grass": [0.227161, 0.614651, 0.089036], - "colormap/grass": [0.227161, 0.614651, 0.089036], + "short_grass": [0.227161, 0.614651, 0.089036], "lily_pad": [0.227161, 0.614651, 0.089036], "attached_melon_stem": [0.227161, 0.614651, 0.089036], "melon_stem": [0.227161, 0.614651, 0.089036],