Skip to content

Commit

Permalink
同步进度
Browse files Browse the repository at this point in the history
  • Loading branch information
fghrsh committed Mar 2, 2018
1 parent a9d54aa commit a02c09b
Show file tree
Hide file tree
Showing 606 changed files with 10,094 additions and 0 deletions.
29 changes: 29 additions & 0 deletions add/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

require '../tools/modelList.php';
require '../tools/modelTextures.php';

$modelList = new modelList();
$modelTextures = new modelTextures();

$modelList = $modelList->get_list()['models'];

foreach ($modelList as $modelName) {
if (file_exists('../model/'.$modelName.'/textures.cache')) {

$textures = $texturesNew = array();
foreach ($modelTextures->get_list($modelName)['textures'] as $v) $textures[] = json_encode($v, JSON_UNESCAPED_SLASHES);
foreach ($modelTextures->get_textures($modelName) as $v) $texturesNew[] = json_encode($v, JSON_UNESCAPED_SLASHES);

if ($textures == NULL) continue; elseif (empty(array_diff($texturesNew, $textures))) {
echo '<p>'.$modelName.' / textures.cache / No Update.</p>';
} else {
foreach (array_values(array_unique(array_merge($textures, $texturesNew))) as $v) $texturesMerge[] = json_decode($v, 1);
file_put_contents('../model/'.$modelName.'/textures.cache', json_encode($texturesMerge, JSON_UNESCAPED_SLASHES));
echo '<p>'.$modelName.' / textures.cache / Updated.</p>';
}

}
elseif (is_array($modelName)) continue;
elseif ($modelTextures->get_list($modelName)) echo '<p>'.$modelName.' / textures.cache / Created.</p>';
}
52 changes: 52 additions & 0 deletions get/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?php
isset($_GET['id']) ? $id = $_GET['id'] : exit('error');

require '../tools/modelList.php';
require '../tools/modelTextures.php';

$modelList = new modelList();
$modelTextures = new modelTextures();

$id = explode('-', $id);
$modelId = (int)$id[0];
$modelTexturesId = isset($id[1]) ? (int)$id[1] : 0;

$modelName = $modelList->id_to_name($modelId);

if (is_array($modelName)) {
$modelName = $modelTexturesId > 0 ? $modelName[$modelTexturesId-1] : $modelName[0];
$json = json_decode(file_get_contents('../model/'.$modelName.'/index.json'), 1);
} else {
$json = json_decode(file_get_contents('../model/'.$modelName.'/index.json'), 1);
if ($modelTexturesId > 0) {
$modelTexturesName = $modelTextures->get_name($modelName, $modelTexturesId);
if (isset($modelTexturesName)) $json['textures'] = is_array($modelTexturesName) ? $modelTexturesName : array($modelTexturesName);
}
}

$textures = json_encode($json['textures']);
$textures = str_replace('texture', '../model/'.$modelName.'/texture', $textures);
$textures = json_decode($textures, 1);
$json['textures'] = $textures;

$json['model'] = '../model/'.$modelName.'/'.$json['model'];
if (isset($json['pose'])) $json['pose'] = '../model/'.$modelName.'/'.$json['pose'];
if (isset($json['physics'])) $json['physics'] = '../model/'.$modelName.'/'.$json['physics'];

if (isset($json['motions'])) {
$motions = json_encode($json['motions']);
$motions = str_replace('sounds', '../model/'.$modelName.'/sounds', $motions);
$motions = str_replace('motions', '../model/'.$modelName.'/motions', $motions);
$motions = json_decode($motions, 1);
$json['motions'] = $motions;
}

if (isset($json['expressions'])) {
$expressions = json_encode($json['expressions']);
$expressions = str_replace('expressions', '../model/'.$modelName.'/expressions', $expressions);
$expressions = json_decode($expressions, 1);
$json['expressions'] = $expressions;
}

header("Content-type: application/json");
echo json_encode($json, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT);
30 changes: 30 additions & 0 deletions model/HyperdimensionNeptunia/blanc_classic/index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"version":"Sample 1.0.0",
"model": "model.moc",
"textures": [
"textures.1024/00.png",
"textures.1024/01.png",
"textures.1024/02.png",
"textures.1024/03.png"
],
"pose": "../general/pose.json",
"physics": "physics.json",
"layout": {
"center_x": 0,
"center_y": -0.6,
"width": 3
},
"hit_areas_custom":{
"head_x":[-0.35, 0.6],
"head_y":[0.19, -0.2],
"body_x":[-0.3, -0.25],
"body_y":[0.3, -0.9]
},
"motions": {
"idle": [
{"file": "motions/../../general/mtn/idle_00.mtn", "fade_in": 2000, "fade_out": 2000},
{"file": "motions/../../general/mtn/idle_01.mtn", "fade_in": 2000, "fade_out": 2000},
{"file": "motions/../../general/mtn/idle_02.mtn", "fade_in": 2000, "fade_out": 2000}
]
}
}
Binary file not shown.
149 changes: 149 additions & 0 deletions model/HyperdimensionNeptunia/blanc_classic/physics.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
{
"type":"Live2D Physics",
"physics_hair":[
{
"label":"hair_front",
"setup":{
"length":0.17,
"regist":0.5,
"mass":0.1
},
"src":[
{
"id":"PARAM_BODY_ANGLE_X",
"ptype":"x",
"scale":0.005,
"weight":1
},
{
"id":"PARAM_BODY_ANGLE_Z",
"ptype":"x",
"scale":0.8,
"weight":1
}
],
"targets":[
{
"id":"PARAM_HAIR_FRONT",
"ptype":"angle",
"scale":0.025,
"weight":1
}
]
},
{
"label":"hair_back",
"setup":{
"length":0.34,
"regist":0.5,
"mass":0.2
},
"src":[
{
"id":"PARAM_ANGLE_X",
"ptype":"x",
"scale":0.005,
"weight":1
},
{
"id":"PARAM_ANGLE_Z",
"ptype":"angle",
"scale":0.8,
"weight":1
}
],
"targets":[
{
"id":"PARAM_HAIR_BACK",
"ptype":"angle",
"scale":0.025,
"weight":1
}
]
},
{
"label":"hair_side",
"setup":{
"length":0.17,
"regist":0.7,
"mass":0.1
},
"src":[
{
"id":"PARAM_ANGLE_X",
"ptype":"x",
"scale":0.005,
"weight":1
},
{
"id":"PARAM_ANGLE_Z",
"ptype":"angle",
"scale":0.8,
"weight":1
}
],
"targets":[
{
"id":"PARAM_HAIR_SIDE",
"ptype":"angle",
"scale":0.025,
"weight":1
}
]
},
{
"label":"body_string",
"setup":{
"length":0.2,
"regist":0.7,
"mass":0.1
},
"src":[
{
"id":"PARAM_ANGLE_X",
"ptype":"x",
"scale":0.005,
"weight":1
},
{
"id":"PARAM_ANGLE_Z",
"ptype":"x",
"scale":0.8,
"weight":1
}
],
"targets":[
{
"id":"PARAM_STRING",
"ptype":"angle",
"scale":0.025,
"weight":1
}
]
},
{
"label":"arm_far",
"setup":{
"length":0.2,
"regist":0.5,
"mass":0.05
},
"src":[
{
"id":"PARAM_ANGLE_X",
"ptype":"x",
"scale":0.01,
"weight":1
}
],
"targets":[
{
"id":"PARAM_FAR",
"ptype":"angle",
"scale":0.025,
"weight":1
}
]
}
]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions model/HyperdimensionNeptunia/blanc_normal/index.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"version":"Sample 1.0.0",
"model": "model.moc",
"textures": [
"textures.1024/00.png",
"textures.1024/01.png",
"textures.1024/02.png",
"textures.1024/03.png"
],
"pose": "../general/pose.json",
"physics": "physics.json",
"layout": {
"center_x": 0,
"center_y": -0.6,
"width": 3
},
"hit_areas_custom":{
"head_x":[-0.35, 0.6],
"head_y":[0.19, -0.2],
"body_x":[-0.3, -0.25],
"body_y":[0.3, -0.9]
},
"motions": {
"idle": [
{"file": "motions/../../general/mtn/idle_00.mtn", "fade_in": 2000, "fade_out": 2000},
{"file": "motions/../../general/mtn/idle_01.mtn", "fade_in": 2000, "fade_out": 2000},
{"file": "motions/../../general/mtn/idle_02.mtn", "fade_in": 2000, "fade_out": 2000}
]
}
}
Binary file not shown.
Loading

0 comments on commit a02c09b

Please sign in to comment.