3ds Max scene exporter/Morph targets

From PixelLight
Jump to: navigation, search

By using "morph targets" (vertex animation) you can blend together multiple meshes to create, for example, whole character animations, facial expressions or just tiny mesh modifications like a growing nose if the character is lying. Nowadays, the first case, creating whole character animations, is 'out of date' and skeleton animation is used instead because it is more memory efficient and flexible. But sometimes just a few vertices should be manipulated - this is where morph targets are still quite handy.

The goal of this tutorial is not to show how to create complex facial expressions, but to show you the very basics of morph targets. The rest is just more work inside 3ds Max - and this is not a tutorial teaching you how to become a 3ds Max god.

This tutorial builds upon the results of 'Your first PixelLight scene'. So download the file of this tutorial and open the 3ds Max file.

3dsMaxSceneExporterTutorial MorphTargets 1.jpg

To create morph targets we need morph targets... to do so, select the 'Room' (1) node and create two clones (2) - do this by selecting 'Copy' and not 'Instance' or 'Reference' because we are going to manipulate the mesh of each clone. Manipulate the vertices of the clones a bit, you should already know how to do this from the other tutorials. (from Cells and portals for example)

3dsMaxSceneExporterTutorial MorphTargets 2.jpg

Now we add a "Morpher"-modifier to our room. Select the 'Room' node within a viewport, (1) click on the 'OBJECT-SPACE MODIFIER -> Modifier List' combo box (2) and finally select 'Morpher'. (3)

3dsMaxSceneExporterTutorial MorphTargets 3.jpg

Now that we have a "Morpher"-modifier we need to feed it with our morph targets. Within the dialog of this modifier, click on the first empty slot within the 'Channel List. (1) If necesssary, scroll down the dialog until you can see the 'Pick Object from Scene' button within the 'Channel Parameters' group. (2) Click on the first clone of the room. (3) Repeat the process for the next free slot within the 'Channel List and the second clone.

Congratulations! You now have a mesh with morph targets! To test the result just play around with the spinner controls within the 'Channel List and you should be able to see the morphing effect. If all is fine go ahead, and please do not edit the mesh again after the morph targets were generated, this may not lead to visible problems within 3ds Max itself - but inside the 3ds Max morpher modifier invalid data may be stored and after the export all or at least some vertices may be manipulated in the wrong way...

The morpher modifier stores the deltas of the morph targets internally - you can now delete the two clones of the room, this is especially good to keep an overview of huge scenes. When the clones are gone, play again with the spinner controls of the morph targets. See, it still works as I told you.

If you need the morph target mesh nodes again later, you can revive them by just selecting the morph targets within the morpher modifier dialog and then pressing the 'Extract button near the 'Pick Object from Scene' button.

Finally to the PixelLight part - just export the scene. That's all!

By default, the scene exporter adds morph scene node modifiers so you can for example manipulate the morph targets within the debug dialog to test things out.

One last note: It is recommended to click 'Zero Active Channel Values near 'Channel List before exporting the scene, else the result may not be as expected.


Tutorial file: 3dsMaxSceneExporterTutorial_MorphTargets.zip (3ds Max 2008)
Personal tools