Skip to content

Changes in v0.3.0

Guan edited this page Jan 22, 2021 · 6 revisions

New Structure

Cubism 4 is finally supported!

To support two versions of Cubism, the common code of their components had been extracted to several abstract classes and respective implementations. See Main Components.

Model Creation

Prior creation methods...

Live2DModel.fromModelSettingsFile();
Live2DModel.fromModelSettingsJSON();
Live2DModel.fromModelSettings();
Live2DModel.fromResources();

...has been merged into a single method:

Live2DModel.from();

See Creating a Model.

Full Change Logs

v0.3.0-beta

There are many breaking changes, please be careful.

Live2DFactory (new)

Newly added to handle the resource-loading tasks, including the ones from MotionManager and ExpressionManager.

  • Loads resources by native XHR and PIXI.Texture.from(), instead of PIXI.Loader
  • Allows PIXI.Textures to be loaded from cache

Live2DModel

  • Renamed .internal to .internalModel
  • Added synchronous creation method
  • Improved shorthands for starting motions and setting expressions
  • Fixed missing textures when they've been GCed
  • Now releases resources when being destroyed

InternalModel (prior Live2DInternalModel)

  • Renamed .matrix to .localTransform
  • Renamed .modelSettings to .settings
  • Added isHit() to test a single hit area
  • Added textureFlipY to flag the value of gl.UNPACK_FLIP_Y_WEBGL

ModelSettings

  • Renamed .isModelSettingsJSON to .isValidJSON
  • Renamed .resolvePath to .resolveURL
  • Now the isValidJSON() check only passes when the texture array contains only strings
  • No longer converts JSON keys to camel case

MotionManager

  • Renamed .modelSettings to .settings
  • Added motionStart and motionFinish event
  • Added motionPreload option for motion preloading
  • Moved management of motion loading tasks to Live2DFactory
  • Now holds the queue manager as a property, instead of inheriting from it
  • No longer loads multiple motions in loadMotion()
  • Removed coreModel, instead the core model should be passed to the update method

ExpressionManager

  • Renamed .modelSettings to .settings
  • Moved management of expression loading tasks to Live2DFactory
  • Now holds the queue manager as a property, instead of inheriting from it
  • No longer preloads expressions
  • Removed coreModel, instead the core model should be passed to the update method

Live2DExpression

  • No longer accepts a core model in constructor

Other Changes

  • Now provides multiple bundles for each platform and each Cubism version
  • Changed JS output target to ES6
  • Type definitions of Cubism 2 model settings have been wrapped in Cubism2Spec namespace
  • Prior interaction setup has become InteractionMixin for Live2DModel
  • Added tool HitAreaFrames for debugging (only exported in browser builds)
  • Excluded private members in generated API docs

v0.3.0-beta.1

  • Breaking change
    • Changed MotionPreloadStrategy and MotionPriority to be enums
  • Added individual hitTest() method in Live2DModel
  • Improved visualization of HitAreaFrames
  • Fixed error when creating expression by a JSON without parameters
  • Fixed error when missing CubismClippingContext on rendering
  • Improved type definitions for inheritance of Live2DModel
  • Fixed error when the idle group is missing in model
  • Moved transformation calculation from Live2DTransform to Live2DModel
  • Fixed rotation and skew were not correctly being applied to Live2D
  • Bumped Pixi to v5.3.7
  • Fixed createTexture() rejects with ErrorEvent instead of Error on Pixi v5.3.0+
  • Added friendly warning when missing Cubism runtime
  • Added events while updating InternalModel: beforeMotionUpdate, afterMotionUpdate, beforeModelUpdate
  • Split update methods in InternalModel: updateFocus(), updateNaturalMovements()
  • Fixed issue with obsolete PIXI.interaction namespace on newer version of Pixi
  • Made eyeBlink optional in Cubism2InternalModel
  • Now supports rendering to render textures

v0.3.0-beta.2

I will no longer convert the tenses in my commit messages... never mind.

  • Breaking changes
    • Do not allow omitting url property in settings JSON
    • Improve methods relating to drawables in InternalModel
      • getHitArea(string) -> getDrawableBounds(number)
      • getHitAreaVertices(number) -> getDrawableVertices(number)
      • Add getDrawableIDs()
      • Add getDrawableIndex()
  • Clean up framework code
  • Fix incorrect value of url property in network error
  • Prevent MotionManager from starting idle motions when it's not fully idle
  • Fix MotionManager.startRandomMotion() tries to start motions that have already failed in loading
  • Fix resources are not correctly released when Live2DModel is being destroyed
  • Fix frozen process when having various cubism4 models at the same time
  • Export a VERSION string

v0.3.0

  • Breaking changes
    • Naming, members and function parameters
      • Live2DFactory
        • getRuntime() -> findRuntime()
      • InternalModel
        • updateTransform(transform: Matrix, width: number, height: number) ->
          updateTransform(transform: Matrix)
      • MotionState
        • clear() -> reset()
      • MotionManager
        • updateMotion() -> updateParameters()
        • motionPreload -> (removed)
      • ExpressionManager
        • startMotion() -> _setExpression()
        • stopAllMotions() -> _stopAllExpressions()
        • updateMotion() -> updateParameters()
    • Export model creation middlewares as static members of Live2DFactory
    • Change Bounds definition to satisfy PIXI.Rectangle
      • { top, right, bottom, left } -> { x, y, width, height }
      • This affects getDrawableBounds() in InternalModel
    • Emit "destroy" event before destroying the instance
    • Return false when calling setExpression() with the index of current Expression
    • Throw an error if Live2DRuntime.createModelSettings() receives an invalid JSON

  • Add experimental support for 4x4 mask divisions in Cubism 4
  • Add methods in ModelSettings to iterate through all defined files
    • getDefinedFiles()
    • replaceFiles()
  • Add load events for motions and expressions
    • motionLoaded
    • motionLoadError
    • expressionLoaded
    • expressionLoadError
  • Add option to focus on position instantly
  • Add idleMotionGroup option for specifying the idle group in MotionManager
  • Add config options for default fading durations of motions and expressions
  • Add support for loading model from uploaded files, or a zip file
  • Fix isValidJSON() allows empty texture array
  • Fix user events in cubism4 motions are not handled
  • Fix duplicated XHRLoader in Live2DLoader middlewares
  • Fix rendering to framebuffer doesn't work properly for certain cubism2 models
  • Fix motion parsing fails on certain models
  • Fix errors when destroying Live2DModel without ever being rendered
  • Fix loading tasks are not correctly canceled when destroying the loading targets
  • Fix error when a motion is loaded in destroyed MotionManager
  • Fix audio still plays when the motion has been loaded but is rejected to play
  • Fix framebuffer binding is reset to null when rendering cubism2 model in a different WebGL context
  • Fix Live2DModel can be updated by Ticker before initialized
  • Fix drawing offset when rendering in a viewport whose size differs from that of current render texture (like using PIXI.Filter)
  • Fix reserveExpressionIndex is not reset when the expression has been loaded
  • Load pose and physics in parallel
  • Throw an error when creating core model with invalid moc data (to avoid crashing the browser when that happens in Cubism 2)
  • Do not choose active motions/expressions when making a random choice (active means the current one or the reserved one)