Class Morph
Namespace: ValveResourceFormat.ResourceTypes
Assembly: ValveResourceFormat.dll
Represents a morph (flex) resource containing vertex deformation data.
public class Morph : KeyValuesOrNTROInheritance
object ← Block ← KeyValuesOrNTRO ← Morph
Inherited Members
KeyValuesOrNTRO.Type, KeyValuesOrNTRO.Data, KeyValuesOrNTRO.Format, KeyValuesOrNTRO.Read(BinaryReader), KeyValuesOrNTRO.Serialize(Stream), KeyValuesOrNTRO.WriteText(IndentedTextWriter), Block.Type, Block.Offset, Block.Size, Block.Resource, Block.Read(BinaryReader), Block.ToString(), Block.WriteText(IndentedTextWriter), Block.Serialize(Stream)
Extension Methods
ResourceDataExtensions.AsKeyValueCollection(Block)
Constructors
Morph(BlockType)
Initializes a new instance of the class.
public Morph(BlockType type)Parameters
type BlockType
Properties
FlexControllers
Gets the flex controllers that drive morph animations.
public FlexController[] FlexControllers { get; }Property Value
FlexRules
Gets the flex rules that define how controllers affect morphs.
public FlexRule[] FlexRules { get; }Property Value
FlexRule[]
Texture
Gets the texture containing encoded morph deltas.
public Texture? Texture { get; }Property Value
TextureResource
Gets the resource containing the morph texture.
public Resource? TextureResource { get; }Property Value
Methods
GetBundleTypes()
Gets what each bundle of a morph rect holds. The bundle types are shared by every rect, so this indexes into a rect's m_bundleDatas.
public MorphBundleType[] GetBundleTypes()Returns
GetFlexDescriptors()
Gets the list of flex descriptors.
public List<string> GetFlexDescriptors()Returns
GetFlexNamesWithData()
Gets the names of the flexes returns deltas for, without decoding the atlas.
public HashSet<string> GetFlexNamesWithData()Returns
GetFlexVertexCoverage()
Gets which vertices each flex places a rect over, whether or not the delta there quantised to zero. A writer that only kept the non-zero deltas would hand the atlas packer a more fragmented shape than the one it started from.
public Dictionary<string, bool[]> GetFlexVertexCoverage()Returns
Dictionary<string, bool[]>
GetFlexVertexData()
Gets the flex vertex data as a dictionary mapping flex names to vertex positions.
public Dictionary<string, Vector3[]> GetFlexVertexData()Returns
Dictionary<string, Vector3[]>
GetFlexVertexData(MorphBundleType)
Gets the deltas of one bundle, keyed by flex name. The fourth component carries the speed of a position bundle or the wrinkle weight of a normal bundle.
public Dictionary<string, Vector4[]> GetFlexVertexData(MorphBundleType bundleType)Parameters
bundleType MorphBundleType
Returns
Dictionary<string, Vector4[]>
GetMorphCount()
Gets the number of morphs.
public int GetMorphCount()Returns
GetMorphDatas()
Gets the morph data collection.
public IReadOnlyList<KVObject> GetMorphDatas()Returns
IReadOnlyList<KVObject>
LoadFlexData(IFileLoader)
Loads flex data from the file loader.
public void LoadFlexData(IFileLoader fileLoader)Parameters
fileLoader IFileLoader

