# Class: CubismLegacyModelSettings (/pixi-vn-live2d/core/classes/CubismLegacyModelSettings)



Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:4985

Parses, and provides access to the settings JSON.

## Extends [#extends]

* [`ModelSettings`](/pixi-vn-live2d/core/classes/ModelSettings)

## Constructors [#constructors]

### Constructor [#constructor]

\> **new CubismLegacyModelSettings**(`json`): `CubismLegacyModelSettings`

Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:5002

#### Parameters [#parameters]

##### json [#json]

[`ModelJSON`](/pixi-vn-live2d/core/namespaces/Cubism2Spec/interfaces/ModelJSON) & `object`

#### Returns [#returns]

`CubismLegacyModelSettings`

#### Overrides [#overrides]

[`ModelSettings`](/pixi-vn-live2d/core/classes/ModelSettings).[`constructor`](/pixi-vn-live2d/core/classes/ModelSettings#constructor)

## Properties [#properties]

### expressions? [#expressions]

\> `optional` **expressions?**: [`Expression`](/pixi-vn-live2d/core/namespaces/Cubism2Spec/interfaces/Expression)\[]

Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:4995

***

### hitAreas? [#hitareas]

\> `optional` **hitAreas?**: [`HitArea`](/pixi-vn-live2d/core/namespaces/Cubism2Spec/interfaces/HitArea)\[]

Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:4992

***

### initOpacities? [#initopacities]

\> `optional` **initOpacities?**: [`InitOpacity`](/pixi-vn-live2d/core/namespaces/Cubism2Spec/interfaces/InitOpacity)\[]

Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:4994

***

### initParams? [#initparams]

\> `optional` **initParams?**: [`InitParam`](/pixi-vn-live2d/core/namespaces/Cubism2Spec/interfaces/InitParam)\[]

Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:4993

***

### json [#json-1]

\> **json**: [`ModelJSON`](/pixi-vn-live2d/core/namespaces/Cubism2Spec/interfaces/ModelJSON)

Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:4986

#### Overrides [#overrides-1]

[`ModelSettings`](/pixi-vn-live2d/core/classes/ModelSettings).[`json`](/pixi-vn-live2d/core/classes/ModelSettings#json)

***

### layout? [#layout]

\> `optional` **layout?**: [`Layout`](/pixi-vn-live2d/core/namespaces/Cubism2Spec/interfaces/Layout)

Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:4991

***

### moc [#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 [#overrides-2]

[`ModelSettings`](/pixi-vn-live2d/core/classes/ModelSettings).[`moc`](/pixi-vn-live2d/core/classes/ModelSettings#moc)

***

### motions [#motions]

\> **motions**: `Record`\<`string`, [`Motion`](/pixi-vn-live2d/core/namespaces/Cubism2Spec/interfaces/Motion)\[]>

Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:4996

***

### name [#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 [#inherited-from]

[`ModelSettings`](/pixi-vn-live2d/core/classes/ModelSettings).[`name`](/pixi-vn-live2d/core/classes/ModelSettings#name)

***

### physics? [#physics]

\> `optional` **physics?**: `string`

Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:4990

Relative path of the physics file.

#### Overrides [#overrides-3]

[`ModelSettings`](/pixi-vn-live2d/core/classes/ModelSettings).[`physics`](/pixi-vn-live2d/core/classes/ModelSettings#physics)

***

### pose? [#pose]

\> `optional` **pose?**: `string`

Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:4989

Relative path of the pose file.

#### Overrides [#overrides-4]

[`ModelSettings`](/pixi-vn-live2d/core/classes/ModelSettings).[`pose`](/pixi-vn-live2d/core/classes/ModelSettings#pose)

***

### textures [#textures]

\> **textures**: `string`\[]

Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:4988

Relative paths of the texture images.

#### Overrides [#overrides-5]

[`ModelSettings`](/pixi-vn-live2d/core/classes/ModelSettings).[`textures`](/pixi-vn-live2d/core/classes/ModelSettings#textures)

***

### url [#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 [#inherited-from-1]

[`ModelSettings`](/pixi-vn-live2d/core/classes/ModelSettings).[`url`](/pixi-vn-live2d/core/classes/ModelSettings#url)

## Methods [#methods]

### copy() [#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 [#parameters-1]

##### json [#json-2]

[`ModelJSON`](/pixi-vn-live2d/core/namespaces/Cubism2Spec/interfaces/ModelJSON)

#### Returns [#returns-1]

`void`

***

### getDefinedFiles() [#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 [#returns-2]

`string`\[]

A flat array of the paths of all resource files.

```js
modelSettings.getDefinedFiles();
// returns: ["foo.moc", "foo.png", ...]
```

#### Inherited from [#inherited-from-2]

[`ModelSettings`](/pixi-vn-live2d/core/classes/ModelSettings).[`getDefinedFiles`](/pixi-vn-live2d/core/classes/ModelSettings#getdefinedfiles)

***

### getFileStem() [#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 [#parameters-2]

##### path? [#path]

`string`

#### Returns [#returns-3]

`string` | `undefined`

#### Inherited from [#inherited-from-3]

[`ModelSettings`](/pixi-vn-live2d/core/classes/ModelSettings).[`getFileStem`](/pixi-vn-live2d/core/classes/ModelSettings#getfilestem)

***

### normalizeName() [#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 [#returns-4]

`void`

#### Inherited from [#inherited-from-4]

[`ModelSettings`](/pixi-vn-live2d/core/classes/ModelSettings).[`normalizeName`](/pixi-vn-live2d/core/classes/ModelSettings#normalizename)

***

### replaceFiles() [#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 [#parameters-3]

##### replace [#replace]

(`file`, `path`) => `string`

#### Returns [#returns-5]

`void`

#### Overrides [#overrides-6]

[`ModelSettings`](/pixi-vn-live2d/core/classes/ModelSettings).[`replaceFiles`](/pixi-vn-live2d/core/classes/ModelSettings#replacefiles)

***

### resolveURL() [#resolveurl]

\> **resolveURL**(`path`): `string`

Defined in: node_modules/untitled-pixi-live2d-engine/types/index.d.ts:567

Resolves a relative path using the [url](/pixi-vn-live2d/core/classes/ModelSettings#url). This is used to resolve the resource files
defined in the settings.

#### Parameters [#parameters-4]

##### path [#path-1]

`string`

Relative path.

#### Returns [#returns-6]

`string`

Resolved path.

#### Inherited from [#inherited-from-5]

[`ModelSettings`](/pixi-vn-live2d/core/classes/ModelSettings).[`resolveURL`](/pixi-vn-live2d/core/classes/ModelSettings#resolveurl)

***

### setModelName() [#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](/pixi-vn-live2d/core/classes/ModelSettings#normalizename) when no candidate is usable.

#### Parameters [#parameters-5]

##### candidates [#candidates]

...(`string` | `undefined`)\[]

#### Returns [#returns-7]

`void`

#### Inherited from [#inherited-from-6]

[`ModelSettings`](/pixi-vn-live2d/core/classes/ModelSettings).[`setModelName`](/pixi-vn-live2d/core/classes/ModelSettings#setmodelname)

***

### validateFiles() [#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](/pixi-vn-live2d/core/functions/resolveURL) before comparison.

#### Parameters [#parameters-6]

##### files [#files]

`string`\[]

A flat array of file paths.

#### Returns [#returns-8]

`string`\[]

All the files which are defined in the settings and also exist in given files,
*including the optional files*.

#### Throws [#throws]

Error if any *essential* file is defined in settings but not included in given files.

#### Inherited from [#inherited-from-7]

[`ModelSettings`](/pixi-vn-live2d/core/classes/ModelSettings).[`validateFiles`](/pixi-vn-live2d/core/classes/ModelSettings#validatefiles)

***

### isValidJSON() [#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 [#parameters-7]

##### json [#json-3]

`unknown`

#### Returns [#returns-9]

`json is ModelJSON`
