Class: CubismLegacyModelSettings
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:4985
Parses, and provides access to the settings JSON.
Extends
Constructors
Constructor
> new CubismLegacyModelSettings(json): CubismLegacyModelSettings
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:5002
Parameters
json
ModelJSON & object
Returns
CubismLegacyModelSettings
Overrides
Properties
expressions?
> optional expressions?: Expression[]
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:4995
hitAreas?
> optional hitAreas?: HitArea[]
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:4992
initOpacities?
> optional initOpacities?: InitOpacity[]
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:4994
initParams?
> optional initParams?: InitParam[]
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:4993
json
> json: ModelJSON
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:4986
Overrides
layout?
> optional layout?: Layout
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:4991
moc
> moc: string
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:4987
Relative path of he moc file, typically ends with .moc in Cubism 2 and .moc3 in Cubism 4.
Overrides
motions
> motions: Record<string, Motion[]>
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:4996
name
> name: string
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:519
The model's name, typically used for displaying or logging. By default it's inferred from
the URL by taking the folder name (the second to last component). In Cubism 2 it'll be overwritten
by the name field of settings JSON.
Inherited from
physics?
> optional physics?: string
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:4990
Relative path of the physics file.
Overrides
pose?
> optional pose?: string
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:4989
Relative path of the pose file.
Overrides
textures
> textures: string[]
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:4988
Relative paths of the texture images.
Overrides
url
> url: string
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:524
URL of the model settings file, used to resolve paths of the resource files defined in settings.
This typically ends with .model.json in Cubism 2 and .model3.json in Cubism 4.
Inherited from
Methods
copy()
> protected copy(json): void
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:5008
Validates and copies optional properties from raw JSON.
Parameters
json
Returns
void
getDefinedFiles()
> getDefinedFiles(): string[]
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:594
Retrieves all resource files defined in the settings.
Returns
string[]
A flat array of the paths of all resource files.
modelSettings.getDefinedFiles();
// returns: ["foo.moc", "foo.png", ...]Inherited from
getFileStem()
> protected getFileStem(path?): string | undefined
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:560
Returns the file name without extension from a path.
Parameters
path?
string
Returns
string | undefined
Inherited from
normalizeName()
> protected normalizeName(): void
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:551
Ensures the model name is meaningful; falls back to the folder name when missing or placeholder.
Returns
void
Inherited from
replaceFiles()
> replaceFiles(replace): void
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:5009
Replaces the resource files by running each file through the replacer.
Parameters
replace
(file, path) => string
Returns
void
Overrides
resolveURL()
> resolveURL(path): string
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:567
Resolves a relative path using the url. This is used to resolve the resource files defined in the settings.
Parameters
path
string
Relative path.
Returns
string
Resolved path.
Inherited from
setModelName()
> protected setModelName(...candidates): void
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:556
Picks the first non-empty, non-placeholder name from candidates and applies it. Falls back to normalizeName when no candidate is usable.
Parameters
candidates
...(string | undefined)[]
Returns
void
Inherited from
validateFiles()
> validateFiles(files): string[]
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:603
Validates that the files defined in the settings exist in given files. Each file will be resolved by resolveURL before comparison.
Parameters
files
string[]
A flat array of file paths.
Returns
string[]
All the files which are defined in the settings and also exist in given files, including the optional files.
Throws
Error if any essential file is defined in settings but not included in given files.
Inherited from
isValidJSON()
> static isValidJSON(json): json is ModelJSON
Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:5001
Checks if a JSON object is valid model settings.
Parameters
json
unknown
Returns
json is ModelJSON