uTiles
MAXScript
The uTiles and uTilesModifier classes, every property they expose, and the uTilesTools functions that report what each build produced.
Everything on the uTiles panel can be driven from MAXScript. The object and the modifier are separate classes, uTiles and uTilesModifier, kept distinct so that uTiles() always builds the object. With a floor selected, run showProperties $ in the MAXScript Listener to list its properties, and showInterface uTilesTools to list the inspection functions. The MAXScript reference lists the names every Verstice plugin answers to.
The object has 103 properties and the modifier 100. The 98 they share are listed once, in panel order; Object only marks the object's five extras.
- Drop-down lists are integers, counted from
0in the order the list shows them:pattern =is Herringbone.2 - Nothing is animatable, from script or from the panel.
- Ranges are the parameters' own, the ones the panel's spinners keep to, so keep script values inside them too.
Without a license, MAXScript meets the same free-edition limits as the panel (License Rollout). uTiles() and uTilesModifier() construct, every property can be read, and a property can be set on a floor within the limits. target_surfaces refuses a second surface, or one that isn't flat; on a floor past the limits, such as one made under a license, every property set and uTilesTools. are refused. A refused set leaves the value as it was, and the reason goes to the status line and the 3ds Max log, or only to the debug output in quiet mode. uTilesTools. says where a floor stands.
uTiles : GeometryClass
f = uTiles()
f.target_surfaces = #($Plane001)
The object tiles the nodes in target_surfaces. Until one is set it builds nothing and shows only its viewport mark.
General Rollout
<uTiles>. Float default: 100.0 range: 1 to 10,000 - Scale.
<uTiles>. Float default: 0.0 range: −180 to 180 - Direction.
<uTiles>. Float default: 0.0 range: −1,000,000 to 1,000,000 - Offset X.
<uTiles>. Float default: 0.0 range: −1,000,000 to 1,000,000 - Offset Y.
<uTiles>. Integer default: 12345 range: 0 to 999,999,999 - Seed.
<uTiles>. Integer default: 0 range: 0 to 1 - Update: 0 Always, 1 Manual. A Manual floor is rebuilt by uTilesTools..
<uTiles>. Float default: 20.0 range: 0.001 to 1,000,000 - Icon size. Object only.
<uTiles>. Boolean default: false - Always show. Object only.
Surface Rollout
<uTiles>. Array default: #() - the surface list, Pick and Remove. Object only. An array of nodes: #($Plane001, $Plane002). A node that depends on the floor itself is refused; a shape is filled from its closed splines while shape_fill is on, and lights and helpers are skipped. At the free edition it takes one flat surface: in an array assignment, each surface past the limit is stored as undefined, and the refusal is said once per slot.
<uTiles>. Integer default: 0 range: 0 to 1 - Mode: 0 Planar, 1 UV-space.
<uTiles>. Float default: 5.0 range: 0 to 90 - Weld angle.
<uTiles>. Point3 default: [1, 0, 0] - Grain direction.
<uTiles>. Integer default: 1 range: 1 to 99 - UV channel.
<uTiles>. Boolean default: false - Ignore UV scale.
<uTiles>. Boolean default: true - Real-world size.
<uTiles>. Integer default: 0 range: 0 to 4 - Limit to: 0 All faces, 1 Floors, 2 Walls, 3 Ceilings, 4 Custom angles.
<uTiles>. Float default: 0.0 range: 0 to 180 - min.
<uTiles>. Float default: 180.0 range: 0 to 180 - max.
Pattern Rollout
<uTiles>. Integer default: 0 range: 0 to 9 - Pattern: 0 Running bond, 1 Stack, 2 Herringbone, 3 Chevron, 4 Basketweave, 5 Parquet, 6 Windmill, 7 Double basket, 8 Versailles, 9 Hexagon.
<uTiles>. Float default: 40.0 range: 0.001 to 1,000,000 - Length.
<uTiles>. Float default: 0.0 range: 0 to 1 - Length var.
<uTiles>. Float default: 0.5 range: 0 to 1 - Spread in the Length group.
<uTiles>. Float default: 0.2 range: 0 to 1,000,000 - Gap in the Length group.
<uTiles>. Float default: 8.0 range: 0.001 to 1,000,000 - Width.
<uTiles>. Float default: 0.0 range: 0 to 1 - Width var.
<uTiles>. Float default: 0.5 range: 0 to 1 - Spread in the Width group.
<uTiles>. Float default: 0.2 range: 0 to 1,000,000 - Gap in the Width group.
<uTiles>. Float default: 0.5 range: 0 to 1 - Offset, left field.
<uTiles>. Float default: 0.5 range: 0 to 1 - Offset, right field.
<uTiles>. Integer default: 1 range: 1 to 16 - Parallel.
<uTiles>. Float default: 45.0 range: 15 to 75 - Chevron.
<uTiles>. Integer default: 0 range: 0 to 16 - Per block.
<uTiles>. Integer default: 1 range: 1 to 16 - Per arm.
Geometry Rollout
<uTiles>. Float default: 0.0 range: 0 to 1,000,000 - Thickness.
<uTiles>. Boolean default: true - Generate back face.
<uTiles>. Float default: 0.0 range: 0 to 1,000,000 - Weld.
<uTiles>. Boolean default: true - the Chamfer checkbox.
<uTiles>. Float default: 0.0 range: 0 to 1,000,000 - the Chamfer amount.
<uTiles>. Float default: 0.0 range: 0 to 1,000,000 - Height in the Chamfer box. 0 follows chamfer_amount.
<uTiles>. Integer default: 1 range: 1 to 64 - Segments in the Chamfer box.
<uTiles>. Float default: 0.5 range: 0 to 1 - Profile.
<uTiles>. Boolean default: true - Chamfer top.
<uTiles>. Boolean default: false - Chamfer bottom.
<uTiles>. Boolean default: true - Chamfer cut edges.
<uTiles>. Boolean default: false - Chamfer sides.
<uTiles>. Boolean default: false - Exact corner setback.
<uTiles>. Boolean default: false - Round cut corners.
<uTiles>. Float default: 0.0 range: 0 to 1,000,000 - Side radius.
<uTiles>. Boolean default: true - the Inset checkbox.
<uTiles>. Float default: 0.0 range: 0 to 1,000,000 - the Inset amount.
<uTiles>. Integer default: 0 range: 0 to 64 - Segments in the Inset box.
<uTiles>. Float default: 0.0 range: −1,000,000 to 1,000,000 - Offset in the Inset box.
Jitter Rollout
<uTiles>. Float default: 0.0 range: 0 to 1,000,000 - Height.
<uTiles>. Float default: 0.0 range: 0 to 85 - Tilt.
<uTiles>. Float default: 0.0 range: 0 to 85 - Rotate X.
<uTiles>. Float default: 0.0 range: 0 to 85 - Rotate Y.
<uTiles>. Float default: 0.0 range: 0 to 45 - Rotate Z.
<uTiles>. Float default: 0.0 range: −45 to 45 - Centre Z.
<uTiles>. Float default: 0.5 range: 0 to 1 - Spread Z.
<uTiles>. Boolean default: false - Random 90 turns.
<uTiles>. Float default: 0.0 range: 0 to 1,000,000 - Along in the Offset box.
<uTiles>. Float default: 0.0 range: −1,000,000 to 1,000,000 - Centre under Along.
<uTiles>. Float default: 0.5 range: 0 to 1 - Spread under Along.
<uTiles>. Float default: 0.0 range: 0 to 1,000,000 - Across in the Offset box.
<uTiles>. Float default: 0.0 range: −1,000,000 to 1,000,000 - Centre under Across.
<uTiles>. Float default: 0.5 range: 0 to 1 - Spread under Across.
<uTiles>. Float default: 0.0 range: 0 to 0.95 - Length in the Scale box.
<uTiles>. Float default: 0.5 range: 0 to 1 - Spread under Length.
<uTiles>. Float default: 0.0 range: 0 to 0.95 - Width in the Scale box.
<uTiles>. Float default: 0.5 range: 0 to 1 - Spread under Width.
<uTiles>. Boolean default: false - Keep boards apart.
<uTiles>. Float default: 0.0 range: 0 to 1,000,000 - Overlap.
Mapping Rollout
<uTiles>. Integer default: 0 range: 0 to 2 - UV map: 0 From source, 1 Real-world, 2 Per-plank.
<uTiles>. Integer default: 1 range: 1 to 99 - Src channel.
<uTiles>. Float default: 100.0 range: 0.001 to 1,000,000 - Tex size.
<uTiles>. Integer default: 1 range: 0 to 1 - U along: 0 Frame, 1 Board.
<uTiles>. Float default: 1.0 range: −1,000 to 1,000 - Tiling U.
<uTiles>. Float default: 1.0 range: −1,000 to 1,000 - Tiling V.
<uTiles>. Boolean default: true - Random offset U (along).
<uTiles>. Float default: 0.0 range: −1,000 to 1,000 - its Min, in texture tiles.
<uTiles>. Float default: 1.0 range: −1,000 to 1,000 - its Max.
<uTiles>. Float default: 0.0 range: 0 to 1,000 - its Step; 0 is any value.
<uTiles>. Boolean default: true - Random offset V (across).
<uTiles>. Float default: 0.0 range: −1,000 to 1,000 - its Min.
<uTiles>. Float default: 1.0 range: −1,000 to 1,000 - its Max.
<uTiles>. Float default: 0.0 range: 0 to 1,000 - its Step.
<uTiles>. Boolean default: true - Random rotation.
<uTiles>. Float default: 0.0 range: −3,600 to 3,600 - its Min, in degrees.
<uTiles>. Float default: 360.0 range: −3,600 to 3,600 - its Max.
<uTiles>. Float default: 90.0 range: 0 to 360 - its Step; 0 is any angle.
A constant offset or turn is a range whose _min and _max are equal. The properties these replaced, uv_offset_random, uv_offset_axes, uv_offset_amount, uv_offset_u, uv_offset_v, uv_rotate_90 and uv_rotate, are still on the object so that older scenes and presets convert when they open, but setting them changes nothing.
<uTiles>. Boolean default: true - U (along) in Random flip.
<uTiles>. Boolean default: false - V (across) in Random flip.
<uTiles>. Integer default: 0 range: 0 to 1 - Side map: 0 World scale, 1 Per board.
<uTiles>. Float default: 0.0 range: 0 to 1,000,000 - Side tex.
<uTiles>. Integer default: 1 range: 1 to 99 - Out channel.
Material Rollout
<uTiles>. Integer default: 8 range: 1 to 1,000 - Mat IDs.
<uTiles>. Integer default: 3 range: 0 to 99 - Random ch. 0, 1 and the uv_out_channel value are refused without a message.
<uTiles>. Integer default: 1 range: 0 to 1 - Seed by: 0 Emission, 1 Position.
Script-Only and Deprecated Properties
These ten have no row on the panel.
<uTiles>. Node default: undefined - Object only. The legacy single surface. Read only when target_surfaces has no live entry; loading a scene copies it into target_surfaces when that list is empty.
<uTiles>. Boolean default: false - Object only. With no surface, builds a flat grid of boards instead of nothing. Kept for uTiles' own chamfer tests.
<uTiles>. Float default: 100.0 range: 0.001 to 1,000,000 - the flat preview's size along the object's local X, used only while flat_preview is on and no surface resolves.
<uTiles>. Float default: 100.0 range: 0.001 to 1,000,000 - the flat preview's size along local Y.
<uTiles>. Float default: 0.0 range: 0 to 1,000,000 - a legacy straight taper of the top face of solid boards. It works only while there is no chamfer and thickness is above 0, and is scaled by the unwrap's density in UV-space.
<uTiles>. Float default: 0.2 range: 0 to 1,000,000 - Deprecated. Loading an older scene copies it into gap_length and gap_width; setting it changes nothing.
<uTiles>. Float default: 0.5 range: 0 to 1 - Deprecated. Loading an older scene copies it into offset_from and offset_to; setting it changes nothing.
<uTiles>. Boolean default: true - Deprecated. Loading an older scene copies it into uv_flip_u; setting it changes nothing.
<uTiles>. Boolean default: false - an experimental chamfer option; on the test shapes it was measured on, it changes nothing yet.
<uTiles>. Boolean default: true - fills a shape, picked into target_surfaces or under the modifier, as a flat floor from its closed splines. Off, the object skips a shape and the modifier tiles 3ds Max's own mesh of it. Floors saved before uTiles 1.1.0 load with it off where it would change them, so they build what they built: every uTiles Modifier, and an object with a shape in its list. Set it to true to switch one over.
area_width and area_length exist on the modifier too, but only the object uses them.
uTilesModifier : Modifier
addModifier $Box001 (uTilesModifier())
The modifier tiles the mesh that reaches it in the stack. It shares every property of uTiles : GeometryClass except the five marked Object only, and adds two of its own on the Surface rollout:
<uTilesModifier>. Boolean default: false - Scene units.
<uTilesModifier>. Boolean default: false - Include source mesh.
Interface: uTilesTools
uTilesTools is a global interface for inspecting floors. It is named uTilesTools, not uTiles, because uTiles is the object's class. Call a function as uTilesTools..
| Function | Parameters | Description |
|---|---|---|
| Statistics | ||
tileStats | <node> | Returns the counters from the floor's last build, without rebuilding it: an array of 23 numbers (below), or #() if the node has no uTiles. Works on the object, or on a node with a uTiles Modifier anywhere in its stack. |
tileBoards | <node> | Regenerates the floor and returns one row per board (below), or #(). Object only: on the modifier it always returns #(). Needs a license, or at the free edition a floor within its limits; otherwise it returns #(). |
tileBuildCount | <node> | Returns how many times the floor has finished building its mesh, or -1 if the node is not a uTiles object. Object only: a node tiled by the uTiles Modifier also returns -1. |
| Creation | ||
createTiles | - | Switches to the Create panel and starts interactive creation, with or without a license. Does nothing when 3ds Max runs without its interface. The Create uTiles toolbar button calls it. Returns nothing. |
| Update and Presets | ||
updateTiles | <node> | Rebuilds a floor whose update_mode is Manual, as the Update button does; harmless on an Always floor. Works on the object, or on a node with a uTiles Modifier in its stack. Returns true when the node has a floor, else false. |
savePreset | <node> <file> | Saves the floor's look to a preset file, as Save preset… does. Returns true, or false when the node has no floor or the file can't be written. |
loadPreset | <node> <file> | Sets the floor's look from a preset file as one undo step, as Load preset… does. Returns how many settings it applied, or -1 when the node has no floor, the file can't be opened or isn't a uTiles preset, or the floor is read-only at the free edition. |
| Free Edition | ||
freeCounts | <node> | Returns #(surfaces, flatSurfaces, within, atFree): the floor's surface and flat-surface counts, as the License rollout shows them; 1 if both are within the free edition's limits, else 0; and 1 if uTiles is at its free edition now, else 0. Returns #() if the node has no uTiles. It reports, and decides nothing. |
| Diagnostics | ||
meshFingerprint | <node> | Returns 18 numbers for any node's mesh: vertex and face counts, the channel-1 map vertex count, eight hash values, the surface area, and the bounding box's minimum and maximum corners; #() if the node has no mesh. Compare two to tell whether two builds produced the same mesh. |
materialNotes | - | Returns uTiles' recent notices as an array of strings. uTiles posts none, so it is always empty. |
selfCheck | - | Runs uTiles' class-ID and object/modifier parameter checks and returns "" when healthy. An installed uTiles always returns "", because a failing check stops it loading. |
| Development | ||
quadChamfer | <node> <params> | Runs 3ds Max's own quad chamfer over a copy of the node's render mesh. Returns its 18-number mesh fingerprint, or #(). |
chamferDiff | <node> #(amount, segments, beta, coplanarDeg) | Runs 3ds Max's chamfer and uTiles' own on the node's mesh and compares them, polygon by polygon. The defaults are 1, 1, 0.5 and 20. Returns 12 numbers, the last a status: 0 compared, 1 3ds Max declined, 2 uTiles declined. |
chamferOurs | <node> #(amount, segments, beta, coplanarDeg) | Applies uTiles' chamfer to a copy of the node's mesh and adds it to the scene as a node named chamferOurs, faceted and without UVs. Returns the new node, or undefined. |
uTilesTools. tileStats Values
Indices count from 1. Values 1–3 and 5 are what the Material rollout's readout shows.
| Index | Value |
|---|---|
1 | Boards built |
2 | Vertices |
3 | Faces |
4 | Regions: flat regions tiled in Planar mode, or tiling passes in UV-space |
5 | 1 if a board limit cut the build short (⚠ truncated in the readout), else 0 |
6 | 1 if the last build is valid, else 0 |
7 | Unpaired seams: 0 on a healthy build |
8 | Time to evaluate and merge the surfaces, in milliseconds |
9 | Time to split the surface into regions, or read its unwrap |
10 | Time to prepare each region |
11 | Time to lay the pattern |
12 | Time to cut, merge and chamfer the boards |
13 | Time to write the mesh, including 14 |
14 | Time to fill the 3ds Max mesh, including 15 |
15 | Time to build normals |
16 | Total build time |
17 | Boards whose chamfer was built exactly |
18 | Boards where the exact chamfer fell back to the simpler one; expect 0 |
19 | Chamfer levels that repeated the one before |
20 | Chamfer cap levels dropped because they turned inside out |
21 | Boards on a draped floor whose folds share one chamfer |
22 | Draped fold boards that fell back to chamfering piece by piece |
23 | Split-UV fold pairs reclassified: 0 on any unwrap that tiles cleanly |
uTilesTools. tileBoards Values
The array holds the board count and the row length (10), then one row per board. Pieces of a board cut at a region edge count as one board.
| Column | Value |
|---|---|
1 | Material ID, counted from 0 |
2–4 | The board's centre: X, Y, Z in world space |
5 | Top-face area |
6–7 | The board's two random numbers: the red and green of the random channel |
8–10 | The board's cell in the pattern's lattice |
Example Scripts
Build a herringbone floor on a Plane:
f = uTiles()
f.target_surfaces = #($Plane001)
f.pattern = 2 -- Herringbone
f.plank_length = 60.0
f.plank_width = 10.0
f.thickness = 2.0
f.chamfer_amount = 0.3
f.grain_direction = [0, 1, 0]
Count the boards on the selected floor, and check whether it was cut short:
f = selection[1]
s = uTilesTools.tileStats f
if s.count > 0 do
(
format "% boards, % faces\n" s[1] s[3]
if s[5] == 1 do format "The floor hit a board limit and is incomplete.\n"
)
Lay a floor inside a closed spline, such as a room outline with a column's spline attached inside it as a hole:
f = uTiles()
f.target_surfaces = #($RoomOutline)
f.pattern = 2 -- Herringbone
f.herringbone_planks = 2 -- a double herringbone
Copy the selected floor's look to every other floor in the scene through a preset:
src = selection[1]
dir = (getDir #plugcfg) + "\\uTiles presets"
makeDir dir
file = dir + "\\shared.ini"
if uTilesTools.savePreset src file do
for n in objects where n != src and (uTilesTools.tileStats n).count > 0 do
uTilesTools.loadPreset n file
Hold a heavy floor while a script changes it, then rebuild it once:
f = selection[1]
f.update_mode = 1 -- Manual
f.plank_length = 80.0
f.thickness = 2.0
uTilesTools.updateTiles f
List each board's material ID and centre, for a selected uTiles object:
d = uTilesTools.tileBoards selection[1]
if d.count > 0 do
(
n = d[1] as integer
stride = d[2] as integer
for i = 0 to n - 1 do
(
row = 2 + i * stride
format "board %: ID % at [%, %, %]\n" (i + 1) d[row + 1] d[row + 2] d[row + 3] d[row + 4]
)
)