Model.morphregistergeometry#

Model.morphregistergeometry(collection, mode, target)#

Controls which geometric entities can be morphed and which type of morphing affects them. Currently only the geometry associated with point and line connectors can be morphed and they can only be morphed by morph volumes. Area connectors cannot be morphed nor can line and surface entities, and morphing operations that do not involve morph volumes will not affect any geometric entities.

Connectors should be reregistered whenever their relative positions inside the morph volumes change, such as, if they are translated and the morph volumes are not. This will ensure that they are not reverted to their previous locations inside the morph volumes when those morph volumes are morphed. Note that any registered connectors are automatically reregistered if morph volumes are made “inactive,” morphed, and then made “active” again.

When the morphing of connectors is saved as a shape, applying the shape will morph those connectors even if the morph volumes have been deleted or the connectors have been unregistered. Shapes saved along with the model file will still affect connectors when the file is reloaded. However, shapes written using Model.morphsaveshape() and read using Model.morphloadshape() will no longer affect connectors.

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

  • mode (unsigned int) –

    Registers and unregisters connectors. If any part of a line or point connector is registered to the morph volumes and are within a morph volume, they will be morphed along with the morph volumes, while unregistered connectors will be unaffected.

    0 - Register connectors on collection and unregister connectors not on collection

    1 - Register connectors on collection

    2 - Unregister connectors on collection

    3 - Reregister all registered connectors (collection is not used)

  • target (unsigned int) – 1 - Morph volumes

Example#

Update all connectors in the model to be registered to morph volumes#
import hm
import hm.entities as ent

model = hm.Model()

model.morphregistergeometry(
    collection=hm.Collection(model, ent.Connector), mode=1, target=1
)