MIDs for Sub-Meshes

Hi all,

cannot figure this out. I have a gun model that is in 3 sub-meshes (3ds Max Objects - not components): Body, Bullet and Trigger. The latter, Trigger, is not a traditional trigger, but a simple prism shape that is supposed to be a light beam used as a trigger (i.e. the player’s finger breaks the beam to fire).
Originally, I animated the firing mechanism in Max and included animating the visibility of the trigger beam. Only UE4 seems to ignore the visibility animation (which is a real pain). So I set up a parametrized material that I would animate in the Gun (Skeletal Mesh) blueprint. The aim being to create a MID (Material Instance Dynamic) in the construction graph, and timeline it on a custom event (e.g. “PullTrigger”) to fade in and out at the correct timings to match the fire animation.

Herein is the problem. I can see no way of getting the mesh component/sub-mesh for the trigger to apply the material to when created in the Construction Graph.

I know I could split the trigger into a static mesh and add it to the BP as a component instead, but this would be a pain as I would have to do a lot of reworking in 3ds Max (animations mostly). My other alternative is to do it in C++ (assuming I can split the mesh to components/sub-meshes in cpp).

Anyone got any idea how to do this in BP?

If the gun uses only one material, ou could make a small mask that covers only the trigger part of the texture.
Connect your texture to a multiply node and a vector 1 (or three) and convert that to parameter.
now this vector 1 will be available in a material instance which can be adressed by the blueprint.
all you then need to do is change the value of the parameter when using the gun.
with some creativity you could even make it go red when out of ammo etc.

Hope that gives you some idea’s on how to achieve it.

Cheers for the reply. Model has a number of materials unfortunately - it is a futuristic weapon with battery/cartridge slot/control panel/etc all with their own materials and the barrel and body are also separate (in 3DS Max they are multi-Material parts, but UE separates into individual materials, which makes sense). I have opted to split the trigger “volume” out as a second mesh (static) and added it in the BluePrint.
Really think BP should be able to break sub meshes out though - will probably write a C++ node to do this if I hit the same problem again :).

Marked your’s as the answer as it would have been a good choice if it fit my particular problem (as so others with similar problems may find it of use). Cheers again