Clipping: Geschoss-Wechsel loescht Plane nicht mehr
Bug: React's SET_ACTIVE-Message schickt nur Minimal-Payload
`{id, name, isGeschoss, okff}` — ohne hasClipping/schnitthoehe.
`_update_clipping` las `enabled = active_z.get("hasClipping")` aus
diesem Minimal-Payload → False → Plane geloescht. Beim Zurueck-
wechseln auf EG mit aktiviertem Clipping war die Plane weg
obwohl der Toggle im Panel weiter „aktiv" zeigte.
Fix: `_update_clipping` nimmt nur die `id` aus dem uebergebenen
Hint (oder aus `dossier_active_id`) und holt sich den vollen
Geschoss-Record aus `dossier_zeichnungsebenen` doc.String. Damit
sind hasClipping, schnitthoehe, hoehe, visible immer verfuegbar.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
+17
-7
@@ -396,20 +396,30 @@ class EbenenBridge(panel_base.BaseBridge):
|
|||||||
except Exception: pass
|
except Exception: pass
|
||||||
|
|
||||||
def _update_clipping(self, active_z=None):
|
def _update_clipping(self, active_z=None):
|
||||||
"""Clipping-Plane folgt aktivem Geschoss — nur wenn dessen hasClipping=True."""
|
"""Clipping-Plane folgt aktivem Geschoss — nur wenn dessen hasClipping=True.
|
||||||
|
|
||||||
|
IMMER aus doc.Strings lesen statt das uebergebene `active_z` direkt zu
|
||||||
|
verwenden — der SET_ACTIVE-Pfad schickt ein Minimal-Payload (nur
|
||||||
|
id/name/isGeschoss/okff) ohne hasClipping/schnitthoehe. Wenn wir uns
|
||||||
|
darauf verließen, wuerde der Geschoss-Wechsel jede Clipping-Plane
|
||||||
|
loeschen weil enabled=False auswertet. Der persistierte Record in
|
||||||
|
doc.Strings hat die vollen Daten."""
|
||||||
doc = Rhino.RhinoDoc.ActiveDoc
|
doc = Rhino.RhinoDoc.ActiveDoc
|
||||||
if active_z is None:
|
# ID aus Hint oder aus dem persistierten active_id
|
||||||
z_raw = doc.Strings.GetValue("dossier_zeichnungsebenen")
|
active_id = None
|
||||||
|
if isinstance(active_z, dict):
|
||||||
|
active_id = active_z.get("id")
|
||||||
|
if not active_id:
|
||||||
active_id = doc.Strings.GetValue("dossier_active_id")
|
active_id = doc.Strings.GetValue("dossier_active_id")
|
||||||
|
# Vollen Record aus doc.Strings holen
|
||||||
|
z_raw = doc.Strings.GetValue("dossier_zeichnungsebenen")
|
||||||
if z_raw and active_id:
|
if z_raw and active_id:
|
||||||
try:
|
try:
|
||||||
z_list = json.loads(z_raw)
|
z_list = json.loads(z_raw)
|
||||||
active_z = next((z for z in z_list if z.get("id") == active_id), None)
|
active_z = next((z for z in z_list if z.get("id") == active_id), None)
|
||||||
except Exception:
|
except Exception:
|
||||||
active_z = None
|
pass
|
||||||
# Volles Dump des Active-Geschosses fuer Diagnose. Wenn hier
|
# Volles Dump des Active-Geschosses fuer Diagnose.
|
||||||
# hasClipping fehlt aber im UI gesetzt wurde, hat React's Dialog die
|
|
||||||
# Daten nicht weitergereicht (haeufig: WebView-Cache zeigt alte JS).
|
|
||||||
try:
|
try:
|
||||||
print("[CLIP] active_z keys: {}".format(
|
print("[CLIP] active_z keys: {}".format(
|
||||||
sorted(active_z.keys()) if active_z else None))
|
sorted(active_z.keys()) if active_z else None))
|
||||||
|
|||||||
Reference in New Issue
Block a user