Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
zNightlord committed Dec 17, 2024
1 parent 6514aa5 commit 5129366
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion MCprep_addon/MCprep_resources/mcprep_data_update.json
Original file line number Diff line number Diff line change
Expand Up @@ -4274,7 +4274,7 @@
0.614651,
0.089036
],
"colormap/grass": [
"short_grass": [
0.227161,
0.614651,
0.089036
Expand Down
6 changes: 5 additions & 1 deletion MCprep_addon/materials/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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):
Expand Down
14 changes: 13 additions & 1 deletion MCprep_addon/spawner/mcmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import os
import json
import re
from mathutils import Vector
from math import sin, cos, radians
from pathlib import Path
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion mcprep_data_base.json
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down

0 comments on commit 5129366

Please sign in to comment.