Model.morphconstraintupdatesmooth#

Model.morphconstraintupdatesmooth(nlist, type, closed, mcon, color)#

Updates a smooth type morphconstraint for the selected nodes. During morphing, the perturbations of the nodes or dependent handles will be modified using a spline based approximation so that edge domains running along the selected entities will have smooth contours.

Parameters:
  • nlist (EntityList) – The list containing the node entities.

  • type (int) –

    0 - Apply to nodes. All handles on the node list serve as anchors for the spline curve and nodes are adjusted to the curve based on influences

    1 - Apply to dependent handles. Only the independent handles on the node list serve as anchors and the dependent handles are adjusted to the curve based on influences

  • closed (int) –

    0 - Open ended

    1 - Loop. The first node on the list will be added to the end to form a loop

  • mcon (Entity) – The morph constraint entity to update.

  • color (int) – The color of the constraint. Valid values are 1 through 64.

Example#

Update a smooth morphconstraint for nodes with IDs 1-5 with a closed loop#
import hm
import hm.entities as ent

model = hm.Model()

model.morphconstraintupdatesmooth(
    nlist=[
        ent.Node(model, 1),
        ent.Node(model, 2),
        ent.Node(model, 3),
        ent.Node(model, 4),
        ent.Node(model, 5),
    ],
    type=0,
    closed=1,
    mcon=ent.Morphconstraint(model, 12),
    color=32,
)