When I cache out instanced pflow geometry with multiple mat IDs (I have ID 1 and ID 2 assigned to various faces in the instanced particle geo), the resulting Xmesh shifts the mat IDs to mat ID 2 and 3.
If I cache it out assigned with 2 and 3, it seems to come across fine - it seems to only shift when mat ID 1 is assigned.
I also have some issues that when the particles move to a new event, the mat IDs get messed up. It seems to fine when rendered straight out of pFlow, but when I Xmesh it there are issues.
Has anyone else experienced this?
Would it be possible for you to please send us a scene file that reproduces this problem? You can send us files by using our ticket system. Note that you may need to ZIP your scene file to get it through.
Can you load the resulting MultiMaterial created by XMesh? (It saves a material library file in the output folder).
I am pretty sure that we keep a placeholder for faces that have no valid material or something like that, which would explain why your other materials would shift to 2 and 3.
In general, we convert all materials to a new MultiMaterial and there is no guarantee that the IDs will be preserved when you store the materials. This is especially tricky with PFlow and TP or when saving multiple objects, each with its own material(s).
XMesh guarantees only that the rendering will look the same in the end, but not that the Face MaterialIDs will be preserved as we have to compress multiple materials into a single MultiMaterial.
Also note that XMesh MX Saver has an Advanced option to deal with Missing Materials (do nothing, use gray, use red, use material with object color as diffuse).
If your PFlow has even a single particle that does not get its mesh+material from a Shape Instance, it could cause a stand-in material #1 to be inserted in the final MultiMaterial. I would suggest setting the Advanced option to RED NEON - if there are any faces getting no material and defaulting to ID 1, you would see them clearly in the viewport.
I could be wrong though and your problem could be an actual bug. Let’s see the scene…
I’ve tried to recreate the bug in a fresh scene and everything seems to be working fine. Not sure if it was some kind of super-fluke or what?
We were able to work around it by putting a material static into the render node on pflow (rather than just adopting the mats and UVs via shape instance) - this seems to force the material onto the particles and it Xmeshed without issue.