From 911b15d2e875b7b89c097068e962e1832ad84bf0 Mon Sep 17 00:00:00 2001 From: vanous Date: Fri, 30 Aug 2024 18:26:46 +0200 Subject: [PATCH] Handle gobo (not) rotation --- fixture.py | 8 +++++--- panels/programmer.py | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/fixture.py b/fixture.py index 28db5e5..741add4 100644 --- a/fixture.py +++ b/fixture.py @@ -1164,9 +1164,11 @@ def updateGobo(self, gobo, n, current_frame): DMX_Log.log.debug(("update gobo", gobo, n)) self.hide_gobo([n], False, current_frame=current_frame) index = int(gobo[0]/int(255/(gobos.count-1))) - self.set_gobo(n, index, current_frame=current_frame) - + self.set_gobo_slot(n, index, current_frame=current_frame) + if gobo[1] is not None: + self.set_gobo_rotation(gobo, n, current_frame=current_frame) + def set_gobo_rotation(self, gobo, n, current_frame): for obj in self.collection.objects: #EEVEE if "gobo" in obj.get("geometry_type", ""): material = self.gobo_materials[obj.name].material @@ -1428,7 +1430,7 @@ def clear(self): DMX_Data.set(self.universe, self.address+i, ch.default) self.render() - def set_gobo(self, n, index=-1, current_frame=None): + def set_gobo_slot(self, n, index=-1, current_frame=None): gobos = self.images[f"gobos{n}"] for obj in self.collection.objects: #EEVEE if "gobo" in obj.get("geometry_type", ""): diff --git a/panels/programmer.py b/panels/programmer.py index b0d1526..be3b553 100644 --- a/panels/programmer.py +++ b/panels/programmer.py @@ -528,9 +528,11 @@ def draw(self, context): box.prop(scene.dmx, "programmer_iris", text=_("Iris"), translate=False) if selected_fixtures[0].has_attributes(["Gobo1"]): box.prop(scene.dmx, "programmer_gobo1", text=_("Gobo1"), translate=False) + if selected_fixtures[0].has_attributes(["Gobo1Pos", "Gobo1PosRotate"]): box.prop(scene.dmx, "programmer_gobo_index1", text=_("Gobo1 Rotation"), translate=False) if selected_fixtures[0].has_attributes(["Gobo2"]): box.prop(scene.dmx, "programmer_gobo2", text=_("Gobo2"), translate=False) + if selected_fixtures[0].has_attributes(["Gobo2Pos", "Gobo2PosRotate"]): box.prop(scene.dmx, "programmer_gobo_index2", text=_("Gobo2 Rotation"), translate=False) if selected_fixtures[0].has_attributes(["shutter"], lower=True): box.prop(scene.dmx, "programmer_shutter", text=_("Strobe"), translate=False)