Skip to content

Commit

Permalink
Preferencies mc_instances_path
Browse files Browse the repository at this point in the history
  • Loading branch information
Aspirata committed Jul 12, 2024
1 parent ec689a8 commit 09e08c6
Show file tree
Hide file tree
Showing 1,546 changed files with 50 additions and 19 deletions.
1 change: 0 additions & 1 deletion Mcblend Source/MCB_API.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ def EmissionMode(PBSDF, material):
Preferences = bpy.context.preferences.addons[__package__].preferences

if Preferences.emissiondetection == 'Automatic & Manual' and (PBSDF.inputs["Emission Strength"].default_value != 0 or MaterialIn(Emissive_Materials.keys(), material, "==")):
debugger(Emissive_Materials.keys())
return 1

if Preferences.emissiondetection == 'Automatic' and PBSDF.inputs["Emission Strength"].default_value != 0:
Expand Down
14 changes: 8 additions & 6 deletions Mcblend Source/Materials/Materials.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,9 @@ def fix_world():
material.use_backface_culling = False

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

if ("grass" in material_parts or "water" in material_parts or "leaves" in material_parts) and "side" not in material_parts:
if any(part in material_parts for part in ("grass", "water", "leaves")) and "side" not in material_parts:
if lbcf_node is None:
if "Lazy Biome Color Fix" not in bpy.data.node_groups:
try:
Expand Down Expand Up @@ -1059,6 +1059,8 @@ def find_image(image_name, root_folder):

def setproceduralpbr():

Preferences = bpy.context.preferences.addons[__package__.split(".")[0]].preferences

for selected_object in bpy.context.selected_objects:
slot = 0
if selected_object.material_slots:
Expand Down Expand Up @@ -1104,7 +1106,7 @@ def setproceduralpbr():
if "Procedural Specular Node" in node.name:
pspecular_node = node

if PBSDF is not None:
if PBSDF and image:
# Use Normals
if PProperties.use_normals:

Expand All @@ -1119,7 +1121,7 @@ def setproceduralpbr():
material.node_tree.links.new(bump_node.outputs['Normal'], PBSDF.inputs['Normal'])
bump_node.inputs[0].default_value = PProperties.bump_strength
else:
if bump_node is not None:
if bump_node:
material.node_tree.nodes.remove(bump_node)

if PNormals is None:
Expand Down Expand Up @@ -1306,7 +1308,7 @@ def setproceduralpbr():
material.node_tree.links.new(mult_socket, PBSDF.inputs["Emission Strength"])
material.node_tree.nodes.remove(node_group)

if PProperties.proughness:
if PProperties.proughness and Preferences.dev_tools:
if proughness_node is None:
proughness_node = material.node_tree.nodes.new(type='ShaderNodeMapRange')
proughness_node.name = "Procedural Roughness Node"
Expand All @@ -1325,7 +1327,7 @@ def setproceduralpbr():
elif PProperties.pr_revert and proughness_node is not None:
material.node_tree.nodes.remove(proughness_node)

if PProperties.pspecular:
if PProperties.pspecular and Preferences.dev_tools:
if pspecular_node is None:
pspecular_node = material.node_tree.nodes.new(type='ShaderNodeMapRange')
pspecular_node.name = "Procedural Specular Node"
Expand Down
16 changes: 14 additions & 2 deletions Mcblend Source/Preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ class McblendPreferences(AddonPreferences):
default='Full'
)

mc_instances_path: StringProperty(
name="Minecraft Instances Folder",
subtype="DIR_PATH"
)

dev_tools: BoolProperty(
name="Dev Tools",
default=False
Expand All @@ -47,7 +52,7 @@ def draw(self, context):
layout = self.layout
box = layout.box()
row = box.row()
row.label(text="UI:")
row.label(text="UI:") # UI

if blender_version(">= 4.1.0"):
row = box.row()
Expand All @@ -60,7 +65,7 @@ def draw(self, context):

box = layout.box()
row = box.row()
row.label(text="Algorithms:")
row.label(text="Algorithms:") # Algorithms

row = box.row()
row.label(text="Absolute Solver Mode:")
Expand All @@ -72,5 +77,12 @@ def draw(self, context):
row = box.row()
row.prop(self, "emissiondetection", text='emissiondetection', expand=True)

box = layout.box()
row = box.row()
row.label(text="Other:") # Other

row = box.row()
row.prop(self, "mc_instances_path")

row = box.row()
row.prop(self, "dev_tools")
Loading

0 comments on commit 09e08c6

Please sign in to comment.