UMaterialInstanceDynamic::InitializeVectorParameterAndGetIndex

Use this function to set an initial value and fetch the index for use in the following function.