Assign material to a component instance or group


#1

Hi, when dropping a material on a component instance, will it apply/set it to every Face inside or just to the instance.material member ?


#2

It applies only to the instance as a whole. Individual entities in the component definition’s entities collection will still have nil material.


#3

So the Faces that have nil will use that instance material, and those who already have a material will continue to use theirs. Yeah, thanks :slight_smile:


#4

Btw, it seems if I assign a brick texture to a box instance, in SU you can see proper bricks tiled ok, but the Face-s do not have proper UV generated yet. Only when I assign material per face, the face gets new UVs based on the material applied :slight_smile:


#5

Yes. Materials only get uv when assigned to faces, not to the component instance wrapper.


#6

Yep, this will slightly complicate my exporter :D, thanks for confirmation.


#7

So how come the texture looks ok on the instanced component if the Faces inside the definition do not have proper UVs ? or are they using the instance material tiling to multiply with those definition UVs (0-1 range default)


#8

How do I compute the tiling factors from material.texture.width and height? to be multiplied with the existing Face UVs


#9

Seems that the Face UVs are garbage if no material assigned on them specifically, so SU maybe its doing on the fly UV generation for each instance or something.