-
-
Notifications
You must be signed in to change notification settings - Fork 180
WIP ‐ Live2D Cubism
Bryan Edds edited this page Oct 19, 2023
·
7 revisions
Current algebra for design -
type CubismModel = private { __ : unit }
type UniqueString = unit
type KnobId = UniqueString
type KnobFriendlyName = string
type KnobSetting = single
type CubismPoseId = UniqueString
type KnobMetadata =
{ Min : single
Max : single
Default : Map<KnobId, KnobSetting>
KnobFriendlyName : KnobFriendlyName }
type CubismPose =
{ KnobSettings : Map<KnobId, KnobSetting> }
type CubismModelInstance =
{ ModelContainerMemoryPtr : voidptr
ModelMemoryPtr : voidptr
ModelContainerPtr : nativeint
ModelPtr : nativeint }
type CubismInstance =
{ CubismModelInstances : Map<CubismModel AssetTag, CubismModelInstance> }
type CubismContext =
{ CubismInstance : CubismInstance
KnobDefaultses : Map<CubismModel AssetTag, Map<KnobId, KnobSetting>> // TODO: consider making all map<id,settings> poses.
KnobMetadatases : Map<CubismModel AssetTag, Map<KnobId, KnobMetadata>>
CubismPoses : Map<CubismModel AssetTag, Map<CubismPoseId, CubismPose>> }
type CubismModelDescriptor =
{ KnobSettings : Map<KnobId, KnobSetting> (* low-level algebra *)
CubismPoseOpt : Choice<unit, CubismPoseId, single * CubismPoseId * CubismPoseId> (* high-level algebra *) }
type CubismModelMetadata =
{ KnobDefaults : Map<KnobId, KnobSetting>
KnobMetadatas : Map<KnobId, KnobMetadata> }