Skip to content

Commit

Permalink
UAS sorting and ACES Textures Fix Script
Browse files Browse the repository at this point in the history
  • Loading branch information
Aspirata committed Jul 2, 2024
1 parent 0688817 commit 38b7e75
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 11 deletions.
12 changes: 8 additions & 4 deletions Mcblend Source/Assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,19 @@ def update_assets():
items = bpy.context.scene.assetsproperties.asset_items
items.clear()

all_keys = []

for category, assets in Assets.items():
for key in assets.keys():
item = items.add()
item.name = key
all_keys.append(key)

for key in sorted(all_keys):
item = items.add()
item.name = key


def run_python_script(file_path):

# Fix Absolute Solver

def import_all_from_module(module_name, module_path=None):
if module_path:
if module_path not in sys.path:
Expand Down
8 changes: 8 additions & 0 deletions Mcblend Source/Assets/Scripts/ACES Textures Fix.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import bpy
for selected_object in bpy.context.selected_objects:
if selected_object.material_slots:
for material in selected_object.data.materials:
if material is not None and material.use_nodes:
for node in material.node_tree.nodes:
if node.type == 'TEX_IMAGE' and node.image:
node.image.colorspace_settings.name = "Output - sRGB"
6 changes: 5 additions & 1 deletion Mcblend Source/Data.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,10 @@
"Enable Contact Shadows": {
"Blender_version": "< 4.2.0",
"File_name": "Contact Shadows.py",
}
},

"ACES Textures Fix": {
"File_name": "ACES Textures Fix.py",
},
},
}
8 changes: 2 additions & 6 deletions Mcblend Source/MCB_API.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
from .Data import *
from .Assets import update_assets

def InitOnStart():

if "resource_packs" not in bpy.context.scene:
bpy.context.scene["resource_packs"] = {}
update_default_pack()

items = bpy.context.scene.assetsproperties.asset_items
items.clear()
for category, assets in Assets.items():
for key in assets.keys():
item = items.add()
item.name = key
update_assets()

def PBSDF_compability(Input):
if Input == "Subsurface Weight" and blender_version("< 4.0.0"):
Expand Down

0 comments on commit 38b7e75

Please sign in to comment.