Purpose

The module WEMModify modifies nodes and/or faces.

Node modifications consist of scaling, translating, rotating, and centering the WEM. Additionally, the internal nodes’ RGBA colors and the internal LUT values can be modified.

Face modifications include mirroring and triangulation.

Usage

Simply connect any WEM to the input of the WEMModify module and select appropriate parameters to be modified.

The module can work on all WEMPatches of the input WEM or on just a (manual) selection of patches.

Details

The Use Transform Matrix flag enables an input matrix that is multiplied to each node position. If Use Transform Matrix is enabled, Scale, Rotation, Translate, and Center are not used.

Otherwise these fields are applied in this order:

  1. Center
  2. Scale
  3. Rotation
  4. Translate

If Legacy scale/translate/rotate behavior (please consult help) is set, these values are applied in a different order and with different rules. Please see description there.

Windows

Default Panel

../../../Modules/ML/MLWEMModules/mhelp/Images/Screenshots/WEMModify._default.png

Input Fields

inWEM

name: inWEM, type: WEM(MLBase)

The WEM to be modified.

For accessing this object via scripting see the Scripting Reference: MLWEMWrapper.

Output Fields

outWEM

name: outWEM, type: WEM(MLBase)

Either the modified copy of the input WEM or the modified original WEM.

For accessing this object via scripting see the Scripting Reference: MLWEMWrapper.

Parameter Fields

Visible Fields

Auto Apply

name: autoApply, type: Bool, default: TRUE

If checked, all parameter changes take immediately effect.

see also WEMGenerator.autoApply

Update Mode

name: updateMode, type: Enum, default: AutoUpdate, deprecated name: autoUpdate

Defines how this module should react on any input field change.

see also WEMGenerator.updateMode

Apply

name: apply, type: Trigger

If pressed, the module computes anew.

see also WEMGenerator.apply

Clear

name: clear, type: Trigger

If pressed, the output WEM is cleared (made empty).

see also WEMGenerator.clear

Overwrite label and description

name: overwriteLabelDescription, type: Bool, default: FALSE

If checked, label and description strings are set in the output WEM to Label and Description.

see also WEMGenerator.overwriteLabelDescription

Label

name: label, type: String

Sets a label string in the output WEM.

see also WEMGenerator.label

Description

name: description, type: String

Sets a description string in the output WEM.

see also WEMGenerator.description

Mode

name: triangulationMode, type: Enum, default: Strip

Defines a triangulation mode.

If the selected WEMPatch(es) yield non-triangular faces, the module triangulates those faces if Triangulate Faces is checked.

see also WEMProcessor.triangulationMode

Scale

name: scale, type: Vector3, default: 1 1 1

Sets a scaling vector to scale all nodes of the 3D mesh, with different scale values for the three coordinate axes.

The scaling will happen relative to the center of the current WEM patch if Scale And Rotate Around Center is set, otherwise scaling will be done relative to the origin of the coordinate system. This is also affected by option Legacy scale/translate/rotate behavior (please consult help).

Translate

name: translate, type: Vector3, default: 0 0 0

Sets a translation vector to translate all nodes of the 3D mesh by.

Peform Operations on Global Center

name: globalCenter, type: Bool, default: TRUE

If this option is set, then all transformation operations and center is applied around the center of the overall bounding box and not only on the individual bounding boxes of all WEMPatches.

Center

name: center, type: Bool, default: FALSE

If checked, the WEM is centered around coordinate (0,0,0).

Note

This operation is applied per WEM patch, so this option probably doesn’t do what you want if there is more than one patch.

Rotation

name: rotation, type: Rotation, default: 0 0 1 0

Sets a rotation to rotate all nodes of the 3D mesh.

The rotation will happen around the center of the current WEM patch if Scale And Rotate Around Center is set, otherwise rotation will be done around the origin of the coordinate system. This is also affected by option Legacy scale/translate/rotate behavior (please consult help).

Legacy scale/translate/rotate behavior (please consult help)

name: legacySTRBehavior, type: Bool, default: FALSE

If this option is set, Scale, Translate, and Rotation are applied according to a previous algorithm (for backwards compatibility), which is partially broken:

  1. Scale around the center of the WEM
  2. Apply translation
  3. Rotate. Rotation was applied around the center of the WEM if the scaling value was not (1,1,1), otherwise around the origin of the coordinate system, but the point to rotate was in both cases already offset by the Translate value.

The setting of Peform Operations on Global Center is not taken into account for this operation.

We don’t recommend to use this mode in new networks.

This option has no effect if Use Transform Matrix is set.

Scale And Rotate Around Center

name: scaleAndRotateAroundCenter, type: Bool, default: TRUE

If this option is set, scaling and rotation will happen relative to the center of the WEM patch, otherwise relative to the origin of the coordinate system. If Center is set, the WEM is centered first anyway, and the option becomes pointless.

Note

This option is always on if Legacy scale/translate/rotate behavior (please consult help) is set.

Note

Since centers are computed per WEM patch, this option probably doesn’t do what you want if there is more than one patch.

Transform Matrix

name: transformMatrix, type: Matrix, default: 1 0 0 0, 0 1 0 0, 0 0 1 0, 0 0 0 1

Sets a matrix that is multiplied to each WEM node’s position of the 3D mesh if Use Transform Matrix is set.

Use Transform Matrix

name: useTransformMatrix, type: Bool, default: FALSE

If checked, Transform Matrix is applied directly to the mesh.

The values of Center, Scale, Translate, and Rotation are ignored in this case.

Mirror Faces

name: mirrorFaces, type: Bool, default: FALSE

If checked, all faces are mirrored, leading the surface to be inside-out.

Sort Faces

name: sortFaces, type: Bool, default: FALSE

If checked, the faces are sorted by their centroid’s z-positions.

Use this option for a slightly better rendering of transparent surfaces without any depth-sorting or depth-peeling.

Triangulate Faces

name: triangulateFaces, type: Bool, default: FALSE

If checked, all non-triangle faces are triangulated, resulting a triangle-only mesh.

The module uses the Mode.

Close Boundaries

name: closeBoundaries, type: Bool, default: FALSE

If checked, the module tries to close holes in a WEMPatch by a triangulation scheme.

Set node color

name: setNodeColor, type: Bool, default: FALSE

If checked, all nodes’ internal colors are set to the Color value.

Color

name: nodeColor, type: Color, default: 1 1 1

Sets the color that is set to all nodes if Set node color is checked.

Set node alpha

name: setNodeAlpha, type: Bool, default: FALSE

If checked, all nodes’ alpha values are set to the Alpha value.

Alpha

name: nodeAlpha, type: Float, default: 1, minimum: 0, maximum: 1

Sets the alpha value that is set to all nodes if the Set node alpha is checked.

Node (LUT) Value Mode

name: nodeValueMode, type: Enum, default: None

Defines if and how the nodes’ internal PVL LUT is modified.

Note that a clamping of these values occurs after modifying the value.

Values:

Title Name
None None
Set Set
Add Add
Multiply Multiply

Value

name: nodeValue, type: Double, default: 0

Set the value that is set as a node’s PVL value, added or multiplied to the original nodes’ PVL value.

Clamp value (clampNodeMinValue)

name: clampNodeMinValue, type: Bool, default: FALSE

If checked, all nodes’ internal PVL values are clamped to the To Min.

To Min

name: minClampValue, type: Double, default: 0

If Clamp value is checked, the nodes’ PVL values are clamped against this minimum value.

Clamp value (clampNodeMaxValue)

name: clampNodeMaxValue, type: Bool, default: FALSE

If checked all nodes’ internal PVL values are clamped to the To Max.

To Max

name: maxClampValue, type: Double, default: 4095

If Clamp value is checked, the nodes’ PVL values are clamped against this maximum value.

Merge All Patches Into Single Patch

name: mergeAllPatchesIntoSinglePatch, type: Bool, default: FALSE

If checked, all WEMPatches are merged into a single WEMPatch. This operation is performed at the end of all other operations.

Note that no spatial information are being used for the merging, i.e., no WEMNodes at the same location are being merged.

Note that this operation is not reversible, so once all patches have been merged, unchecking this field again does not demerge the patches.

Hidden Fields

isProcessing

name: isProcessing, type: Bool, persistent: no

see WEMGenerator.isProcessing

elapsedTime

name: elapsedTime, type: Float, persistent: no

see WEMGenerator.elapsedTime

id

name: id, type: Integer, default: 0

see WEMGenerator.id

shouldComputeNormals

name: shouldComputeNormals, type: Bool, default: TRUE

see WEMGenerator.shouldComputeNormals

workDirectlyOnInputWEMs

name: workDirectlyOnInputWEMs, type: Bool, default: FALSE

see WEMProcessor.workDirectlyOnInputWEMs

listenToFinishNotifications

name: listenToFinishNotifications, type: Bool, default: TRUE

see WEMProcessor.listenToFinishNotifications

listenToRepaintNotifications

name: listenToRepaintNotifications, type: Bool, default: TRUE

see WEMProcessor.listenToRepaintNotifications

listenToSelectionChangedNotifications

name: listenToSelectionChangedNotifications, type: Bool, default: TRUE

see WEMProcessor.listenToSelectionChangedNotifications

progress

name: progress, type: Float, persistent: no

see WEMProcessor.progress

WEMs

name: WEMs, type: String

selectedWEMs

name: selectedWEMs, type: String

modifyFieldsValid

name: modifyFieldsValid, type: Bool, default: TRUE