Model.morphrotatetrue#

Model.morphrotatetrue(collection, plane_normal, plane_base, angle, sym, con, vari)#

Rotates handles on collection using ‘true’ rotation.

Parameters:
  • collection (Collection) – The collection containing the input handle entities.

  • plane_normal (hwTriple) – The hwTriple object defining the plane normal components defined by base point and vector of rotation. User can also supply a Python list of three doubles.

  • plane_base (hwTriple) – The hwTriple object defining the base point components of the plane defined by base point and vector of rotation. User can also supply a Python list of three doubles.

  • angle (double) – Angle of rotation.

  • sym (int) –

    Flag to use symmetry:

    0 - Do not use symmetry

    1 - Symmetry

  • con (int) –

    Flag to use constraints:

    0 - Do not use constraints

    1 - Use constraints

  • vari (int) –

    Type of rotation:

    0 - Constant

    1 - Linear

Note

If vari=0, all the handles will be rotated by the given angle.

If vari=1, the handle farthest from the base point of the plane will be rotated by the given angle and the other handles will be rotated by the given angle times the distance of each handle to the base point of the plane divided by the distance of the farthest handle to the base point of the plane. The distances are measured normal to the plane.

If symmetry is used, all handles linked to the collection of the handles by symmetry will also be rotated. If constraints are used, they will be applied to the rotations.

Example#

All handles in the collection selected intereactively will be rotated about the axis defined by the plane. This function differs from Model.morphhandlerotate() by the behavior of the influenced nodes. With this function the nodes are rotated about the axis by an amount proportional to the influence coefficient between the rotated handle and the node.#
import hm
import hm.entities as ent

model = hm.Model()

model.morphrotatetrue(
    collection=hm.CollectionByInteractiveSelection(model, ent.Handle),
    plane_normal=[1.0, 0.0, 0.0],
    plane_normal_base=[1.0, 0.0, 0.0],
    angle=30.0,
    sym=1,
    con=1,
    vari=0,
)