mirror of
https://github.com/fghrsh/live2d_api.git
synced 2024-11-26 20:47:01 +08:00
commit
6dee0e049b
@ -26,9 +26,10 @@ if (is_array($modelName)) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$textures = json_encode($json['textures']);
|
$textures = $json['textures'];
|
||||||
$textures = str_replace('texture', '../model/'.$modelName.'/texture', $textures);
|
foreach ($textures as $key => $texture){
|
||||||
$textures = json_decode($textures, 1);
|
$textures[$key] = '../model/' . $modelName . '/' . $texture;
|
||||||
|
}
|
||||||
$json['textures'] = $textures;
|
$json['textures'] = $textures;
|
||||||
|
|
||||||
$json['model'] = '../model/'.$modelName.'/'.$json['model'];
|
$json['model'] = '../model/'.$modelName.'/'.$json['model'];
|
||||||
@ -36,17 +37,27 @@ if (isset($json['pose'])) $json['pose'] = '../model/'.$modelName.'/'.$json['pose
|
|||||||
if (isset($json['physics'])) $json['physics'] = '../model/'.$modelName.'/'.$json['physics'];
|
if (isset($json['physics'])) $json['physics'] = '../model/'.$modelName.'/'.$json['physics'];
|
||||||
|
|
||||||
if (isset($json['motions'])) {
|
if (isset($json['motions'])) {
|
||||||
$motions = json_encode($json['motions']);
|
$motions = $json['motions'];
|
||||||
$motions = str_replace('sounds', '../model/'.$modelName.'/sounds', $motions);
|
foreach ($motions as $key1 => $motion){
|
||||||
$motions = str_replace('motions', '../model/'.$modelName.'/motions', $motions);
|
foreach($motion as $key2 => $resource){
|
||||||
$motions = json_decode($motions, 1);
|
foreach ($resource as $key3 => $value)
|
||||||
|
if($key3 == 'file'){
|
||||||
|
$motions[$key1][$key2][$key3] = '../model/' . $modelName . '/' . $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
$json['motions'] = $motions;
|
$json['motions'] = $motions;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($json['expressions'])) {
|
if (isset($json['expressions'])) {
|
||||||
$expressions = json_encode($json['expressions']);
|
$expressions = $json['expressions'];
|
||||||
$expressions = str_replace('expressions', '../model/'.$modelName.'/expressions', $expressions);
|
foreach ($expressions as $key1 => $expression){
|
||||||
$expressions = json_decode($expressions, 1);
|
foreach($expression as $key2 => $value){
|
||||||
|
if($key2 == 'file'){
|
||||||
|
$expressions[$key1][$key2] = '../model/' . $modelName . '/' . $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
$json['expressions'] = $expressions;
|
$json['expressions'] = $expressions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user