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



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

Parses, and provides access to the settings JSON.

## Extends [#extends]

* [`CubismModelSettingJsonMixin`](/pixi-vn-live2d/core/type-aliases/CubismModelSettingJsonMixin).[`ModelSettings`](/pixi-vn-live2d/core/classes/ModelSettings)

## Constructors [#constructors]

### Constructor [#constructor]

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

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

#### Parameters [#parameters]

##### json [#json]

`any`

#### Returns [#returns]

`CubismModelSettings`

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

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

## Properties [#properties]

### expressions? [#expressions]

\> `optional` **expressions?**: `Expression`\[]

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

***

### getEyeBlinkParameterCount [#geteyeblinkparametercount]

\> **getEyeBlinkParameterCount**: () => `number`

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

#### Returns [#returns-1]

`number`

#### Inherited from [#inherited-from-1]

`CubismModelSettingJsonMixin.getEyeBlinkParameterCount`

***

### getEyeBlinkParameterId [#geteyeblinkparameterid]

\> **getEyeBlinkParameterId**: (`index`) => `CubismId`

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

#### Parameters [#parameters-1]

##### index [#index]

`number`

#### Returns [#returns-2]

`CubismId`

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

`CubismModelSettingJsonMixin.getEyeBlinkParameterId`

***

### getLipSyncParameterCount [#getlipsyncparametercount]

\> **getLipSyncParameterCount**: () => `number`

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

#### Returns [#returns-3]

`number`

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

`CubismModelSettingJsonMixin.getLipSyncParameterCount`

***

### getLipSyncParameterId [#getlipsyncparameterid]

\> **getLipSyncParameterId**: (`index`) => `CubismId`

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

#### Parameters [#parameters-2]

##### index [#index-1]

`number`

#### Returns [#returns-4]

`CubismId`

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

`CubismModelSettingJsonMixin.getLipSyncParameterId`

***

### hitAreas? [#hitareas]

\> `optional` **hitAreas?**: `object`\[]

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

#### Id [#id]

\> **Id**: `string`

#### Name [#name]

\> **Name**: `string`

***

### json [#json-1]

\> **json**: `ModelJSON`

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

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

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

***

### layout? [#layout]

\> `optional` **layout?**: `Record`\<`string`, `number`>

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

***

### moc [#moc]

\> **moc**: `string`

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

Relative path of he moc file, typically ends with `.moc` in Cubism 2 and `.moc3` in Cubism 4.

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

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

***

### motions? [#motions]

\> `optional` **motions?**: `Record`\<`string`, `Motion`\[]>

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

***

### name [#name-1]

\> **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-7]

[`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:540

Relative path of the physics file.

#### Inherited from [#inherited-from-8]

[`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:536

Relative path of the pose file.

#### Inherited from [#inherited-from-9]

[`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:6027

Relative paths of the texture images.

#### Inherited from [#inherited-from-10]

[`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-11]

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

## Methods [#methods]

### 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-5]

`string`\[]

A flat array of the paths of all resource files.

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

#### Inherited from [#inherited-from-12]

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

***

### getExpressionCount() [#getexpressioncount]

\> **getExpressionCount**(): `number`

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

表情設定ファイルの数を取得する

#### Returns [#returns-6]

`number`

表情設定ファイルの数

#### Inherited from [#inherited-from-13]

`CubismModelSettingJsonMixin.getExpressionCount`

***

### getExpressionFileName() [#getexpressionfilename]

\> **getExpressionFileName**(`index`): `string`

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

表情設定ファイルの名前を取得する

#### Parameters [#parameters-3]

##### index [#index-2]

`number`

配列のインデックス値

#### Returns [#returns-7]

`string`

表情設定ファイルの名前

#### Inherited from [#inherited-from-14]

`CubismModelSettingJsonMixin.getExpressionFileName`

***

### getExpressionName() [#getexpressionname]

\> **getExpressionName**(`index`): `string`

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

表情設定ファイルを識別する名前（別名）を取得する

#### Parameters [#parameters-4]

##### index [#index-3]

`number`

配列のインデックス値

#### Returns [#returns-8]

`string`

表情の名前

#### Inherited from [#inherited-from-15]

`CubismModelSettingJsonMixin.getExpressionName`

***

### getEyeBlinkParameters() [#geteyeblinkparameters]

\> **getEyeBlinkParameters**(): `string`\[]

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

#### Returns [#returns-9]

`string`\[]

***

### 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-5]

##### path? [#path]

`string`

#### Returns [#returns-10]

`string` | `undefined`

#### Inherited from [#inherited-from-16]

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

***

### getHitAreaId() [#gethitareaid]

\> **getHitAreaId**(`index`): `CubismId`

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

当たり判定に設定されたIDを取得する

#### Parameters [#parameters-6]

##### index [#index-4]

`number`

配列のindex

#### Returns [#returns-11]

`CubismId`

当たり判定に設定されたID

#### Inherited from [#inherited-from-17]

`CubismModelSettingJsonMixin.getHitAreaId`

***

### getHitAreaName() [#gethitareaname]

\> **getHitAreaName**(`index`): `string`

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

当たり判定に設定された名前を取得する

#### Parameters [#parameters-7]

##### index [#index-5]

`number`

配列のインデックス値

#### Returns [#returns-12]

`string`

当たり判定に設定された名前

#### Inherited from [#inherited-from-18]

`CubismModelSettingJsonMixin.getHitAreaName`

***

### getHitAreasCount() [#gethitareascount]

\> **getHitAreasCount**(): `number`

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

モデルに設定された当たり判定の数を取得する

#### Returns [#returns-13]

`number`

モデルに設定された当たり判定の数

#### Inherited from [#inherited-from-19]

`CubismModelSettingJsonMixin.getHitAreasCount`

***

### getJson() [#getjson]

\> **getJson**(): `CubismJson`

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

CubismJsonオブジェクトを取得する

#### Returns [#returns-14]

`CubismJson`

CubismJson

#### Inherited from [#inherited-from-20]

`CubismModelSettingJsonMixin.getJson`

***

### getLayoutMap() [#getlayoutmap]

\> **getLayoutMap**(`outLayoutMap`): `boolean`

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

レイアウト情報を取得する

#### Parameters [#parameters-8]

##### outLayoutMap [#outlayoutmap]

`csmMap`\<`string`, `number`>

csmMapクラスのインスタンス

#### Returns [#returns-15]

`boolean`

true レイアウト情報が存在する

#### Inherited from [#inherited-from-21]

`CubismModelSettingJsonMixin.getLayoutMap`

***

### getLipSyncParameters() [#getlipsyncparameters]

\> **getLipSyncParameters**(): `string`\[]

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

#### Returns [#returns-16]

`string`\[]

***

### getModelFileName() [#getmodelfilename]

\> **getModelFileName**(): `string`

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

Mocファイルの名前を取得する

#### Returns [#returns-17]

`string`

Mocファイルの名前

#### Inherited from [#inherited-from-22]

`CubismModelSettingJsonMixin.getModelFileName`

***

### getMotionCount() [#getmotioncount]

\> **getMotionCount**(`groupName`): `number`

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

モーショングループに含まれるモーションの数を取得する

#### Parameters [#parameters-9]

##### groupName [#groupname]

`string`

モーショングループの名前

#### Returns [#returns-18]

`number`

モーショングループの数

#### Inherited from [#inherited-from-23]

`CubismModelSettingJsonMixin.getMotionCount`

***

### getMotionFadeInTimeValue() [#getmotionfadeintimevalue]

\> **getMotionFadeInTimeValue**(`groupName`, `index`): `number`

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

モーション開始時のフェードイン処理時間を取得する

#### Parameters [#parameters-10]

##### groupName [#groupname-1]

`string`

モーショングループの名前

##### index [#index-6]

`number`

配列のインデックス値

#### Returns [#returns-19]

`number`

フェードイン処理時間\[秒]

#### Inherited from [#inherited-from-24]

`CubismModelSettingJsonMixin.getMotionFadeInTimeValue`

***

### getMotionFadeOutTimeValue() [#getmotionfadeouttimevalue]

\> **getMotionFadeOutTimeValue**(`groupName`, `index`): `number`

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

モーション終了時のフェードアウト処理時間を取得する

#### Parameters [#parameters-11]

##### groupName [#groupname-2]

`string`

モーショングループの名前

##### index [#index-7]

`number`

配列のインデックス値

#### Returns [#returns-20]

`number`

フェードアウト処理時間\[秒]

#### Inherited from [#inherited-from-25]

`CubismModelSettingJsonMixin.getMotionFadeOutTimeValue`

***

### getMotionFileName() [#getmotionfilename]

\> **getMotionFileName**(`groupName`, `index`): `string`

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

グループ名とインデックス値からモーションファイル名を取得する

#### Parameters [#parameters-12]

##### groupName [#groupname-3]

`string`

モーショングループの名前

##### index [#index-8]

`number`

配列のインデックス値

#### Returns [#returns-21]

`string`

モーションファイルの名前

#### Inherited from [#inherited-from-26]

`CubismModelSettingJsonMixin.getMotionFileName`

***

### getMotionGroupCount() [#getmotiongroupcount]

\> **getMotionGroupCount**(): `number`

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

モーショングループの数を取得する

#### Returns [#returns-22]

`number`

モーショングループの数

#### Inherited from [#inherited-from-27]

`CubismModelSettingJsonMixin.getMotionGroupCount`

***

### getMotionGroupName() [#getmotiongroupname]

\> **getMotionGroupName**(`index`): `string`

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

モーショングループの名前を取得する

#### Parameters [#parameters-13]

##### index [#index-9]

`number`

配列のインデックス値

#### Returns [#returns-23]

`string`

モーショングループの名前

#### Inherited from [#inherited-from-28]

`CubismModelSettingJsonMixin.getMotionGroupName`

***

### getMotionSoundFileName() [#getmotionsoundfilename]

\> **getMotionSoundFileName**(`groupName`, `index`): `string`

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

モーションに対応するサウンドファイルの名前を取得する

#### Parameters [#parameters-14]

##### groupName [#groupname-4]

`string`

モーショングループの名前

##### index [#index-10]

`number`

配列のインデックス値

#### Returns [#returns-24]

`string`

サウンドファイルの名前

#### Inherited from [#inherited-from-29]

`CubismModelSettingJsonMixin.getMotionSoundFileName`

***

### getPhysicsFileName() [#getphysicsfilename]

\> **getPhysicsFileName**(): `string`

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

物理演算設定ファイルの名前を取得する

#### Returns [#returns-25]

`string`

物理演算設定ファイルの名前

#### Inherited from [#inherited-from-30]

`CubismModelSettingJsonMixin.getPhysicsFileName`

***

### getPoseFileName() [#getposefilename]

\> **getPoseFileName**(): `string`

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

パーツ切り替え設定ファイルの名前を取得する

#### Returns [#returns-26]

`string`

パーツ切り替え設定ファイルの名前

#### Inherited from [#inherited-from-31]

`CubismModelSettingJsonMixin.getPoseFileName`

***

### getTextureCount() [#gettexturecount]

\> **getTextureCount**(): `number`

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

モデルが使用するテクスチャの数を取得する
テクスチャの数

#### Returns [#returns-27]

`number`

#### Inherited from [#inherited-from-32]

`CubismModelSettingJsonMixin.getTextureCount`

***

### getTextureDirectory() [#gettexturedirectory]

\> **getTextureDirectory**(): `string`

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

テクスチャが配置されたディレクトリの名前を取得する

#### Returns [#returns-28]

`string`

テクスチャが配置されたディレクトリの名前

#### Inherited from [#inherited-from-33]

`CubismModelSettingJsonMixin.getTextureDirectory`

***

### getTextureFileName() [#gettexturefilename]

\> **getTextureFileName**(`index`): `string`

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

モデルが使用するテクスチャの名前を取得する

#### Parameters [#parameters-15]

##### index [#index-11]

`number`

配列のインデックス値

#### Returns [#returns-29]

`string`

テクスチャの名前

#### Inherited from [#inherited-from-34]

`CubismModelSettingJsonMixin.getTextureFileName`

***

### getUserDataFile() [#getuserdatafile]

\> **getUserDataFile**(): `string`

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

ユーザーデータのファイル名を取得する

#### Returns [#returns-30]

`string`

ユーザーデータのファイル名

#### Inherited from [#inherited-from-35]

`CubismModelSettingJsonMixin.getUserDataFile`

***

### 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-31]

`void`

#### Inherited from [#inherited-from-36]

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

***

### release() [#release]

\> **release**(): `void`

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

デストラクタ相当の処理

#### Returns [#returns-32]

`void`

#### Inherited from [#inherited-from-37]

`CubismModelSettingJsonMixin.release`

***

### replaceFiles() [#replacefiles]

\> **replaceFiles**(`replace`): `void`

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

Replaces the resource files by running each file through the `replacer`.

#### Parameters [#parameters-16]

##### replace [#replace]

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

#### Returns [#returns-33]

`void`

#### Inherited from [#inherited-from-38]

[`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-17]

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

`string`

Relative path.

#### Returns [#returns-34]

`string`

Resolved path.

#### Inherited from [#inherited-from-39]

[`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-18]

##### candidates [#candidates]

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

#### Returns [#returns-35]

`void`

#### Inherited from [#inherited-from-40]

[`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-19]

##### files [#files]

`string`\[]

A flat array of file paths.

#### Returns [#returns-36]

`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-41]

[`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:6039

#### Parameters [#parameters-20]

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

`unknown`

#### Returns [#returns-37]

`json is ModelJSON`
