uScatter
MAXScript
The uScatter and uScatterEdit classes, every property they expose, and the uScatterTools functions that read, convert and edit what a field places.
Everything on the uScatter panel can be set from MAXScript: each parameter is a property, and the uScatterTools interface does what a property cannot. With a field selected, run showProperties $ in the MAXScript Listener to list its properties, and showInterface uScatterTools to list the functions. The MAXScript reference lists the names every Verstice plugin answers to. The names are frozen, so a script written today keeps working with later builds.
Its 183 properties follow in panel order, then those with no control.
- Lengths are in system units, angles in plain degrees (not MAXScript angle values) and scales in multipliers, so
1.is the panel's 100 %.0 - Animatable:
count, and every Float and Point3 property exceptpreview_area,area_simplify,tint_amountand the Display rollout's.
uScatter() builds a field directly; uScatterTools. waits for a drag in a viewport, so in quiet mode (3dsmaxbatch, or 3ds Max with no user interface) it does nothing and batch scripts use the constructor.
Without a license, uScatter runs as its free edition, and MAXScript does too: uScatter() constructs, every property can be written and every uScatterTools function works, within the free edition's limits. A write that would take a field past one, such as an append of a sixth object to sources, throws a MAXScript error and leaves the list as it was; the status line says which limit, or the debug output in quiet mode. On a field made under a license that holds more than the free edition allows, only writes that remove are taken: deleteItem, emptying a node slot, assigning an array that keeps the start of the list (s.), adding the deleted bit to a uScatter Edit's edit_flags, or an erase dab. Every other write throws.
Note
At the free edition, assigning a longer array to points or to a uScatter Edit's add_positions is refused whole, and the list is put back as it was, once uScatter has seen the list's size: after any earlier scripted write to the field, or with its panel open. A list nothing has touched since the scene loaded is left at the new size, and the field read-only, until you shorten it with deleteItem.
uScatter : GeometryClass
s = uScatter()
s.sources = #($Box001)
s.distribution_surfaces = #($Plane001)
A Surface field places its sources over the nodes in distribution_surfaces.
Note
Scale, Position jitter, Distance clip, Density falloff and Scale falloff start unticked and take effect only while ticked, so a script that sets them must set scale_on, position_jitter_on, cam_clip_on, area_fd_on or area_fs_on too. rotation_on, mirror_on, slope_on, altitude_on and camera_cull switch the same way; only rotation_on starts on.
General Rollout
<uScatter>. Boolean default: true - Active.
<uScatter>. Boolean default: true - Auto update.
<uScatter>. Integer default: 0 - Type: 0 Surface, 1 Spline, 2 Custom, 3 Volume.
<uScatter>. Integer default: 0 - Mode in Surface: 0 By count, 1 By density, 2 Grid, 3 Hex grid, 4 By spacing.
<uScatter>. Integer default: 0 - Mode in Volume: 0 Count, 1 Per volume, 2 Grid.
<uScatter>. Integer default: 100 range: 0 to 100,000,000 - Count.
<uScatter>. Float default: 100.0 range: 0.0001 to 1,000,000,000,000 - Per area.
<uScatter>. Float default: 1000.0 range: 0.0001 to 1,000,000,000,000,000 - Per volume.
<uScatter>. Float default: 10.0 range: 0.001 to 1,000,000 - Distance.
<uScatter>. Float default: 0.0 range: −360 to 360 - Orientation.
<uScatter>. Integer default: 12345 range: 0 to 999,999,999 - Seed.
<uScatter>. Float default: 1.0 range: 0.1 to 8.0 - Pack factor, in By spacing. Also used by avoid_collisions.
Distribution Rollout
<uScatter>. TextureMap default: undefined - Map in Density mask. The mask is on while a map is assigned.
<uScatter>. Float default: 0.0 range: 0 to 1 - Threshold.
<uScatter>. Integer default: 0 - Clusters and Pattern: 0 off, 1 Cells, 2 Noise, 3 Map, 4 Stripes, 5 Rings, 6 Blocks, 7 Warped, 8 Gradient, 9 Turbulence, 10 Ridged, 11 Marble, 12 Swirl, 13 Perlin.
<uScatter>. Float default: 500.0 range: 0.001 to 1,000,000,000 - Patch size.
<uScatter>. Float default: 1.0 range: 0 to 1 - Amount.
<uScatter>. Float default: 0.0 range: −360 to 360 - Angle.
<uScatter>. Float default: 1.0 range: 0.01 to 100 - Stretch.
<uScatter>. Integer default: 0 range: 0 to 8 - Detail. 0 is the pattern's own default.
<uScatter>. Float default: 0.5 range: 0 to 1 - Roughness, read in steps of 1/32.
<uScatter>. Float default: 0.0 range: 0 to 2 - Warp.
<uScatter>. Float default: 1.0 range: 0 to 1 - Jitter.
<uScatter>. Integer default: 0 range: 0 to 999,999,999 - Seed.
<uScatter>. TextureMap default: undefined - Map for the Map pattern.
<uScatter>. Float default: 2000.0 range: 0.01 to 1,000,000,000 - Area size in the Preview window.
<uScatter>. Integer default: 0 - Draw as in the Preview window: 0 Circles, 1 Footprints.
<uScatter>. Integer default: 6000 range: 0 to 100,000,000 - Max instances in the Preview window. 0 is unlimited.
Objects Rollout
The list is stored as parallel arrays: entry n of each array belongs to entry n of sources. A short array reads its row default for missing rows, so a script can set sources alone; when you edit the list, keep the arrays the same length. Values that name a row count from 0.
<uScatter>. Array default: #() - the list. The field itself, or a uScatter that would scatter it into itself, is refused; a cycle that arises anyway is ignored, with a notice.
<uScatter>. Array row default: 1.0 - Probability.
<uScatter>. Array row default: 2 - State: 0 Off, 1 Empty, 2 Object.
<uScatter>. Array row default: [0,0,0] - Offset.
<uScatter>. Array row default: [1,1,1] - Scale, as multipliers.
<uScatter>. Array row default: [0,0,0] - Rotation, in degrees.
<uScatter>. Array row default: 0 - bits: 1 Keep node rotation, 2 Keep node scale, 4 Drop pivot, which changes nothing in uScatter 1.0.0 (Objects Rollout).
<uScatter>. Array row default: -1 range: −2 to 16 - Override display, Display and Style: -1 follows the field, -2 Original, anything else a display_mode value.
<uScatter>. Array row default: -1 range: 1 to 100,000 - Points in Override display. Here and below, -1 follows the field.
<uScatter>. Array row default: -1 range: 1 to 100,000 - Vertices.
<uScatter>. Array row default: -1 range: 4 to 100,000 - Hull detail.
<uScatter>. Array row default: -1 range: 1 to 10,000,000 - Wire faces.
<uScatter>. Array row default: -1 range: 3 to 64 - Segments.
<uScatter>. Array row default: -1 range: 4 to 512 - Voxels.
<uScatter>. Array row default: -1.0 range: 1 to 100 - Reduce %. Any value below 0 follows the field.
<uScatter>. Array row default: -1 - Faceted: 0 off, 1 on.
<uScatter>. Array row default: -1 - Group: the row's group row, -1 for the top level, its own index for a group row.
<uScatter>. Array - a group row's name; ignored on other rows.
Surfaces Rollout
<uScatter>. Array default: #() - the list.
<uScatter>. Integer default: 0 - Levels: 0 Highest, 1 Repeat, 2 Unique.
<uScatter>. Boolean default: false - Limit slope.
<uScatter>. Float default: 0.0 range: 0 to 90 - Min.
<uScatter>. Float default: 90.0 range: 0 to 90 - Max.
<uScatter>. Float default: 0.0 range: 0 to 90 - Falloff.
<uScatter>. Boolean default: false - Limit altitude, here and on the Volumes rollout.
<uScatter>. Integer default: 0 - Measure: 0 World Z, 1 Surface.
<uScatter>. Float default: −1,000,000.0 range: −1,000,000,000 to 1,000,000,000 - Min height.
<uScatter>. Float default: 1,000,000.0 range: −1,000,000,000 to 1,000,000,000 - Max height.
<uScatter>. Float default: 0.0 range: 0 to 1,000,000,000 - Falloff.
Splines Rollout
<uScatter>. Array default: #() - the list. While it is empty, spline is used.
<uScatter>. Integer default: 0 - Along path: 0 By count, 1 By spacing.
<uScatter>. Float default: 10.0 range: 0.0001 to 1,000,000 - Spacing.
<uScatter>. Float default: 0.0 range: 0 to 100 - Jitter %.
<uScatter>. Float default: 0.0 range: 0 to 1,000,000 - Side offset.
<uScatter>. Boolean default: true - Follow path XY.
<uScatter>. Boolean default: false - Follow path XYZ.
Volumes Rollout
<uScatter>. Array default: #() - the list.
<uScatter>. Float default: 0.0 range: 0 to 1,000,000 - Margin.
Limit altitude uses the altitude_* properties above. Packing is script-only: see avoid_collisions.
Instances Rollout
<uScatter>. Array default: #() - the hand-placed instances, Point3 positions in the object's own space, made by Add new and the Instances sub-object level.
<uScatter>. Array row default: [0,0,0] - Rotation, in degrees, one per instance.
<uScatter>. Array row default: [1,1,1] - Scale, as multipliers.
<uScatter>. Array row default: -1 - Object: -1 By probability, otherwise a row of sources.
<uScatter>. Integer default: 0 - Order: 0 Random, 1 Sequence.
<uScatter>. Array default: #() - the palette, as row indices. Empty means every row.
Areas Rollout
The list is stored like the Objects list. Limit to objects is stored as pairs, entry n of area_limit_owner with entry n of area_limit_row; an area with no pairs allows every object.
<uScatter>. Array default: #() - the list.
<uScatter>. Array - Type, set from the pick: 0 Spline region, 1 Paint, 2 Object.
<uScatter>. Array row default: 0 - Mode: 0 Include, 1 Exclude.
<uScatter>. Array row default: 0.0 range: 0 to 1,000,000,000 - Clearance.
<uScatter>. Array row default: 0 - Limit to objects, 0 or 1.
<uScatter>. Array default: #() - the area row of each allowed entry.
<uScatter>. Array default: #() - the sources row each entry allows.
<uScatter>. Integer default: 0 - Painted as: 0 Outline, 1 Point cloud.
<uScatter>. Float default: 0.0 range: 0 to 1,000,000,000 - Detail in the Paint group. 0 is automatic.
<uScatter>. Array default: #() - the painted outlines' points, written by Paint, Stamp, Erase and Clear.
<uScatter>. Array default: #() - points per outline ring. Counter-clockwise rings are solid, clockwise rings holes.
<uScatter>. Array default: #() - the area row each ring belongs to.
<uScatter>. Boolean default: false - Density falloff.
<uScatter>. Float default: 0.0 range: 0 to 1,000,000,000 - Dist. min.
<uScatter>. Float default: 0.0 range: 0 to 1,000,000,000 - Dist. max. 0 falls back to area_falloff.
<uScatter>. Float default: 1.0 range: 0 to 1 - End value: 1 removes every instance at the border end, 0 none.
<uScatter>. Integer default: 0 - Interpolation: 0 Linear, 1 Ease in, 2 Ease in/out, 3 Threshold, 4 Custom curve.
<uScatter>. Array default: #() - the density curve: up to 16 [x, y, 0] points ordered by x, with x and y from 0 to 1. Empty is a straight line.
<uScatter>. Boolean default: false - Scale falloff.
<uScatter>. Float default: 0.0 range: 0 to 1,000,000,000 - Dist. min.
<uScatter>. Float default: 0.0 range: 0 to 1,000,000,000 - Dist. max. 0 follows the density band.
<uScatter>. Float default: 0.0 range: 0 to 1 - End value: 1 shrinks to nothing at the border end, 0 not at all.
<uScatter>. Integer default: 0 range: 0 to 4 - Interpolation. 0 follows the density setting.
<uScatter>. Array default: #() - the scale curve, up to 16 points. Empty follows the density curve.
Transform Rollout
<uScatter>. Boolean default: true - Normal influence.
<uScatter>. Float default: 1.0 range: −1 to 1 - the Normal influence amount. Values below 0 act as 0.
<uScatter>. Node default: undefined - Target. undefined switches aiming off.
<uScatter>. Float default: 1.0 range: −1 to 1 - the Target influence amount. Values below 0 act as 0.
<uScatter>. Integer default: 1 - Aim axis: 0 X, 1 Y, 2 Z.
<uScatter>. Boolean default: true - Heading only.
<uScatter>. Boolean default: false - Position jitter.
<uScatter>. Point3 default: [0,0,0] - Position jitter X, Y and Z.
<uScatter>. Boolean default: true - Rotation.
<uScatter>. Point3 default: [0,0,0] - Min X, Y, Z, in degrees.
<uScatter>. Point3 default: [0,0,360] - Max X, Y, Z, in degrees.
<uScatter>. TextureMap default: undefined - Map.
<uScatter>. Float default: 0.0 range: 0 to 1 - Rot amt.
<uScatter>. Boolean default: false - Scale.
<uScatter>. Boolean default: true - Uniform scale.
<uScatter>. Point3 default: [1,1,1] - Min, as multipliers.
<uScatter>. Point3 default: [1,1,1] - Max, as multipliers.
<uScatter>. TextureMap default: undefined - Map.
<uScatter>. Float default: 0.0 range: 0 to 1 - Scale amt.
<uScatter>. Boolean default: false - Mirror.
<uScatter>. Boolean default: true - X.
<uScatter>. Boolean default: false - Y.
<uScatter>. Boolean default: false - Z.
Camera Rollout
uScatter 1.0.0 saves these values but applies none of them (Camera Rollout).
<uScatter>. Node default: undefined - Cull camera. undefined means the render camera.
<uScatter>. Boolean default: false - Frustum culling.
<uScatter>. Float default: 0.0 range: 0 to 1,000,000,000 - Cull margin.
<uScatter>. Boolean default: false - Distance clip.
<uScatter>. Float default: 0.0 range: 0 to 1,000,000,000 - Clip nearer.
<uScatter>. Float default: 0.0 range: 0 to 1,000,000,000 - Clip farther.
<uScatter>. Float default: 0.0 range: 0 to 1,000,000,000 - Thin from.
<uScatter>. Float default: 0.0 range: 0 to 1,000,000,000 - Thin to.
<uScatter>. Float default: 0.0 range: 0 to 1 - Thin by.
<uScatter>. Float default: 0.0 range: 0 to 1,000,000,000 - Shrink from.
<uScatter>. Float default: 0.0 range: 0 to 1,000,000,000 - Shrink to.
<uScatter>. Float default: 0.0 range: 0 to 1 - Shrink by.
Display Rollout
<uScatter>. Float default: 100.0 range: 0 to 100 - Display %.
<uScatter>. Integer default: 10000 range: 0 to 10,000,000 - Display max.
<uScatter>. Integer default: 1000000 range: 1 to 50,000,000 - Max points.
<uScatter>. Integer default: 10000000 range: 0 to 2,000,000,000 - Max inst. 0 is unlimited.
<uScatter>. Integer default: 8 range: −2 to 16 - Draw as and Style, one value for both:
- None –
3 - Points – Vertices
6, Scatter8, Pivot0 - Wire – Box
1, Simplified13 - Mesh – Plane
9, Box4, Pyramid12, Arrow10, Sphere14, Cylinder15, Convex hull7, Volume16, Full5 - Original –
-2
Two retired values still draw if a scene stores them: 11, a triangle, shown as Mesh › Plane, and 2, shown as Points › Pivot.
<uScatter>. Integer default: 200 range: 1 to 100,000 - Points.
<uScatter>. Integer default: 0 range: 0 to 999,999,999 - Seed.
<uScatter>. Integer default: 600 range: 1 to 100,000 - Vertices.
<uScatter>. Integer default: 600 range: 4 to 100,000 - Hull detail.
<uScatter>. Integer default: 800 range: 16 to 200,000 - Wire faces.
<uScatter>. Integer default: 16 range: 3 to 64 - Segments.
<uScatter>. Integer default: 64 range: 2 to 256 - Voxels.
<uScatter>. Float default: 25.0 range: 1 to 100 - Reduce %.
<uScatter>. Boolean default: true - Faceted.
<uScatter>. Float default: 5.0 range: 0 to 1,000,000 - Point size, in scene units or pixels by Size mode.
<uScatter>. Integer default: 2 range: 0 to 2 - Size mode: 0 World, 2 Pixels. A stored 1 is retired and draws as Pixels.
<uScatter>. Integer default: 0 - Colour for points and wire: 0 Object, 1 Source, 2 Material.
<uScatter>. Integer default: 2 - Colour for mesh styles, with the same values.
<uScatter>. Float default: 0.0 range: 0 to 1 - Darken.
<uScatter>. Float default: 20.0 range: 0.001 to 1,000,000 - Icon size, a diameter. The creation drag sets it.
<uScatter>. Boolean default: false - Always show.
Script-Only Properties
These have no control on the panel. Those marked Legacy, Retired or Dormant keep scenes from earlier builds opening.
<uScatter>. Integer default: 3 - how the field reaches renderers (Renderer Support), an escape hatch for a renderer that mishandles one interface:
0– No instancing interface: every renderer gets one baked mesh, limited byrender_mesh_cap.1– Autodesk's render-time instancing interface, which Arnold, V-Ray and FStorm use.2– The particle interface, Redshift's route.3– Both interfaces.
A scene saved by an earlier build with 1 opens as 3; 0 and 2 are kept.
<uScatter>. Integer default: 0 range: 0 to 2,000,000,000 - the most instances baked into one mesh, for renderers that take a mesh and for Convert To › Editable Mesh. 0 is unlimited. Above it the bake is refused, with a notice.
<uScatter>. Integer default: 10000 range: 0 to 1,000,000,000 - scatterToInstances refuses fields with more instances. 0 is unlimited.
<uScatter>. Integer default: 2000000 range: 1,000 to 200,000,000 - the most instances drawn in the viewport, across every style. The General stats line warns when it bites.
<uScatter>. Boolean default: false - packs instances to keep their distance, using pack_factor. By spacing packs without changing it. The only way to pack a Volume field.
<uScatter>. Boolean default: false - aims the Aim axis away from the target.
<uScatter>. Float default: 0.0 range: 0 to 1 - per-instance colour variation between the two tint colours. 0 is off. uScatter applies no colour itself: above 0, render-time instancing hands each instance two custom channels, tint (its position in the range) and tintColor (the colour there), which a renderer shows only if its material reads them. The particle interface, the baked mesh and the viewport don't carry the tint.
<uScatter>. Color default: 0.5, 0.5, 0.5 - one end of the tint range.
<uScatter>. Color default: 1.0, 1.0, 1.0 - the other end.
<uScatter>. Array default: #() - an optional normal for each hand-placed instance. Add new fills in [0,0,1].
<uScatter>. Float default: 0.0 range: 0 to 1,000,000,000 - Legacy. The single border width, read as the density band while area_fd_max is 0.
<uScatter>. Float default: 0.0 range: 0 to 1,000,000,000 - Legacy. The scale border width, now area_fs_min and area_fs_max.
<uScatter>. Array default: #() - Legacy. The avoid list, moved into areas as Exclude Object rows when the panel opens.
<uScatter>. Float default: 0.0 range: 0 to 1,000,000,000 - Legacy. Becomes each moved row's Clearance.
<uScatter>. Node default: undefined - Legacy. A single spline, used only while splines is empty.
<uScatter>. Array default: #() - Retired. The projection list, read with distribution_surfaces and merged into it when the panel opens.
<uScatter>. and <uScatter>. Node default: undefined - Dormant. Nothing reads them.
<uScatter>. Integer default: 2000 range: 1 to 200,000 - Dormant. The point-cloud dot budget.
<uScatter>., <uScatter>. and <uScatter>. Array default: #() - Retired. Painted dabs from earlier builds, converted to outlines.
<uScatter>. Array default: #() - Retired. Per-instance material variety from earlier builds. Does nothing.
<uScatter>., graph_json, graph_layout, graph_f, graph_i, graph_p3, graph_nodes and graph_maps - Dormant. Nothing in uScatter 1.0.0 reads them.
uScatterEdit : Modifier
addModifier $uScatter001 (uScatterEdit())
The uScatter Edit modifier goes on a uScatter or another uScatter Edit, and writes your edits into ten parallel arrays that have no control: six for edits to placements, four for added instances.
<uScatterEdit>. Array - the placement an edit applies to, as scatterInstanceKeys reports it.
<uScatterEdit>. Array - bits: 1 deleted, 2 has a transform, 4 has a source override.
<uScatterEdit>. Array - the position offset, in the uScatter's own space.
<uScatterEdit>. Array - the rotation offset, in degrees.
<uScatterEdit>. Array - the scale multiplier per axis.
<uScatterEdit>. Array - the sources row to place instead; -1 keeps the field's pick.
<uScatterEdit>. Array - an added instance's world position.
<uScatterEdit>. Array - its rotation, in degrees.
<uScatterEdit>. Array - its scale per axis.
<uScatterEdit>. Array - the sources row it places.
uScatterTools Interface
uScatterTools is a global interface of 26 functions, not uScatter, which is the class. Call a function as uScatterTools.. <placements>, <params> and <layoutOrigin> are passed by reference; a literal works. Rows, placements and areas count from 0. The Create uScatter and Convert to uScatter toolbar buttons are the macroScripts uScatter_CreateScatter and uScatter_ConvertToScatter, in the uScatter category.
| Function | Parameters | Description |
|---|---|---|
| Instances and Display | ||
scatterInstances | <node> | Returns the rendered instances, Empty rows left out: #(count, 14, …), then per instance the world transform's four rows (12 values), the source index and the tint. Returns #() if the node is not a uScatter. Works at the free edition, on any field. |
scatterAllInstances | <node> | Returns every placement, Empty rows included, in the same layout, in the order scatterInstanceKeys and scatterEditGizmo use. |
scatterInstanceKeys | <node> | Returns each placement's key, the identity uScatter Edit stores edits against: the world cell in Surface and Volume, the order in Spline and Custom. Keys are 32-bit and can read negative. |
scatterDisplayStats | <node> | Returns the General stats line as #(count, unit, instances); unit is 0 instances, 1 points, 2 faces. Builds the display geometry first. |
scatterInUseStyles | <node> | Returns the display_mode values actually drawn, as integers, with per-row overrides and Original resolved. Honours Auto update off. |
scatterPreview | <node> <areaSize:float> | Returns the Preview window's sample, #(count, 7, …), then per instance x, y, radius, angle in degrees, half width, half height and source index. areaSize 0 uses preview_area. At most preview_limit, and never above 200,000. |
| Creating and Converting | ||
createScatter | - | Starts interactive creation, as the Create panel's uScatter button does, licensed or at the free edition. Does nothing in quiet mode. Returns nothing. The Create uScatter button runs it. |
scatterToInstances | <node> | Creates a 3ds Max node per instance, a true instance of its source, under one dummy, as one undo entry; group sources become groups, light sources lights (Scatter to Instances). Returns the number of nodes made; 0 if the node is not a uScatter or the field is empty; -1 above convert_cap. |
scatterFromSelection | <layoutOrigin:point3> | Replaces the selection with one Custom uScatter, laying the sources out in a row from layoutOrigin, as one undo entry; the Convert to uScatter button passes the point you pick. Returns the number of placements written; -1 if nothing was selected or convertible, if it failed, or if the free edition's limits refuse the selection (more than 5 unique objects or 30 objects), in which case nothing changes and materialNotes holds the refusal. |
| Updating | ||
scatterUpdateNow | <node> | Presses Update now, rebuilding a field whose Auto update is off. Returns false if the node is not a uScatter. |
scatterRegenStats | <node> | Returns #(rebuildCount, lastRebuildMs, bakeCount): rebuilds so far, the last rebuild's time in milliseconds, and render-mesh bakes. Changes nothing. |
| uScatter Edit | ||
scatterEditStats | <node> | Returns #(layers, applied, orphaned, added, swapsRefused, placements); orphaned counts edits that match no placement. Check layers first: the rest also read 0 with no uScatter Edit. |
scatterEditGizmo | <node> <op:integer> <placements:array> <value:point3> | Applies op to the placements numbered in placements (in scatterAllInstances order) through the topmost uScatter Edit, as one undo entry. Returns the number affected; -1 with no uScatter Edit. At the free edition, op 6 returns 0 once the field has 30 hand-placed instances, and on a read-only field ops 0, 1, 2 and 4 change nothing, though they still return the number of placements named. |
op 0 | value: the world translation | Move. Undo entry Move uScatter Instances. |
op 1 | value: X, Y, Z rotation in degrees | Rotate. Undo entry Rotate uScatter Instances. |
op 2 | value: X, Y, Z scale factors | Scale. Undo entry Scale uScatter Instances. |
op 3 | - | Delete. Undo entry Delete uScatter Instances. |
op 4 | value.x: the sources row; -1 hands it back to the field | Swap the object. Undo entry Swap uScatter instance model. |
op 5 | value: the brush centre, in world space; placements[1]: the radius, a whole number | Erase. Undo entry Erase uScatter Instances. |
op 6 | value: the world position; placements[1]: its sources row | Add an instance (no panel control). Undo entry Add uScatter Instance. |
op 7 | - | Prune edits that match no placement, now. Undo entry Clean uScatter edits. |
| Areas and Painting | ||
scatterSelectArea | <node> <row:integer> | Selects an Areas row as a click does, with its highlight and stack branch. Returns 1 if it took. |
scatterAreaOutline | <node> <areaRow:integer> <dotStep:float> | Returns one area's outline: the loop count, each loop's point count and x, y, z per point, and last the point-cloud dot count. dotStep spaces the Point cloud dots. |
scatterAreaDots | <node> <areaRow:integer> <params:array> | Returns one area's point-cloud dots, #(count, x, y, z, …), clipped to the rectangle in params, #(dotStep, minX, minY, maxX, maxY). |
scatterPaintDab | <node> <areaRow:integer> <params:array> | Paints one dab on a painted area; params is #(x, y, z, radius, erase), and erase 1 removes. One undo entry, unless inside a stroke or an undo on block. Returns 1 if it ran, 0 if the node is not a uScatter, params is too short, or the field is read-only at the free edition and the dab paints rather than erases. |
scatterPaintStroke | <node> <begin:integer> | Brackets dabs as one stroke: 1 opens it, 0 commits it as one undo entry, 2 cancels it. The field is not re-scattered while a stroke is open. |
scatterAreaDrawCalls | <node> <areaRow:integer> | Returns one area's overlay draw cost: #(polylineCalls, stripVerts, rings, points, drawsUnselected). |
scatterAreaBranches | <node> | Returns the spline area rows offered as modifier-stack branches: #(nSelected, nAll), then 12 transform values. |
| Diagnostics | ||
materialNotes | - | Returns uScatter's latest 256 notices as an array of strings. Notices are not shown on screen: read a refused conversion or a field clipped at Max inst. here. |
scatterDeps | <node> | Returns one string listing every dependent of the field and its parameter block, as ClassName{a,b} sclass:N; entries. |
meshFingerprint | <node> | Returns the geometry fingerprint every Verstice plugin shares, a float array, for comparing two meshes. |
renderInstancingProbe | <node> | Reads Autodesk's render-time instancing interface as a renderer does: an 18-value header (ok, sources, targets, number of transforms, valid forever, channels, node transform), then 14 values per target. Works on any object that publishes it. |
instancingCallStats | <node> | Returns eight counters: the instancing mode, whether each interface is published, and how often a renderer called each function. |
selfCheck | - | Returns "" when uScatter's startup checks pass, otherwise what failed. |
Example Scripts
Build a Field over a Plane
-- Assumes a plane named Plane001 and four boxes Box001 to Box004.
s = uScatter()
s.type = 0 -- Surface
s.sources = #($Box001, $Box002, $Box003, $Box004)
s.source_weights = #(1.0, 2.0, 1.0, 0.5) -- one probability per row
s.distribution_surfaces = #($Plane001)
s.scatter_mode = 0 -- By count
s.count = 500
s.seed = 7
-- Scale starts unticked: set its gate too.
s.scale_on = true
s.scale_min = [0.8, 0.8, 0.8] -- multipliers: 0.8 is 80 %
s.scale_max = [1.2, 1.2, 1.2]
d = uScatterTools.scatterInstances s
format "% instances\n" (d[1] as integer)
Read the Placed Instances
s = $uScatter001
d = uScatterTools.scatterInstances s
n = d[1] as integer
stride = d[2] as integer -- 14
for i = 0 to n - 1 do
(
b = 3 + i * stride -- first value of instance i
pos = [d[b + 9], d[b + 10], d[b + 11]] -- fourth row: the position
src = d[b + 12] as integer -- source index
format "% at %, source %\n" (i + 1) pos src
)
Convert a Field to Scene Objects
s = $uScatter001
s.convert_cap = 50000 -- 0 is unlimited
n = uScatterTools.scatterToInstances s
if n == -1 then
for note in uScatterTools.materialNotes() do format "%\n" note
else
format "% nodes created\n" n
Freeze a Heavy Field, Then Rebuild It Once
s = $uScatter001
s.auto_update = false
s.count = 200000
s.seed = 42
uScatterTools.scatterUpdateNow s -- one rebuild, still frozen