arch viz data smith change material for array of static meshes

HI
i am using unreal for arch viz project
i want to change the material of the walls , material A with material B by pressing x
and since i used data smith to convert my 3ds scene to unreal , the problem is :

  • i have many many objects with material A …
  • some objects came as actors and some came as static mesh actors …
  • i used multisub materials in 3ds max , so when exporting to unreal , the material A came as element 0 in some object and as element 1 in other and element 2 in other … etc, and in some objects the material A is in element 0 and in element 1…
  • i want to use blueprint level since everything is already in its place …
    so i tried it on 4 static meshes as in attached picture

it worked but :
1 - how to add actors to the array of static meshes …
2 - when pressing x … the objects changed materials randomly between a and b , not all of them together to a then by pressing x into b …
3 - how to pick which element to change for every object …

I have exactly the same problem.

Haven’t used DataSmith so can’t help you with material indexing.

1 - how to add actors to the array of
static meshes

Actors are actors and static meshes are static meshes. They are 2 separate things. You can group each into their respective arrays in many ways. One of them is demonstrated in your screenshot. You can use Tags, it’s very powerful when used right. You can use Get All Actors Of Class, you can use Get All Components.

2 - when pressing x … the objects
changed materials randomly between a
and b , not all of them together to a
then by pressing x into b

You’re using FlipFlop so you’re changing every second one of them, and the last one you change twice since your completed executes 1 extra time. Drop the FlipFlop node.

3 - how to pick which element to
change for every object …

You could try Getting the material out of the static mesh, check what it is and then decide using a condition.

thanks man for replying it was so kind of you …
i tried to make array of actor but the problem is it won’t connect material target with the array ( primitive not compatible with actor reference) …
here screen shot…

and i saw your tags method before on some question and tested it and it worked but with class blueprint , i did not know how to make it work in level blueprint

and regarding to drop the flip-flop not … i did not understand why … as i understand from watching many tutorial it is the best way to flip between 2 materials … and i tried deleting it but i lost the flip between the two materials … maybe i did not explain so here is an attached image for what i meant by pressing x …

![alt text][3]
as u can see not all the object turn to white together and turn to gold together

try using multi gate instead of flip-flop

You’ll need to reference the static mesh that is in your actor to change its material. What’s in your actor?
To change different material elements, you just need to change the ‘element index’ in your ‘set material’ node to 1, 2, 3 etc, according to how it’s been created in 3ds max.

well … i tried it but it won’t change between the materials though loop is checked

HI slam937
the index part worked , thanks very much for this …
but i did not know how to connect the actor with the static mesh like u did in your screenshot !!!
what to type to get this target static mesh with two nodes ?

What is your actor? Is it a blueprint actor or an empty actor that’s parenting static meshes in your scene? If it’s a blueprint actor you should have static mesh components in there which you need to reference to change its material. Either way, you’ll need to reference the correct static meshes.

i did not put any thing inside the actor , i just imported the scene from 3ds max and some object came as static meshes and some came as actors . … i think it represent the position rotate and scale of the object in 3ds max …
here is an example [1]:

please bear with me , this is my first month with unreal

So in that case you will have to reference object054 in your level blueprint > then type ‘get object054_pivot’ to get that static mesh > then connect that to the target in the ‘set material’ node. You’ll have to ensure that your multi sub material slots are assigned correctly to make referencing all the actors/meshes to change easier for yourself. Though this seems like a tedious process if you have lots of actors/meshes to change… maybe someone else has a more efficient method to do this for datasmith objects? Maybe component tags? Unfortunately I’m not too familiar with datasmith.

Could you try something like this? Make sure you specify the Actor Tag in the actors in the level

thanks slam937

i tried it but it did not work , only affected the static meshes