Skip to content

Commit

Permalink
improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
vanous committed Dec 10, 2023
1 parent 5c006d1 commit 499a096
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
13 changes: 5 additions & 8 deletions acn.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,11 @@ def enable():
if universe == 0: # invalid for sACN
continue
DMX_sACN._instance.receiver.register_listener("universe", DMX_sACN.callback, universe=universe)
if os.name == "posix":
for card in DMX_Network.cards(None, None):
interface_addr = card[0]
print("Joining sACN universe:", universe, interface_addr)
DMX_Log.log.info(("Joining sACN universe:", universe, interface_addr))
DMX_sACN._instance.receiver.join_multicast(universe, interface_addr)
else: # windows
DMX_sACN._instance.receiver.join_multicast(universe)
for card in DMX_Network.cards(None, None):
interface_addr = card[0]
print("Joining sACN universe:", universe, interface_addr)
DMX_Log.log.info(("Joining sACN universe:", universe, interface_addr))
DMX_sACN._instance.receiver.join_multicast(universe, interface_addr)
bpy.app.timers.register(DMX_sACN.run_render)
dmx.artnet_status = "listen"

Expand Down
5 changes: 4 additions & 1 deletion data.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,10 @@ def set_universe(universe, data, source):
if DMX_Data._last_updated is None or (time.time() - DMX_Data._last_updated > 0.8 and changed):
# We limit update by time, too fast updates were troubling Blender's UI
for idx, val in enumerate(data):
dmx.dmx_values[idx].channel = val
try:
dmx.dmx_values[idx].channel = val
except Exception as e:
print(e)
DMX_Data._last_updated = time.time()
print("update dmx")

Expand Down
2 changes: 1 addition & 1 deletion sacn/receiver.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def remove_listener_from_universe(self, universe: int) -> None:
"""
self._callbacks.pop(universe, None)

def join_multicast(self, universe: int, interface_addr: str) -> None:
def join_multicast(self, universe: int, interface_addr: str = "") -> None:
"""
Joins the multicast address that is used for the given universe. Note: If you are on Windows you must have given
a bind IP-Address for this feature to function properly. On the other hand you are not allowed to set a bind
Expand Down

0 comments on commit 499a096

Please sign in to comment.