Download

[REQUEST] Scale-Translate combine operations for "anchored scaling"

I know with BSP brushes, you can select a face and move it, effectively resizing the brush in one direction. This is a super-handy feature, but we need something similar for both Static Meshes and Blueprints which can be scaled.

Example case: I have a Blueprint which functions as a “level bounds”. Its Construction script generates five flat box collision meshes (4 walls and a ceiling) which, upon contact, trigger a force-field particle effect. At the corners, I use instanced static meshes which are procedurally duplicated vertically to match the size of the root cube’s bounds; these pillars are “force field emitters” which also have particle systems attached to them.

So, I use this box to bound my level. Problem is, suppose I’m designing the level, and I realize “I need the north wall to extend about 800 units outward to make room for this object here”.

In order to do this, I have to resize the object using the (at this point, very very far away) central scaling widget, calculate the difference between the new scale on this axis and the old scale, halve it, re-add that to the original scale, then subtract that value from the object’s location coordinate on that axis.

That’s a hell of a lot of steps for a simple “scale from this side” operation.

My intial theory on a solution involves a slight redesign of the transform gizmo. Basically, in scale mode, extended beyond the 3 main axis scales on both the positive and negative sides, six small circles. Clicking-and-dragging on these will perform a combination scale-and-transform operation which scales the object along an axis and transforms it inversely so that the opposite end to the one you’re dragging stays in place.

Failing that, some sort of macro which performs this converse-scaling operation maybe?

I get what you’re saying and kind of wanted something like this myself…

Let’s say you have a 2x2x2 cube centered on the origin, such that all of the vertices are either 0,1, or -1.

No wait, let’s simplify this to a one dimensional line with the points (-1,0,0) and (1,0,0). The center of this line is on the origin.

If we scale this line along the X axis, the scale is a multiplier applied to the X values. If we scale by a factor of 2, then the result is (-2,0,0) and (2,0,0). The vertices on both sides moved, and this is the problem you’re running into.

What you’re asking for is to anchor one of these vertices, so if you apply a 2x scale to one side, it doesn’t also move the other, correct? So, if you want to move the right side to become (2,0,0) you’d want the left to stay at (-1,0,0). The actual scale wouldn’t be a 2x scale though. It’d be a 1.5x scale. So, if you manually put in 2x with an anchor value, you’d get a position greater than (2,0,0) and that might cause confusion.

There’s a much easier solution that I found: Shift the origin from the center of your mesh to your anchor point.

The 1D line would move from {(-1,0,0),(1,0,0)} to {(0,0,0), (2,0,0)}. When you apply a scale to the object, the anchor point stays put because zero times the scale factor is always zero. You can now scale your wall to your hearts content, knowing that the other side isn’t going to move from where you placed it :smiley: No need to modify the engine.

You can’t dynamically shift your origin in that way. What if right now, I want to scale the North wall out by 800 units, and then later want to scale the East wall out by 600 units?

You don’t need to dynamically shift your origin, you can shift it within your 3D modeling program by offsetting your mesh by a translation so that the mesh’s anchor point is at the origin. The anchor for the wall would be baked into the local object space vertex points. Then, when you apply scaling to the objects, it all works the way you wanted it to.

a5ab7face597ddf8b7f22bfa3883ba1c9dffc6ab.png

Yeah, I know. And the problem is, that ONLY WORKS ONE WAY, which is what I was trying to explain to you.

What happens in your picture when, after scaling 800 units out from the right, I decide I also need to scale another 200 units out from the left? Now it’s the same problem; in order to perform this scaling operation, I need to also perform a translation operation to counteract it.

That’s EXACTLY the situation I’m in; I’ve got a single actor which functions as a “level boundary” and as I design the level I need to occasionally extend the level only on a single side. Which side is not something I can know in advance; sometimes I need to increase it by 800 units on the south side, sometimes on the north side. And every time I do, I have to also adjust the position of the entire actor to compensate for the dual-direction stretching. Changing that so that I only have to do that compensation half the time (if the vertex is in the corner rather than the center) is a minor improvement but certainly not a proper solution.

Hey Everybody,

Not to get your hopes up, but there is a feature to be able to move the pivot point temporarily. With the translate tool enabled, you can Alt+MMB Click on the white sphere at the center of the translate tool and drag. There is a bug in about not being able to manipulate the pivot point from any orthographic viewports, but perspective works.

Unfortunately, objects do not seem to scale relative to this temporary pivot point. I have reported this bug as UE-12176.

-Matt W.

Just wanted to leave an update. The bug I entered has been fixed and verified internally.