Resize Mesh

This package resizes a mesh to fit a specified size. The mesh can be scaled up or down uniformly so that its longest length fits the specified size, or it can resize the mesh to fit a vector size in cm.

Use it to size a mesh similar to how triggers are sized.

It also provides the mesh’s estimated size, making it a helpful measurement tool.


Usage

Basic Mode
  1. Install the Resize Mesh Package.
  2. Select the mesh entity to resize.
  3. Choose edit.
  4. At the bottom of the Entity tab, click the button Add to Entity.
  5. Select Create ChildScript FolderResize Mesh.
  6. Change the size if desired.
  7. Close the entity editor.
Advanced Mode
  1. Install the Resize Mesh Package
  2. Add the Resize Mesh template onto a mesh entity.
  3. Change the size if desired.

Properties

Enabled

Resize the mesh on initialization, set to enabled by default.

Mode

Uniform

The mesh is scaled up or down uniformly so that its longest length fits the specified size.

Side: The target size for the longest side of the mesh.

Axis

The mesh is scaled to fit the specified x,y, and z values. (For meshes that support separate x,y, and z scaling)

Size: The mesh is scaled to fit the specified x,y, and z values in cm.
Setting the value to 0 will use the mesh’s existing scale value for that axis.

Print Mesh Info

The name of the mesh and its estimated size will print on the console. The mesh’s original scale and new scale will print on the console if the resize operation is performed.

Extra Delay

Wait for some seconds before doing any operations.


Functions

Resize(size)

The resize function can be called manually and accepts a single argument for the size.

Uniform scaling
Pass in a number as the size argument.

Resize(100)

Axis scaling
Pass in a vector as the size argument.
Setting a value to 0 will use the mesh’s existing scale value for that axis.

Resize(Vector.New(100,100,100))

Individual X and Y scaling while ignoring Z
Set the mesh’s x and y to 25 but do not change the z height.

Resize(Vector.New(25,25,0))

Showcase Game

1 Like

June 28th, 2022

Version 5

  • Added Axis resize mode. Resize x, y, and z separately. Setting a value to 0 will use the mesh’s existing scale value for that axis.
  • The ResizeMeshScript:Resize(size) function can now be called from scripts.
  • Reworked the script properties.
  • The property Resize was renamed to Enabled.
  • Added a new Mode property for selecting the resize mode.
  • Added an option to enable/disable printing the mesh info to the console.
  • Added a new property to specify the duration when using the extra delay option.
  • Bug fixes
  • Performance improvements.