Purpose

The module WEMModify modifies nodes and/or faces.

Node modifications consist of scaling, translating, rotating, and centering the WEM. Additionally, the internal RGBA colors of the nodes 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 the appropriate parameters to modify.

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

Details

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

Otherwise, these fields are applied in the following 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 the 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

When pressed, the module computes anew.

see also WEMGenerator.apply

Clear

name: clear, type: Trigger

When 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) contain 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.

Scaling occurs relative to the center of the current WEM patch if Scale And Rotate Around Center is set; otherwise, scaling is done relative to the origin of the coordinate system. This is also affected by the 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.

Perform operations on global center

name: globalCenter, type: Bool, default: TRUE

If checked, all transformation operations and centering are applied around the center of the overall bounding box, rather than only on the individual bounding boxes of each WEM patch.

Center

name: center, type: Bool, default: FALSE

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

Note

This operation is applied per WEM patch, so this option may not achieve the desired effect 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 occurs around the center of the current WEM patch if Scale And Rotate Around Center is set; otherwise, the rotation is performed around the origin of the coordinate system. This is also affected by the option Legacy scale/translate/rotate behavior (please consult help).

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

name: legacySTRBehavior, type: Bool, default: FALSE

If checked, Scale, Translate, and Rotation are applied according to a previous algorithm (for backward compatibility), which is partially broken:

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

The setting of Perform operations on global center is not taken into account for this operation.

We do not recommend using 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 checked, scaling and rotation occur relative to the center of the WEM patch; otherwise, they occur relative to the origin of the coordinate system. If Center is set, the WEM is centered first anyway, making this option pointless.

Note

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

Note

Since centers are computed per WEM patch, this option may not achieve the desired effect 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 with each WEM node’s position in 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, causing the surface to become 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 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 in a triangle-only mesh.

The module uses the Mode.

Close Boundaries

name: closeBoundaries, type: Bool, default: FALSE

If checked, the module attempts to close holes in a WEM patch using a triangulation scheme.

Set node color

name: setNodeColor, type: Bool, default: FALSE

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

Color

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

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

Set node alpha

name: setNodeAlpha, type: Bool, default: FALSE

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

Alpha

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

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

Node (LUT) Value Mode

name: nodeValueMode, type: Enum, default: None

Defines if and how the internal Primitive Value List (PVL) LUT of the nodes is modified.

Note that clamping of these values may occur after modification.

Values:

Title Name
None None
Set Set
Add Add
Multiply Multiply

Value

name: nodeValue, type: Double, default: 0

Sets the value assigned as a Primitive Value List (PVL) value to the nodes, added to or multiplied with the original PVL value of the nodes.

Clamp value (clampNodeMinValue)

name: clampNodeMinValue, type: Bool, default: FALSE

If checked, the internal Primitive Value List (PVL) values of all nodes are clamped to the To Min.

To Min

name: minClampValue, type: Double, default: 0

If Clamp value is checked, the Primitive Value List (PVL) values of all nodes are clamped against this minimum value.

Clamp value (clampNodeMaxValue)

name: clampNodeMaxValue, type: Bool, default: FALSE

If checked, the internal Primitive Value List (PVL) values of all nodes are clamped to the To Max.

To Max

name: maxClampValue, type: Double, default: 4095

If Clamp value is checked, the Primitive Value List (PVL) values of all nodes are clamped against this maximum value.

Merge All Patches Into Single Patch

name: mergeAllPatchesIntoSinglePatch, type: Bool, default: FALSE

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

Note: No spatial information is used for the merging; that is, no WEM nodes that share a location are merged.

Note: This operation is not reversible, so once all patches have been merged, unchecking this field 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