(self, name)
Initialize an attribute: get the shader location, create the
        sliced buffers, and load the data.
Initialize an attribute: get the shader location, create the
        sliced buffers, and load the data.
Initialize an attribute : get the shader location create the sliced buffers and load the data .
def initialize_attribute(self, name):
        """Initialize an attribute: get the shader location, create the
        sliced buffers, and load the data."""
        # retrieve the location of that attribute in the shader
        location = self.shader_manager.get_attribute_location(name)
        variable = self.get_variable(name)
        variable['location'] = location
        # deal with reference attributes: share the same buffers between 
        # several different visuals
        if isinstance(variable.get('data', None), RefVar):
            
            # HACK: if the targeted attribute is indexed, we should
            # deactivate slicing here
            if self.renderer.visual_renderers[variable['data'].visual].use_index:
                log_debug("deactivating slicing")
                self.slicer = self.noslicer
            
            # use the existing buffers from the target variable
            target = self.resolve_reference(variable['data'])
            variable['sliced_attribute'] = SlicedAttribute(self.slicer, location,
                buffers=target['sliced_attribute'].buffers)
        else:
            # initialize the sliced buffers
            variable['sliced_attribute'] = SlicedAttribute(self.slicer, location)
def initialize_attribute ( self , name ) : # retrieve the location of that attribute in the shader location = self . shader_manager . get_attribute_location ( name ) variable = self . get_variable ( name ) variable [ 'location' ] = location # deal with reference attributes: share the same buffers between  # several different visuals if isinstance ( variable . get ( 'data' , None ) , RefVar ) : # HACK: if the targeted attribute is indexed, we should # deactivate slicing here if self . renderer . visual_renderers [ variable [ 'data' ] . visual ] . use_index : log_debug ( "deactivating slicing" ) self . slicer = self . noslicer # use the existing buffers from the target variable target = self . resolve_reference ( variable [ 'data' ] ) variable [ 'sliced_attribute' ] = SlicedAttribute ( self . slicer , location , buffers = target [ 'sliced_attribute' ] . buffers ) else : # initialize the sliced buffers variable [ 'sliced_attribute' ] = SlicedAttribute ( self . slicer , location )