Separating model and vertex colours

Hello, gang.

Apologies if this is an unorthodox question, but what I’m ultimately trying to achieve is: I wish to have a model in its own EGG file, complete with verts and UVs, but have the vertex colours in another file and “merge” the two when the model is loaded. Obviously this is so I can reuse the model data from a single source and change the appearance slightly by changing the vertex colours, rather than saving duplicates of the model.

I’ve done a lot of searching and can’t find anything. In creating my own solution, a challenge is posed by the fact that Panda may change vertices when the model is loaded - so something like a simple lookup might not be reliable. So far I’m thinking either a) write a custom model loader; or b) have two UV sets on the model, with one for the texture and another pointing to the vertex colours baked into an image and then when the model is loaded, iterate over the geometry updating each vertex’s colour based on the 2nd UV; or c) perhaps you folks can recommend a better alternative.

Any input at all would be appreciated. Thanks in advance.

Do you have many different vertices with different colors you intend to change? Otherwise it might be sufficient enough to just use a Material on your model which colors you then change.

I guess the baked vertex colors could work - but it would certainly help to know the use case to be able to make suggestions.

Thanks for the response. In this instance, the colour data may either be used for colouring as usual - or in other cases may be used by a shader for effects (e.g. texture splatting). I can think of workarounds without using the vertex colour array, but it would be ideal to be able to leverage it. The main point of this question is just making sure I didn’t miss anything in the docs that would allow me to be able to do this without rolling my own code. If not, that’s fine.