mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-21 09:05:18 +00:00
Blender 5.0 - fix issues related to EEVEE renamed again
Ahh, it was a mistake warning about non-`_NEXT` values previously - didn't realized that this name was temporary for Blender.
This commit is contained in:
@@ -2706,14 +2706,15 @@ class ActivateDrawingStyle(bpy.types.Operator, tool.Ifc.Operator):
|
|||||||
def preprocess(path: str, value: Any) -> tuple[str, Any, bool, bool]:
|
def preprocess(path: str, value: Any) -> tuple[str, Any, bool, bool]:
|
||||||
warning = False
|
warning = False
|
||||||
skip = False
|
skip = False
|
||||||
# @25.05.12
|
# 25.11.07, Blender 5+
|
||||||
if path == "scene.render.engine" and value == "BLENDER_EEVEE":
|
if path == "scene.render.engine" and value in ("BLENDER_EEVEE", "BLENDER_EEVEE_NEXT"):
|
||||||
value = "BLENDER_EEVEE_NEXT"
|
if value == "BLENDER_EEVEE_NEXT":
|
||||||
print(
|
print(
|
||||||
f"Warning: Value 'BLENDER_EEVEE' is outdated for property '{path}' "
|
f"Warning: Value 'BLENDER_EEVEE_NEXT' is outdated for property '{path}' "
|
||||||
"since Blender 4.2 and should be replaced with 'BLENDER_EEVEE_NEXT' in shading_styles.json."
|
"since Blender 5.0 and should be replaced with 'BLENDER_EEVEE' in shading_styles.json."
|
||||||
)
|
)
|
||||||
warning = True
|
warning = True
|
||||||
|
value = tool.Blender.get_eevee_name()
|
||||||
# @25.05.12
|
# @25.05.12
|
||||||
if path == "scene.display.shading.wireframe_color_type" and value == "MATERIAL":
|
if path == "scene.display.shading.wireframe_color_type" and value == "MATERIAL":
|
||||||
value = "THEME"
|
value = "THEME"
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ class BIM_PT_camera(Panel):
|
|||||||
# See #6686.
|
# See #6686.
|
||||||
if (
|
if (
|
||||||
props.has_underlay
|
props.has_underlay
|
||||||
and str(render.engine) == "BLENDER_EEVEE_NEXT"
|
and str(render.engine) == tool.Blender.get_eevee_name()
|
||||||
and ((megapixels := (render.resolution_x * render.resolution_y / 10**6)) > MEGAPIXELS_WARNING_THRESHOLD)
|
and ((megapixels := (render.resolution_x * render.resolution_y / 10**6)) > MEGAPIXELS_WARNING_THRESHOLD)
|
||||||
):
|
):
|
||||||
box = self.layout.box()
|
box = self.layout.box()
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ def update_shadow_mode(self: "BIMSolarProperties", context: bpy.types.Context) -
|
|||||||
context.scene.collection.objects.link(sun)
|
context.scene.collection.objects.link(sun)
|
||||||
sun_props.sun_object = sun
|
sun_props.sun_object = sun
|
||||||
update_sun_path(self)
|
update_sun_path(self)
|
||||||
context.scene.render.engine = "BLENDER_EEVEE_NEXT"
|
context.scene.render.engine = tool.Blender.get_eevee_name()
|
||||||
assert context.scene.display
|
assert context.scene.display
|
||||||
assert context.scene.display.shading
|
assert context.scene.display.shading
|
||||||
context.scene.display.shading.light = "FLAT"
|
context.scene.display.shading.light = "FLAT"
|
||||||
|
|||||||
@@ -2084,3 +2084,14 @@ class Blender(bonsai.core.tool.Blender):
|
|||||||
assert bpy.context.preferences
|
assert bpy.context.preferences
|
||||||
if props_updated and bpy.context.preferences.use_preferences_save:
|
if props_updated and bpy.context.preferences.use_preferences_save:
|
||||||
bpy.ops.wm.save_userpref()
|
bpy.ops.wm.save_userpref()
|
||||||
|
|
||||||
|
@classmethod
|
||||||
|
def get_eevee_name(cls) -> Literal["BLENDER_EEVEE"] | Literal["BLENDER_EEVEE_NEXT"]:
|
||||||
|
"""Convenience method to get correct eevee render engine name in multiple Blender versions.
|
||||||
|
|
||||||
|
In Blender 4.2 eevee was renamed to "eevee next".
|
||||||
|
In Blender 5 eevee next is now just "eevee" again.
|
||||||
|
"""
|
||||||
|
if cls.BLENDER_5:
|
||||||
|
return "BLENDER_EEVEE"
|
||||||
|
return "BLENDER_EEVEE_NEXT"
|
||||||
|
|||||||
Reference in New Issue
Block a user