mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-09 13:52:23 +00:00
More python 3.14 fixes, see 9bac66a
This commit is contained in:
@@ -837,7 +837,11 @@ class BIM_ADDON_preferences(bpy.types.AddonPreferences):
|
|||||||
gizmo_prop_names = {p.attr_name for p in GizmoDoorEdition.dimension_gizmo_props}
|
gizmo_prop_names = {p.attr_name for p in GizmoDoorEdition.dimension_gizmo_props}
|
||||||
# Add special gizmos not in dimension_gizmo_props
|
# Add special gizmos not in dimension_gizmo_props
|
||||||
gizmo_prop_names.update(("swing_arc", "flip_arc"))
|
gizmo_prop_names.update(("swing_arc", "flip_arc"))
|
||||||
for prop in door_gizmos.__annotations__:
|
try:
|
||||||
|
annotations = door_gizmos.__annotations__
|
||||||
|
except AttributeError:
|
||||||
|
annotations = type(door_gizmos).__annotations__
|
||||||
|
for prop in annotations:
|
||||||
if prop in gizmo_prop_names:
|
if prop in gizmo_prop_names:
|
||||||
layout.prop(door_gizmos, prop)
|
layout.prop(door_gizmos, prop)
|
||||||
|
|
||||||
@@ -846,7 +850,11 @@ class BIM_ADDON_preferences(bpy.types.AddonPreferences):
|
|||||||
|
|
||||||
window_gizmos = self.gizmos.window
|
window_gizmos = self.gizmos.window
|
||||||
gizmo_prop_names = {p.attr_name for p in GizmoWindowEdition.dimension_gizmo_props}
|
gizmo_prop_names = {p.attr_name for p in GizmoWindowEdition.dimension_gizmo_props}
|
||||||
for prop in window_gizmos.__annotations__:
|
try:
|
||||||
|
annotations = window_gizmos.__annotations__
|
||||||
|
except AttributeError:
|
||||||
|
annotations = type(window_gizmos).__annotations__
|
||||||
|
for prop in annotations:
|
||||||
if prop in gizmo_prop_names:
|
if prop in gizmo_prop_names:
|
||||||
layout.prop(window_gizmos, prop)
|
layout.prop(window_gizmos, prop)
|
||||||
|
|
||||||
@@ -857,7 +865,11 @@ class BIM_ADDON_preferences(bpy.types.AddonPreferences):
|
|||||||
gizmo_prop_names = {p.attr_name for p in GizmoStairEdition.dimension_gizmo_props}
|
gizmo_prop_names = {p.attr_name for p in GizmoStairEdition.dimension_gizmo_props}
|
||||||
# Add special gizmos not in dimension_gizmo_props
|
# Add special gizmos not in dimension_gizmo_props
|
||||||
special_gizmo_names = {"lock", "plus", "minus", "cycle"}
|
special_gizmo_names = {"lock", "plus", "minus", "cycle"}
|
||||||
for prop in stair_gizmos.__annotations__:
|
try:
|
||||||
|
annotations = stair_gizmos.__annotations__
|
||||||
|
except AttributeError:
|
||||||
|
annotations = type(stair_gizmos).__annotations__
|
||||||
|
for prop in annotations:
|
||||||
if prop in gizmo_prop_names or prop in special_gizmo_names:
|
if prop in gizmo_prop_names or prop in special_gizmo_names:
|
||||||
layout.prop(stair_gizmos, prop)
|
layout.prop(stair_gizmos, prop)
|
||||||
|
|
||||||
|
|||||||
@@ -553,7 +553,11 @@ class Snap(bonsai.core.tool.Snap):
|
|||||||
def filter_snapping_points_by_type(snapping_points):
|
def filter_snapping_points_by_type(snapping_points):
|
||||||
options = ["Plane", "Axis"]
|
options = ["Plane", "Axis"]
|
||||||
props = tool.Snap.get_snap_props()
|
props = tool.Snap.get_snap_props()
|
||||||
for prop in props.__annotations__.keys():
|
try:
|
||||||
|
annotations = props.__annotations__
|
||||||
|
except AttributeError:
|
||||||
|
annotations = type(props).__annotations__
|
||||||
|
for prop in annotations.keys():
|
||||||
if getattr(props, prop):
|
if getattr(props, prop):
|
||||||
options.append(props.rna_type.properties[prop].name)
|
options.append(props.rna_type.properties[prop].name)
|
||||||
|
|
||||||
@@ -563,7 +567,11 @@ class Snap(bonsai.core.tool.Snap):
|
|||||||
def filter_snapping_points_by_group(detected_snaps):
|
def filter_snapping_points_by_group(detected_snaps):
|
||||||
options = ["Wireframe", "Axis", "Plane"]
|
options = ["Wireframe", "Axis", "Plane"]
|
||||||
props = tool.Snap.get_snap_groups()
|
props = tool.Snap.get_snap_groups()
|
||||||
for prop in props.__annotations__.keys():
|
try:
|
||||||
|
annotations = props.__annotations__
|
||||||
|
except AttributeError:
|
||||||
|
annotations = type(props).__annotations__
|
||||||
|
for prop in annotations.keys():
|
||||||
if getattr(props, prop):
|
if getattr(props, prop):
|
||||||
options.append(props.rna_type.properties[prop].name)
|
options.append(props.rna_type.properties[prop].name)
|
||||||
filtered_groups = [group for group in detected_snaps if group["group"] in options]
|
filtered_groups = [group for group in detected_snaps if group["group"] in options]
|
||||||
|
|||||||
@@ -96,7 +96,11 @@ class PanelSpy:
|
|||||||
|
|
||||||
def __getattr__(self, attr: str) -> PanelSpy | Any:
|
def __getattr__(self, attr: str) -> PanelSpy | Any:
|
||||||
self.spied_attr = attr
|
self.spied_attr = attr
|
||||||
if annotation := self.blender_panel.__annotations__.get(attr, None):
|
try:
|
||||||
|
annotations = self.blender_panel.__annotations__
|
||||||
|
except AttributeError:
|
||||||
|
annotations = type(self.blender_panel).__annotations__
|
||||||
|
if annotation := annotations.get(attr, None):
|
||||||
return annotation.keywords.get("default", None) # An operator property
|
return annotation.keywords.get("default", None) # An operator property
|
||||||
if attr == "layout":
|
if attr == "layout":
|
||||||
return self
|
return self
|
||||||
@@ -136,7 +140,11 @@ class PanelSpy:
|
|||||||
prop_type = props.bl_rna.properties[name].type
|
prop_type = props.bl_rna.properties[name].type
|
||||||
enum_items = []
|
enum_items = []
|
||||||
if prop_type == "ENUM":
|
if prop_type == "ENUM":
|
||||||
prop_keywords = props.__annotations__[name].keywords
|
try:
|
||||||
|
annotations = props.__annotations__
|
||||||
|
except AttributeError:
|
||||||
|
annotations = type(props).__annotations__
|
||||||
|
prop_keywords = annotations[name].keywords
|
||||||
items = prop_keywords.get("items")
|
items = prop_keywords.get("items")
|
||||||
if items is not None:
|
if items is not None:
|
||||||
if isinstance(items, (list, tuple)):
|
if isinstance(items, (list, tuple)):
|
||||||
|
|||||||
Reference in New Issue
Block a user