Assign material instances to a static mesh material slots based on a csv file

Hallo,

I’m looking for an editor utility widget script, that would assign material instances to a static mesh material slots in its order based on a csv file.

I have the CSV file exported from Blender and the materials are in same order as they should be aligned to material slots.

Looks like this:

Can anyone help me please?
Thank you in advance.

tool.zip (133.9 KB)

Got it working for the most part. The filter in the last loop doesn’t seem to catch all of the objects so maybe a better way of iterating through the scene objects could help.

Readme.txt has more detailed info

1 Like

thank you for the example 3dRaven,
but it does not work for me somehow.

I mean, based on printed messages something is working, but nothing happens with your example cubes. There is no materials/mInstances asigned.

The example cube does not work because it is not being caught as a static mesh for some reason (it is not gathered from the level). Setting the class to none doesn’t work either as it leaves the list empty.
It does however gather the bsp & other static parts of the level (I used the 3rd person example in ue5).

It’s just a matter of filtering in the last step.

Perhaps this part could be mitigated with an apply to selected variation?

Unfortunately there is no find object by name function that would target the mesh directly. (You could use c++ but you would need the full path of the mesh in the csv :frowning: )

Hi there, I have actually solved this issue at source file in blender. Updating the material names in the exported FBX file did fixed this. No duplicate materials and correct assignment.
No further casting materials to mesh is needed.
But thank you for the effort, it is appreciated!
If anybody would be interested, this is the link for the solution in Blender:

Regards