Skip to content

Commit

Permalink
Some Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Aspirata committed Jun 13, 2024
1 parent c60bf16 commit a833c4e
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 17 deletions.
5 changes: 3 additions & 2 deletions Mcblend Source/Data.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@
},

"Aspirata Eevee":{
"eevee.eevee.use_shadow_jitter_viewport": True,
"eevee.taa_samples": 32,
"eevee.taa_render_samples": 32,
"eevee.use_shadow_jitter_viewport": True,
"eevee.shadow_ray_count": 2,
"eevee.shadow_step_count": 16,
"eevee.use_volumetric_shadows": True,
Expand All @@ -118,7 +120,6 @@
"eevee.use_overscan": True,
"eevee.overscan_size": 10.0,
}

}

Emissive_Materials = {
Expand Down
4 changes: 2 additions & 2 deletions Mcblend Source/MCB_API.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ def GetASText(error_code, text, data=None):
return Absolute_Solver_Errors[error_code][text]

if data != None:
bpy.ops.wm.absolute_solver('INVOKE_DEFAULT', Error_Code = error_code, Error_Name = (error_name if error_code != None else GetASText(error_code, "Error Name")), Description=(GetASText(error_code, 'Description')) if description == None else description.format(Data=data), Tech_Things = (str(err) if err != None else "None"))
bpy.ops.wm.absolute_solver('INVOKE_DEFAULT', Error_Code = error_code, Error_Name = GetASText(error_code, "Error Name") if error_code != None else error_name, Description= GetASText(error_code, 'Description', data) if description == None else description.format(Data=data), Tech_Things = (str(err) if err != None else "None"))
else:
bpy.ops.wm.absolute_solver('INVOKE_DEFAULT', Error_Code = error_code, Error_Name = (error_name if error_code != None else GetASText(error_code, "Error Name")), Description=(GetASText(error_code, 'Description')) if description == None else description, Tech_Things = (str(err) if err != None else "None"))
bpy.ops.wm.absolute_solver('INVOKE_DEFAULT', Error_Code = error_code, Error_Name = GetASText(error_code, "Error Name") if error_code != None else error_name, Description= GetASText(error_code, 'Description') if description == None else description, Tech_Things = (str(err) if err != None else "None"))
except:
bpy.ops.wm.absolute_solver('INVOKE_DEFAULT', Error_Code = "000", Error_Name = GetASText("000", "Error Name"), Description=GetASText("000", 'Description', error_code if error_code != None else error_name), Tech_Things = str(traceback.format_exc()))

Expand Down
22 changes: 12 additions & 10 deletions Mcblend Source/Materials/Materials.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,27 +446,29 @@ def find_texture_users(texture):
return Texture_users

def update_texture(new_image_path, image_texture, texture_node=None, colorspace=None):
Users = None
# if not r_props.ignore_dublicates then get_node_suffix_number() and replace with the original texture, but when replacing add the index
Users = find_texture_users(bpy.data.images[image_texture])


if image_texture in bpy.data.images:
Users = find_texture_users(bpy.data.images[image_texture])
bpy.data.images.remove(bpy.data.images[image_texture], do_unlink=True)

if texture_node != None:
if not texture_node.image:
if texture_node in bpy.data.images:
if image_texture in bpy.data.images:
texture_node.image = bpy.data.images[image_texture]
else:
texture_node.image = bpy.data.images.load(new_image_path)

for user in Users:
if image_texture in bpy.data.images:
user.image = bpy.data.images[image_texture]
else:
user.image = bpy.data.images.load(new_image_path)
if Users != None:
for user in Users:
if image_texture in bpy.data.images:
user.image = bpy.data.images[image_texture]
else:
user.image = bpy.data.images.load(new_image_path)

if colorspace != None:
user.image.colorspace_settings.name = colorspace
if colorspace != None:
user.image.colorspace_settings.name = colorspace

def animate_texture(texture_node, image_texture, new_image_texture_path, ITexture_Animator, Current_node_tree, image_path=None):
TAnimator_exists = False
Expand Down
6 changes: 3 additions & 3 deletions Mcblend Source/Utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ def SetRenderSettings(current_preset):
for setting_name, value in Render_Settings[current_preset].items():
property_names = setting_name.split('.')
target = bpy.context.scene
for sub_property in property_names[:-1]:
for sub_property in property_names[:-1]:
target = getattr(target, sub_property)
property_name = property_names[-1]
property_name = property_names[-1]
try:
setattr(target, property_name, value)
except:
raise ValueError(f"Error occurred in setting {setting_name}")
raise ValueError(f"Error occurred in setting {setting_name}")
Binary file modified Mcblend.blend
Binary file not shown.

0 comments on commit a833c4e

Please sign in to comment.