Introducing an Engine-Level Model Scale API [Beta]

So you’re telling me, apart from Move and Rotate, we can also SCALE animation objects??? To play in an animation???

This is fantastic, to celebrate here is too many dinosaurs. Previously this wouldn’t work because the models were huge and I couldn’t scale their animations.

image

8 Likes

The new scaling logic only applies if you scale a Model. If you ungroup a Model first or multiselect parts under it you’ll still get the simple scaling behavior that only scales Parts and Attachments when scaling that selection.

But furthermore you can combine this with the new Explorer filtering to get the old behavior even in complex scenarios: If you only select the BaseParts under the Model by filtering for them (filtering is:BasePart) you’ll be able to get an equivalent to the old scale behavior relatively easily.

3 Likes

Will there ever be support for smooth scaling without repeatedly having to call :ScaleTo()? I have a lot of use cases for needing to tween a models size (and position), like studio tools in-game, but it’s currently impossible.


Also, you can call Model:ScaleTo(0/0) and it’ll set its scale to nan which will effectively send the model to space. You can also do Model:ScaleTo(1/0) for infinity and you’ll encounter the same behavior.

Another possible bug is scaling a model that’s parented to another model. Calling ParentModel.ChildModel:ScaleTo(20) will scale its size like normal but will also offset its position. I can’t seem to get this to be reproduced 100% of the time though.

And finally, you can call Model:ScaleTo(true) and it’ll set the scale factor to 1. My guess is that it works because a true boolean value is represented as a 1 but I would still categorize it as unwanted behavior. You can create odd but functional code like so Model:ScaleTo(workspace ~= game.Players:WaitForChild("BullfrogBait")). Pretty interesting. :wink:

1 Like

I think this is going to be a major game changer for my workflow, thanks!

Unfortunately the engine is just not good at this. Being an engine that focuses on physics everything throughout the engine stack is optimized for fast high fidelity physics simulation, dynamic destruction, etc. Logical operations like scaling a hierarchy are unlikely to ever be very cheap because they would require optimizing in a different direction.

Though… having an API like this is actually a start. You can imagine a future where the engine sees you calling this API and is smart enough about it to do something more intelligent than just setting descendant properties and being done with it.

I am looking to add some sort of shim allowing the TweenService to call PivotTo / ScaleTo, however even if I do it won’t quite be what you’re looking for since you’ll only be able to use it to scale so complex of a model before you run into perf issues.


Good bugs. I prevented you from scaling to 0 but forgot to catch infinity / NaN too… facepalm. As for the child model case, fear not, I think I might know what’s going on there.

Fun fact: All reflection API methods which take number arguments actually treat booleans that way with false = 0 and true = 1. Don’t know the history on that one but it’s been that way since scripting was first introduced. This isn’t a specific coding decision in each API, it’s the general reflection system which handles that conversion automatically.

8 Likes

So it can be used if the publisher has the beta enabled? Or it can’t be used in game period until it’s out of beta?

Even if it’s a sliver of what I’m looking for I, and many many others, would take it. Glad to see it’s partially a possibility.

Incase you don’t find it: I got the behaviors by using :ToScale(60ish) in the command bar while also using a lot of Ctrl+Zs with a hierarchy that looked like:

Model
    Model
        Part
    Part

Basically played around with that until the most nested part was pivoted to faraway position, probably a few hundred or so studs.

It can only be used ingame once the feature is out of beta.

In this case you can still mostly make use of the feature in that you can use the content you’ve scaled in Studio ingame already, but you’ll have to wait on calling the :ScaleTo API ingame until after the beta.

1 Like

Sometimes models scaled this way will have their animations with translations in them glitch out when the place loads on live. Not always but I’ve seen it about 10 percent of the time…

10% of the time on the same device? If in general, the codepath that enables scaling applying to animations may not be on all mobile devices yet until the next force update.

2 Likes

Does this imply that scaling models in just one direction rather than all possible directions will be possible, similar to the F3X plugin? or that has not been implemented yet?

Additionally, this update is fantastic; keep improving Roblox Studio, as it’s growing into a significant project.
especially with the artificial intelligence that Roblox is producing.

Yoo Preston from Minecraft wudduppp

It’s a great update, but I need clarification on a few points because I don’t understand it all that well or what it’s capable of.

I am aware of what the scale tool can do for animations and how it can scale models more effectively, but I still need to fully comprehend it.

Oh it was exactly that - false alarm!

1 Like

This is awesome news, especially for things like virtual concerts. For George Ezra, we ended up with like a dozen versions of the same animation for different avatar sizes - this would have saved so much time!

2 Likes

I wasn’t expecting animation scaling to be released with this but it makes me so happy, can’t wait to add a scale slider to my character creator when this comes out of beta

1 Like

Really great new feature i hope that Roblox will keep adding more stuff like this.
This feature is such a lifesaver.

Wow. Awesome stuff. Looking forward to giving it a try when I get a chance!

Excellent update, I was looking for this last night and I wished there was a scale for models, and unbelievably this is out today

Oh this is actually great! Thanks for the update

You’re a lucky charm. Can you look for improved PBR system, next? I need that