How to work with custom primitive data when material has multiple slots?

You want two vector parameters both in separate materials and both need to have custom primitive data turned on.
The first one can have index 0 as it’s the first material
The second one needs to have it’s index offset by the amount of inputs inside of the first materials custom data node.

So if the first material starts with an index of 0 and is a vector 4 the it takes up 0,1,2,3 => so the next available index is 4 so have your second material’s custom index data start from 4.

Then when once you hook up the data just add the indexes and values in the custom data of the primitive.