Genome
RSS< Twitter< etc

Stoke MX Field Display Modifier

Available in Stoke MX 2.0 and higher. Last Edited on May 1, 2014.

Introduction

The Stoke Field Display Modifier lets you override the display sampling of any Stoke Field object by specifying explicit relative or absolute spacing along each axis, enforce a manual reduction level, set Min. and Max. clamping values for a Mask field to control the areas to be sampled, and provide new Color and Vector display options which might not be available in all Field objects (for example those converted using Mesh To Field modifier).

User Interface

Stoke Field Display rollout

Spacing Mode drop-down list

  • This drop-down list controls how the viewport display sampling will be performed:
  • Native Resolution - in this mode, the incoming voxel spacing will be used, and an optional manual reduction limit can be specified to override eventual automatic reduction if set to a higher value.
  • Relative Resolution - in this mode, the sampling resolution will be based on user-defined spacing relative to the bounding box size of the field. This allows for variable spacing along each of the three axes, while adapting to changing bounding box sizes without increasing the number of samples over time.
  • Absolute Resolution - in this mode, the sampling resolution will be based on user-defined voxel sizes defined in world units along each of the three axes. This allows for optional variable spacing along each of the three axes, while keeping the same spacing as the bounding box size is changing over time. NOTE: This can cause significant slow-downs if the resolution is selected to be very high as no automatic reduction will be applied.

Native Resolution > Reduce spinner 

  • This spinner defined a manual Reduction limit to override the automatic reduction if the latter has a lower value than the specified one.
  • Default is 5 which would enforce the drawing of only every 5th sample along each axis relative to the Native Resolution coming up the stack.
  • If the Automatic Reduction determined by the modifier has a higher value than the value entered in the UI, the Automatic value will be used instead to ensure fast viewport updates. 

Relative Resolution > X/Y/Z Samples values 

  • The three spinners let you specify the number of subdivisions along each one of the three axes relative to the bounding box size.
  • By default all three are set to 10 and are locked together via the Lock Samples checkbuttion, so changing any one of the three will adjust all three at once.
  • A value of 10 means creating 10 samples along each axis of the bounding box, regardless of the size of the bounding box.
  • This means that if the bounding box is changing over time, the number of samples will remain constant and the distances between the samples will be adjusted accordingly. 

Relative Resolution > Lock Samples checkbutton 

  • When checked (default), the Samples spinners will be locked together - changing any one of the three will change all three.
  • When unchecked, the Samples spinners will be unlocked and can be changed individually to specify different number of samples along each of the three axes.
  • Changing the checkbutton's state from unlocked to locked will NOT adjust all three spinners to the same value unless the user changes the value of any one of them - at that point, the other two spinners will be set to the new value of the spinner that was changed. For example, if the unlocked values of the three spinners were 10, 20 and 30 and the checkbutton was checked again, changing the first spinner to 11 will change all three to 11, but changing the third one down to 29 will set all three to 29 and so on. 

Absolute Resolution > X/Y/Z Spacing values

  • The three spinners let you specify the world-space spacing of each one of the three axes.
  • By default all three are set to 1.0 generic units and are locked together via the Lock Spacing checkbuttion, so changing any one of the three will adjust all three at once.
  • A value of 1.0 means creating samples along each axis of the bounding box according to the bounding box size.
  • This means that if the bounding box is changing over time, the number of samples will change accordingly. For example a Bounding box with size of 20,30,40 at Spacing if 2,3,4 will produce 10x10x10 samples along each axis, but if the Bounding box size changes to 40,60,20, there will be 20x20x5 samples in the viewport.

Absolute Resolution > Lock Spacing checkbutton

  • When checked (default), the Spacing spinners will be locked together - changing any one of the three will change all three.
  • When unchecked, the Spacing spinners will be unlocked and can be changed individually to specify different values along each of the three axes.
  • Changing the checkbutton's state from unlocked to locked will NOT adjust all three spinners to the same value unless the user changes the value of any one of them - at that point, the other two spinners will be set to the new value of the spinner that was changed.

Viewport Display Mode drop-down list 

  • This drop-down list controls the drawing mode of the samples in the viewport.
    • Points (default) - a large dot will be drawn for each sample according to the other settings.
    • Vectors - a line will be drawn for each sample with length and direction based on the Vector channel's field.

Scalar Channel Display drop-down list 

  • This list will contain all available Scalar fields (if any).
  • The first entry of the list will always be <None>, allowing you to disable the filtering (masking) of samples by a Scalar field.
  • Selecting a channel from the list will only allow samples to be drawn where the Scalar channel has a positive value, or, if the Min. and/or Max. checkboxes are checked, has a value within the specified range. 

Min. and Max. checkboxes and value spinners 

  • The checkboxes are unchecked by default, and the values have default values of -100.0 and 0.0, respectively.
  • When a valid Scalar field is selected, these checkboxes can be checked to enable custom clamping of the filter range.
  • When the Min. checkbox is checked, samples where the Scalar field is greater than the Min. value will be drawn.
  • When the Max. checkbox is checked, samples where the Scalar field is less than the Max. value will be drawn.
  • When both are checked, only samples with Scalar field value between the two custom range values will be drawn. 

Color Display Channel drop-down list 

  • This drop-down list will show all available Vector fields.
  • The first entry will always be <None>
  • When set to a valid Vector field, the field value at the sample point will be used to assign the color to the sample point or line. 

Vector Channel Display drop-down list 

  • This drop-down list will show all available Vector fields.
  • The first entry will always be <None>
  • When set to a valid Vector field, and only if the Viewport Display Mode drop-down list is set to "Vector", the field value at the sample point will be used to assign the magnitude and direction to the sample point's line.
  • The Magnitude of the line might be Normalized if the Normalize Vector checkbox is checked, and will be in units per second and can be scaled using the Vector Scale value (see below).

Normalize Vector checkbox 

  • This checkbox is unchecked by default.
  • When checked, and only if the Viewport Display Mode is set to "Vector" and a valid Vector field is selected in the Vector Channel Display drop-down list, the Vector lenght will be normalized to a length of 1.0, causing all lines to be drawn with the same length and only respecting their unique directions.
  • The Vector Scale value can be used to scale the already normalized vectors before drawing them. 

Vector Scale value spinner 

  • This value defaults to 1.0
  • It is used to scale the magnitude (length) of the line when Vector display is enabled and requested via the controls described above.
  • The scaling is applied always before drawing a line sample, regardless of whether the vectors are normalized or not. 

 

Modifier Creation Workflow

The Stoke Field Display modifier can be applied to scene objects using several workflows:

Using the Stoke Menu

  • The Stoke menu is installed automatically with the product and provides shortcuts to all major components.
  • Select one or more geometry objects in the scene.
  • Click the Stoke menu in the 3ds Max Main Menu bar.
  • Select the "Add a FIELD DISPLAY Modifier to selected object(s)" entry.
  • An individual modifier will be added to each selected valid geometry object.
  • Invalid objects will be filtered out automatically.
  • If a single object is selected and the 3ds Max command planel is active and the modifier stack selection is not the top modifier, the new Field Display modifier will be inserted above the current selection.
  • If multiple objects are selected, the new Field Display modifiers will be added to the top of the respective modifier stacks.

Using the 3ds Max Modify Tab in the Command Panel

  • You can also use the regular 3ds Max workflow for modifier creation.
    • Activate the Modify tab of the 3ds Max Command Panel
    • Select the object you want to convert to a field.
    • Select the modifier stack level you want to add the modifier to (default is top of the stack).
    • Select "Stoke Field Display" from the Modifiers list.

Using MAXScript

  • You can create a Stoke Field Display modifier and add it to the first object of the current selection by executing the following code:
theMod = Stoke_Field_Display_Modifier()
addModifier selection[1] theMod 
  • To insert the modifier into the existing modifier stack selection (assuming the Modify panel is active), you can use 
modPanel.addModToSelection theMod
  • To check whether the first selected object is a valid target for the new modifier, you can call
ValidModifier selection[1] Stoke_Field_Display_Modifier