Morphing Generated Objects
You can use a combination of the Generator object and Morph modifier to change generated objects from one to another. This page shows how this can be done.
In its current version, morphing is a little tricky to set up and use. Please read this section before attempting to do this. We welcome feedback on how this could be simplified and improved.
Purpose and prerequisite
The purpose of this modifier is to allow an object generated by the Generator object to morph over a period of time into another object. This means that you have an initial or source object (this is the object you want to change) and at least one morph target (this is the object you want it to change into). For this to happen, your scene must be set up in this way:
- the initial object and all the morph targets MUST have the same vertex count. They cannot differ, not even by 1 vertex. If they do, no morphing will occur
- the initial object MUST be the first child object of the Generator
- the morph targets must also be child objects of the Generator, in the order you want the changes to take place. For example, if you want an object to morph to 1 target, then for that object to morph into a second target, the initial target must be the first child, the first morph target must be the second child, and the second morph target must be the third child object, etc.
- all the morph targets (but not the initial object) must be dropped into the 'Morph targets' list in the Generator, in the same order as above
Using the Morph modifier
Once you have set the scene up as described above, add a morph modifier to the scene. By default this will morph the generated object from the initial object into the first object in the 'Morph targets' list in the Generator. You can change the morph target in the Generator by changing the 'Morph target index' from the default value in the Generator.
This simple scene would then look like this in the Object Manager:
Played in the editor you would see something like this:
You can see the cube gradually changes into a cube with extrusions.
On morph completion
The morph is complete when the morph reaches the 'Morph Maximum' value in the modifier. By default this is 100%, meaning that the initial object will completely change into the morph target object. At that point you can add Actions to the morph modifier, and there is another very important switch in the modifier - 'Switch Generator to Morph Target'.
If this switch is unchecked, then each frame the Generator will have to morph the initial object into the target. This takes time, especially with objects which have many vertices. If this switch is checked, the Generator will simply generate the morph target object instead of the original one, once the morph is completed. Of course, for this to work correctly the initial object must be fully morphed into the target, otherwise you will see a sudden jump from the partially-completed morph to the morph target object.
In general it is recommended that this switch is checked and only unchecked if you want morph values of less than 100%. In that case, uncheck it so that you don't see a jump in the object when the generator changes the object generated.
For more information please see the Morph modifier and Morph action pages.