Macro Transform All Mesh Components Contained Within

I’m trying to optimize my construction script by collapsing the spaghetti-like mess of many Add Static Mesh Components. They currently form an apartment and I would like to reuse this Macro in the same script but with a transform applied to additional copies. So effectively I would like a copy of this apartment on top of it. I cannot figure out the best way to do this, I guessing on adding a Transform input to the Macro but here is where I am stumped.

There’s 20 different meshes which are mostly unique so this sounds like it would be the most efficient method I’m guessing. Can someone maybe suggest how I could use a Transform input to add a set number (the height) to add to the existing Z parameter of each mesh inside the macro?

Would greatly appreciate any help here please. Thanks

It’s worth noting, that you can call ‘call in editor’ custom events from the construction script.

If you parameterize what you have so far, you can just call a second version.

Also, why not just put a second copy of the BP on top?

Thanks a lot for taking the time to reply. Yeah, I did have it set up as a blueprint which was far easier, but have been requested to contain this inside a single blueprint for various reasons. In my naivety, I thought I might just be able to transform everything which is inside the macro, but I cannot figure out a way to do this. I’m coming from a Unity background, so my knowledge is limited in this area.

The BP cannot be placed on top, as the ground floor differs from the ones above.

For each SMC, you need to add a constant param to the Z, then you can put it in a macro/function.

Something like this:



Or are the SMCs already placed once manually?

Thanks so much. This will take me a little time to decipher and figure out what’s going on here, so I really appreciate the detailed explanation. I think this is on the right track, I’ll paste the current mess where I’m at now, excuse the crudeness of the script…

Much easier way, if you have first placed them manually:


Thanks, that makes far more sense to my level of experience with UE. Much appreciate the detailed breakdown.

No worries.

I think the other was a bit cumbersome.

This way, you can just lay the whole thing out, and the duplicate it :slight_smile:

Yeah, it was horrifically cumbersome but that’s my current experience level of UE. it will certainly take me a while to get my head adjusted to the UE4 Blueprints coming from years of frustration of Unity, but they seem to actually be fairly logical and use common sense.

Another quick question then if you don’t mind, in the example below for instance, could you help me out with a better way to compose this;

I’m sure there’s a probably a very simple way to include the previous result from the int switching. Thanks.

I meant my previous example was a bit cumbersome :wink:

As for the switch, you already have the minimal pattern. Because the switch isn’t a sequence, it doesn’t know what’s coming next.

Oh ok, as each macro simply passes from the input to the output, I hoped that there was some magical node which allowed stacking of these. I suppose I could set a boolean check and branch that way. I was just trying to avoid having blueprints inside blueprints inside blueprints. without tying my head up in knots.

Cheers again for the help!

1 Like