def METHOD_NAME(self, b_material, n_mat_prop, b_dtype, n_dtype):
    """Export the material alpha or color controller data."""
    # get fcurves
    fcurves = [fcu for fcu in b_material.animation_data.action.fcurves if b_dtype in fcu.data_path]
    if not fcurves:
        return
    # just set the names of the nif data types, main difference between alpha and color
    if b_dtype == "alpha":
        keydata = "NiFloatData"
        interpolator = "NiFloatInterpolator"
        controller = "NiAlphaController"
    else:
        keydata = "NiPosData"
        interpolator = "NiPoint3Interpolator"
        controller = "NiMaterialColorController"
    # create the key data
    n_key_data = block_store.create_block(keydata, fcurves)
    n_key_data.data.num_keys = len(fcurves[0].keyframe_points)
    n_key_data.data.interpolation = NifClasses.KeyType.LINEAR_KEY
    n_key_data.data.reset_field("keys")
    # assumption: all curves have same amount of keys and are sampled at the same time
    for i, n_key in enumerate(n_key_data.data.keys):
        frame = fcurves[0].keyframe_points[i].co[0]
        # add each point of the curves
        n_key.arg = n_key_data.data.interpolation
        n_key.time = frame / self.fps
        if b_dtype == "alpha":
            n_key.value = fcurves[0].keyframe_points[i].co[1]
        else:
            n_key.value.x, n_key.value.y, n_key.value.z = [fcu.keyframe_points[i].co[1] for fcu in fcurves]
    # if key data is present
    # then add the controller so it is exported
    if fcurves[0].keyframe_points:
        n_mat_ctrl = block_store.create_block(controller, fcurves)
        n_mat_ipol = block_store.create_block(interpolator, fcurves)
        n_mat_ctrl.interpolator = n_mat_ipol
        self.set_flags_and_timing(n_mat_ctrl, fcurves)
        # set target color only for color controller
        if n_dtype:
            n_mat_ctrl.set_target_color(n_dtype)
        n_mat_ctrl.data = n_key_data
        n_mat_ipol.data = n_key_data
        # attach block to material property
        n_mat_prop.add_controller(n_mat_ctrl)