Thanks @Swordslayer for your response, but I currently struggle with how to conceptualize the Morpher implementation, and its associated channels and where these keyframes are actually stored.
If you have any experience with the 3dsMax C# (or C++) API, what would the equivalent to your code snippet:
$.morpher[1][1].keys
if $ represents our currently selected IIGameNode mesh and $.morpher is the IIGameMorpher applied to the mesh. Why do we need to index twice, and what do these indices correspond to?
Currently I do something along the lines of (I wish i had a template to to minimize my MaxAPI project for quick execution):
// Retreive modifiers with morpher flag
List<IIGameModifier> modifiers = new List<IIGameModifier>();
for (int i = 0; i < meshNode.IGameObject.NumModifiers; i++)
{
var modifier = meshNode.IGameObject.GetIGameModifier(i);
if (modifier.ModifierType == Autodesk.Max.IGameModifier.ModType.Morpher)
{
modifiers.Add(modifier);
}
}
// Cast modifiers to morphers
List<IIGameMorpher> morphers = modifiers.ConvertAll(new Converter<IIGameModifier, IIGameMorpher>(modifier => modifier.AsGameMorpher()));
var hasMorphTarget = false;
morphers.ForEach(morpher =>
{
if (morpher.NumberOfMorphTargets > 0)
{
hasMorphTarget = true;
}
});
if (hasMorphTarget)
{
morphers.ForEach(morpher =>
{
for (int i = 0; i < morpher.NumberOfMorphTargets; i++)
{
// Morph target
var maxMorphTarget = morpher.GetMorphTarget(i);
// Ensure target still exists (green color legend)
if (maxMorphTarget != null)
{
var morphWeight = morpher.GetMorphWeight(i);
ITab<IIGameKey> gameKeyTab = GlobalInterface.Instance.Tab.Create<IIGameKey>();
// Here we don't get any keys from the API. :'(
morphWeight.GetQuickSampledKeys(gameKeyTab, IGameControlType.Float);
// This also returns 0 when ran against my original scene
morphWeight.GetNumOfListSubControls(IGameControlType.Float);
}
}
});
}
I assume that the first index of the MaxScript snippet is similar to morpher.GetMorphWeight(i), but I, I don't quite understand how to retrieve the sub controller that I assume corresponds to your second index, and what actual class structure applies to the hierarchy seen in the dopesheet in my first post. Yikes.
This seems like alot, but got any idea what I should be doing here?