code/vexptoolbox/replay.py
def _update_nodes(self):
        """ Create replay node objects and UI items """
        COLORS = {'gaze3d': viz.RED, 'view': viz.BLUE}

        # Remove all previous checkbox UI objects
        if self._ui is not None: 
            for node in self._nodes.keys():
                self._nodes[node]['ui'].remove()
        self._nodes = {}

        for node in self.replay_nodes:
            self._nodes[node] = {'visible': True}
            if node in COLORS:
                # Consistent colors for built-in nodes
                self._nodes[node]['color'] = COLORS[node]
            else:
                # Generate a random color
                self._nodes[node]['color'] = colorsys.hsv_to_rgb(random.uniform(0.0, 1.0), 
                                                                 random.uniform(0.4, 1.0), 
                                                                 random.uniform(0.5, 1.0))
            if node == 'view':
                self._nodes[node]['obj'] = vizshape.addAxes(scale=[0.1, 0.1, 0.1], color=self._nodes[node]['color'])
            else:
                self._nodes[node]['obj'] = vizshape.addSphere(radius=0.01, color=self._nodes[node]['color'])

            if self._ui is not None:
                self._nodes[node]['ui'] = self._ui.addLabelItem(node, viz.addCheckbox())
                self._nodes[node]['ui'].label.color(self._nodes[node]['color'])
                self._nodes[node]['ui'].set(1)
                self._nodes[node]['callback'] = vizact.onbuttonup(self._nodes[node]['ui'], self._ui_set_node_visibility, node)
                self._nodes[node]['callback'] = vizact.onbuttondown(self._nodes[node]['ui'], self._ui_set_node_visibility, node)

        # Enable / disable gaze settings based on data availability
        for eye_pos in list(self._gaze.keys()):
            if self._gaze[eye_pos]['data']:
                self._gaze[eye_pos]['ui'].enable()
                if self._gaze[eye_pos]['node'] is None:
                    self._gaze[eye_pos]['ui'].select(0)
                elif self._gaze[eye_pos]['node'] == 'eye':
                    self._gaze[eye_pos]['ui'].select(1)
                elif self._gaze[eye_pos]['node'] == 'axes':
                    self._gaze[eye_pos]['ui'].select(2)
            else:
                self._gaze[eye_pos]['ui'].disable()
 Create replay node objects and UI items 
Create replay node objects and UI items
Create replay node objects and UI items
def _update_nodes(self):
        COLORS = {'gaze3d': viz.RED, 'view': viz.BLUE}
        if self._ui is not None: 
            for node in self._nodes.keys():
                self._nodes[node]['ui'].remove()
        self._nodes = {}
        for node in self.replay_nodes:
            self._nodes[node] = {'visible': True}
            if node in COLORS:
                self._nodes[node]['color'] = COLORS[node]
            else:
                self._nodes[node]['color'] = colorsys.hsv_to_rgb(random.uniform(0.0, 1.0), 
                                                                 random.uniform(0.4, 1.0), 
                                                                 random.uniform(0.5, 1.0))
            if node == 'view':
                self._nodes[node]['obj'] = vizshape.addAxes(scale=[0.1, 0.1, 0.1], color=self._nodes[node]['color'])
            else:
                self._nodes[node]['obj'] = vizshape.addSphere(radius=0.01, color=self._nodes[node]['color'])
            if self._ui is not None:
                self._nodes[node]['ui'] = self._ui.addLabelItem(node, viz.addCheckbox())
                self._nodes[node]['ui'].label.color(self._nodes[node]['color'])
                self._nodes[node]['ui'].set(1)
                self._nodes[node]['callback'] = vizact.onbuttonup(self._nodes[node]['ui'], self._ui_set_node_visibility, node)
                self._nodes[node]['callback'] = vizact.onbuttondown(self._nodes[node]['ui'], self._ui_set_node_visibility, node)
        for eye_pos in list(self._gaze.keys()):
            if self._gaze[eye_pos]['data']:
                self._gaze[eye_pos]['ui'].enable()
                if self._gaze[eye_pos]['node'] is None:
                    self._gaze[eye_pos]['ui'].select(0)
                elif self._gaze[eye_pos]['node'] == 'eye':
                    self._gaze[eye_pos]['ui'].select(1)
                elif self._gaze[eye_pos]['node'] == 'axes':
                    self._gaze[eye_pos]['ui'].select(2)
            else:
                self._gaze[eye_pos]['ui'].disable()
def _update_nodes ( self ) : COLORS = { 'gaze3d' : viz . RED , 'view' : viz . BLUE } if self . _ui is not None : for node in self . _nodes . keys ( ) : self . _nodes [ node ] [ 'ui' ] . remove ( ) self . _nodes = { } for node in self . replay_nodes : self . _nodes [ node ] = { 'visible' : True } if node in COLORS : self . _nodes [ node ] [ 'color' ] = COLORS [ node ] else : self . _nodes [ node ] [ 'color' ] = colorsys . hsv_to_rgb ( random . uniform ( 0.0 , 1.0 ) , random . uniform ( 0.4 , 1.0 ) , random . uniform ( 0.5 , 1.0 ) ) if node == 'view' : self . _nodes [ node ] [ 'obj' ] = vizshape . addAxes ( scale = [ 0.1 , 0.1 , 0.1 ] , color = self . _nodes [ node ] [ 'color' ] ) else : self . _nodes [ node ] [ 'obj' ] = vizshape . addSphere ( radius = 0.01 , color = self . _nodes [ node ] [ 'color' ] ) if self . _ui is not None : self . _nodes [ node ] [ 'ui' ] = self . _ui . addLabelItem ( node , viz . addCheckbox ( ) ) self . _nodes [ node ] [ 'ui' ] . label . color ( self . _nodes [ node ] [ 'color' ] ) self . _nodes [ node ] [ 'ui' ] . set ( 1 ) self . _nodes [ node ] [ 'callback' ] = vizact . onbuttonup ( self . _nodes [ node ] [ 'ui' ] , self . _ui_set_node_visibility , node ) self . _nodes [ node ] [ 'callback' ] = vizact . onbuttondown ( self . _nodes [ node ] [ 'ui' ] , self . _ui_set_node_visibility , node ) for eye_pos in list ( self . _gaze . keys ( ) ) : if self . _gaze [ eye_pos ] [ 'data' ] : self . _gaze [ eye_pos ] [ 'ui' ] . enable ( ) if self . _gaze [ eye_pos ] [ 'node' ] is None : self . _gaze [ eye_pos ] [ 'ui' ] . select ( 0 ) elif self . _gaze [ eye_pos ] [ 'node' ] == 'eye' : self . _gaze [ eye_pos ] [ 'ui' ] . select ( 1 ) elif self . _gaze [ eye_pos ] [ 'node' ] == 'axes' : self . _gaze [ eye_pos ] [ 'ui' ] . select ( 2 ) else : self . _gaze [ eye_pos ] [ 'ui' ] . disable ( )
Create replay node objects and UI items
Create replay node objects and UI items
""" Create replay node objects and UI items """ # Remove all previous checkbox UI objects # Consistent colors for built-in nodes # Generate a random color # Enable / disable gaze settings based on data availability
self