Skip to content

Commit

Permalink
[python/viewer] Fix MacOS support.
Browse files Browse the repository at this point in the history
  • Loading branch information
duburcqa committed Jul 12, 2024
1 parent ed2af39 commit 631e55e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ def discard(self, owner: "InterfaceQuantity[ValueT]") -> None:
self.owners = tuple(self._weakrefs)

def reset(self,
*, ignore_auto_refresh: bool = False,
ignore_auto_refresh: bool = False,
reset_state_machine: bool = False) -> None:
"""Clear value stored in cache if any.
Expand Down Expand Up @@ -628,6 +628,7 @@ def reset(self,
ignore_other_instances=True)

# Reset shared cache
# pylint: disable=unexpected-keyword-arg
self.cache.reset(
ignore_auto_refresh=not self.env.is_simulation_running,
reset_state_machine=True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -648,9 +648,12 @@ def _open_offscreen_window(self,
# Set offscreen buffer frame properties.
# Note that accumulator bits and back buffers is not supported by
# resizeable buffers.
# Beware MSAA is very picky on MacOS regarding the image format, with
# only a few variant being supported.
# See https://github.com/panda3d/panda3d/issues/1121
# https://github.com/panda3d/panda3d/issues/756
fbprops = FrameBufferProperties()
fbprops.set_rgba_bits(8, 8, 8, 0)
fbprops.set_rgba_bits(8, 8, 8, 8)
fbprops.set_float_color(False)
fbprops.set_depth_bits(16)
fbprops.set_float_depth(True)
Expand Down
2 changes: 1 addition & 1 deletion python/jiminy_py/src/jiminy_py/viewer/viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1248,7 +1248,7 @@ def connect_backend(backend: Optional[str] = None) -> None:
for pid in psutil.pids():
try:
proc_info = Process(pid)
for conn in proc_info.connections("tcp4"):
for conn in proc_info.net_connections("tcp4"):
if conn.status != 'LISTEN' or \
conn.laddr.ip != '127.0.0.1':
continue
Expand Down

0 comments on commit 631e55e

Please sign in to comment.