Add Generic Mannequin (#27)

Just adding the mannequin from Scott into the main branch so that it can
be used.

- added the mannequin.gltf
- also now requiring the file extention when selecting file to load.
This is to add flexability with file selection. Let me know if this is a
bad idea.
This commit is contained in:
Brooks Palin
2024-01-18 15:41:56 -07:00
committed by GitHub
parent 1687bfd6ed
commit 4b19c76272
6 changed files with 836 additions and 4 deletions
+1 -2
View File
@@ -189,8 +189,7 @@ export class AppElement extends LitElement {
nothing
}
<sts-viewer
objectId="base-human-female"
skyboxId="test_scene"
objectId="Mannequin.gltf"
.mode=${this.mode}
@scene-state=${this.onSceneStateChange}
></sts-viewer>
Binary file not shown.
Binary file not shown.
+833
View File
@@ -0,0 +1,833 @@
{
"asset":{
"generator":"Khronos glTF Blender I/O v4.0.44",
"version":"2.0"
},
"extensionsUsed":[
"KHR_materials_specular",
"KHR_materials_ior"
],
"scene":0,
"scenes":[
{
"name":"Scene",
"nodes":[
26
]
}
],
"nodes":[
{
"name":"DEF-spine.006",
"rotation":[
-0.028406621888279915,
-1.7426322074243217e-07,
-5.048938334084596e-08,
0.9995964765548706
],
"translation":[
1.887379141862766e-15,
0.07721289992332458,
-9.313232407492933e-10
]
},
{
"children":[
0
],
"name":"DEF-spine.005",
"rotation":[
-0.06678496301174164,
-2.031884216435742e-09,
-6.195937540809382e-09,
0.9977673888206482
],
"translation":[
-3.608224830031759e-16,
0.0785079151391983,
-2.328306880627906e-09
]
},
{
"children":[
1
],
"name":"DEF-spine.004",
"rotation":[
0.11835183203220367,
-7.592710460357921e-08,
5.7157610200420095e-08,
0.9929717779159546
],
"translation":[
1.3322676295501878e-15,
0.33216261863708496,
3.725290298461914e-09
]
},
{
"name":"DEF-hand.L",
"rotation":[
-0.014573556371033192,
0.00034069427056238055,
0.023371396586298943,
0.9996205568313599
],
"scale":[
1,
1,
0.9999999403953552
],
"translation":[
-1.4450459495662926e-08,
0.3633701205253601,
1.3969838619232178e-09
]
},
{
"children":[
3
],
"name":"DEF-forearm.L",
"rotation":[
0.03233540058135986,
-3.7278103263815865e-05,
0.011764604598283768,
0.9994078278541565
],
"scale":[
1,
1,
0.9999999403953552
],
"translation":[
1.3141798760329948e-08,
0.29819801449775696,
-5.318128160070046e-10
]
},
{
"children":[
4
],
"name":"DEF-upper_arm.L",
"rotation":[
0.11717651784420013,
0.7130359411239624,
-0.14045093953609467,
0.6768478751182556
],
"scale":[
0.9999998807907104,
0.9999999403953552,
0.9999999403953552
],
"translation":[
1.955777406692505e-08,
0.18291692435741425,
1.2459349818527699e-07
]
},
{
"children":[
5
],
"name":"DEF-shoulder.L",
"rotation":[
-0.5798456072807312,
-0.4022676646709442,
-0.37831100821495056,
0.5990330576896667
],
"scale":[
1,
1.0000001192092896,
1
],
"translation":[
0.02142672799527645,
0.233185276389122,
0.08539257198572159
]
},
{
"name":"DEF-hand.R",
"rotation":[
-0.014573455788195133,
-0.00034070012043230236,
-0.023371396586298943,
0.9996205568313599
],
"scale":[
0.9999999403953552,
1,
0.9999999403953552
],
"translation":[
1.4388740865456384e-08,
0.36337023973464966,
1.0477378964424133e-09
]
},
{
"children":[
7
],
"name":"DEF-forearm.R",
"rotation":[
0.03233540058135986,
3.72941794921644e-05,
-0.011764603666961193,
0.9994078278541565
],
"scale":[
1,
0.9999998807907104,
0.9999999403953552
],
"translation":[
1.0640603420597472e-07,
0.29819804430007935,
9.563905223330949e-12
]
},
{
"children":[
8
],
"name":"DEF-upper_arm.R",
"rotation":[
0.11717646569013596,
-0.7130360007286072,
0.14045096933841705,
0.6768477559089661
],
"scale":[
1,
1.0000001192092896,
1
],
"translation":[
1.3969838619232178e-09,
0.18291689455509186,
2.2421590983867645e-07
]
},
{
"children":[
9
],
"name":"DEF-shoulder.R",
"rotation":[
-0.5798457860946655,
0.40226754546165466,
0.37831082940101624,
0.5990331172943115
],
"translation":[
-0.021426765248179436,
0.233185276389122,
0.0853925496339798
]
},
{
"children":[
2,
6,
10
],
"name":"DEF-spine.003",
"rotation":[
-0.006840453948825598,
-4.508247997137005e-08,
-4.8790194995262937e-08,
0.999976634979248
],
"translation":[
-2.9976021664879227e-15,
0.11385107040405273,
9.313214088813027e-10
]
},
{
"children":[
11
],
"name":"DEF-spine.002",
"rotation":[
-0.05250668525695801,
1.966451890211829e-07,
6.965460386254563e-08,
0.9986205697059631
],
"scale":[
1,
1,
1.0000001192092896
],
"translation":[
-4.718447854656915e-15,
0.07935407757759094,
-3.725290742551124e-09
]
},
{
"children":[
12
],
"name":"DEF-spine.001",
"rotation":[
0.01782919280230999,
-1.563953588856748e-07,
-3.375249590931162e-08,
0.9998410940170288
],
"scale":[
1,
1.0000001192092896,
1
],
"translation":[
7.771561172376096e-16,
0.24725592136383057,
-1.3969838619232178e-09
]
},
{
"name":"DEF-pelvis.L",
"rotation":[
-0.18647781014442444,
-0.7219223976135254,
-0.35762107372283936,
0.5622822046279907
],
"scale":[
0.9999998807907104,
0.9999999403953552,
1
],
"translation":[
5.551115123125783e-16,
1.3672979548573494e-07,
1.3969838619232178e-09
]
},
{
"name":"DEF-pelvis.R",
"rotation":[
-0.1864778697490692,
0.7219222784042358,
0.3576209545135498,
0.5622823238372803
],
"scale":[
1.0000001192092896,
1.0000001192092896,
0.9999999403953552
],
"translation":[
5.551115123125783e-16,
1.3672979548573494e-07,
1.3969838619232178e-09
]
},
{
"name":"DEF-toe.L",
"rotation":[
0.01945490762591362,
0.9519194960594177,
-0.3056659698486328,
0.0062500545755028725
],
"scale":[
0.9999999403953552,
0.9999996423721313,
0.9999998807907104
],
"translation":[
-3.5612828241937677e-09,
0.21015138924121857,
-3.958120942115784e-09
]
},
{
"children":[
16
],
"name":"DEF-foot.L",
"rotation":[
-0.4712497889995575,
0.022768251597881317,
0.011417717672884464,
0.8816319704055786
],
"translation":[
2.6302586775273085e-09,
0.597804069519043,
4.656612873077393e-10
]
},
{
"children":[
17
],
"name":"DEF-shin.L",
"rotation":[
0.03720812126994133,
-5.802315627079224e-06,
8.390640715560949e-08,
0.9993075728416443
],
"scale":[
1,
0.9999998807907104,
0.9999999403953552
],
"translation":[
6.6356733441352844e-09,
0.45030948519706726,
5.3551048040390015e-09
]
},
{
"children":[
18
],
"name":"DEF-thigh.L",
"rotation":[
0.999219536781311,
0.00017768920224625617,
-0.005030911881476641,
0.03917863219976425
],
"scale":[
1,
1,
1.000009298324585
],
"translation":[
0.12138788402080536,
0.015315836295485497,
0.006315397564321756
]
},
{
"name":"DEF-toe.R",
"rotation":[
0.01945490762591362,
-0.9519194960594177,
0.3056660294532776,
0.006249945145100355
],
"scale":[
0.9999999403953552,
1.000000238418579,
0.9999999403953552
],
"translation":[
-2.543579569191934e-09,
0.21015137434005737,
-1.280568540096283e-08
]
},
{
"children":[
20
],
"name":"DEF-foot.R",
"rotation":[
-0.4712497889995575,
-0.022768167778849602,
-0.011417798697948456,
0.8816319704055786
],
"scale":[
1,
1.0000001192092896,
1
],
"translation":[
1.0941221262328327e-09,
0.5978041291236877,
-1.1641532182693481e-10
]
},
{
"children":[
21
],
"name":"DEF-shin.R",
"rotation":[
0.03720812126994133,
5.788315320387483e-06,
-8.628760639339816e-08,
0.9993075132369995
],
"scale":[
1,
0.9999999403953552,
1
],
"translation":[
-5.7480065152049065e-09,
0.4503094255924225,
5.122274160385132e-09
]
},
{
"children":[
22
],
"name":"DEF-thigh.R",
"rotation":[
0.999219536781311,
-0.0001777129218680784,
0.00503115076571703,
0.03917863219976425
],
"scale":[
1,
1,
1.000009298324585
],
"translation":[
-0.12138788402080536,
0.015315836295485497,
0.00631533982232213
]
},
{
"children":[
13,
14,
15,
19,
23
],
"name":"DEF-spine",
"rotation":[
0.018155446276068687,
1.1918958620071862e-07,
2.1643011827165992e-09,
0.999835193157196
],
"scale":[
1,
0.9999999403953552,
0.9999999403953552
],
"translation":[
0,
1.182451844215393,
-0.005226952489465475
]
},
{
"mesh":0,
"name":"Mannequin",
"skin":0
},
{
"children":[
25,
24
],
"name":"Mannequin_gamerig"
}
],
"materials":[
{
"doubleSided":true,
"extensions":{
"KHR_materials_specular":{
"specularColorFactor":[
1.2000000476837158,
1.2000000476837158,
1.2000000476837158
]
},
"KHR_materials_ior":{
"ior":1.4500000476837158
}
},
"name":"mannequin_Body",
"pbrMetallicRoughness":{
"metallicFactor":0,
"roughnessFactor":0.6052631735801697
}
},
{
"doubleSided":true,
"extensions":{
"KHR_materials_specular":{
"specularColorFactor":[
1.600000023841858,
1.600000023841858,
1.600000023841858
]
},
"KHR_materials_ior":{
"ior":1.4500000476837158
}
},
"name":"mannequin_Accent",
"pbrMetallicRoughness":{
"baseColorFactor":[
0.9736101627349854,
0.14702075719833374,
0.1384216547012329,
1
],
"metallicFactor":0,
"roughnessFactor":0.6000000238418579
}
}
],
"meshes":[
{
"name":"Mannequin",
"primitives":[
{
"attributes":{
"POSITION":0,
"NORMAL":1,
"TEXCOORD_0":2,
"JOINTS_0":3,
"WEIGHTS_0":4
},
"indices":5,
"material":0
},
{
"attributes":{
"POSITION":6,
"NORMAL":7,
"TEXCOORD_0":8,
"JOINTS_0":9,
"WEIGHTS_0":10
},
"indices":11,
"material":1
}
]
}
],
"skins":[
{
"inverseBindMatrices":12,
"joints":[
24,
13,
12,
11,
2,
1,
0,
6,
5,
4,
3,
10,
9,
8,
7,
14,
15,
19,
18,
17,
16,
23,
22,
21,
20
],
"name":"Mannequin_gamerig"
}
],
"accessors":[
{
"bufferView":0,
"componentType":5126,
"count":5060,
"max":[
1.1036324501037598,
2.3470962047576904,
0.26369038224220276
],
"min":[
-1.1036324501037598,
0.00787466298788786,
-0.15223903954029083
],
"type":"VEC3"
},
{
"bufferView":1,
"componentType":5126,
"count":5060,
"type":"VEC3"
},
{
"bufferView":2,
"componentType":5126,
"count":5060,
"type":"VEC2"
},
{
"bufferView":3,
"componentType":5121,
"count":5060,
"type":"VEC4"
},
{
"bufferView":4,
"componentType":5126,
"count":5060,
"type":"VEC4"
},
{
"bufferView":5,
"componentType":5123,
"count":19392,
"type":"SCALAR"
},
{
"bufferView":6,
"componentType":5126,
"count":4456,
"max":[
0.8834734559059143,
2.1308164596557617,
0.12853950262069702
],
"min":[
-0.8834734559059143,
0.1166389137506485,
-0.11114808171987534
],
"type":"VEC3"
},
{
"bufferView":7,
"componentType":5126,
"count":4456,
"type":"VEC3"
},
{
"bufferView":8,
"componentType":5126,
"count":4456,
"type":"VEC2"
},
{
"bufferView":9,
"componentType":5121,
"count":4456,
"type":"VEC4"
},
{
"bufferView":10,
"componentType":5126,
"count":4456,
"type":"VEC4"
},
{
"bufferView":11,
"componentType":5123,
"count":22560,
"type":"SCALAR"
},
{
"bufferView":12,
"componentType":5126,
"count":25,
"type":"MAT4"
}
],
"bufferViews":[
{
"buffer":0,
"byteLength":60720,
"byteOffset":0,
"target":34962
},
{
"buffer":0,
"byteLength":60720,
"byteOffset":60720,
"target":34962
},
{
"buffer":0,
"byteLength":40480,
"byteOffset":121440,
"target":34962
},
{
"buffer":0,
"byteLength":20240,
"byteOffset":161920,
"target":34962
},
{
"buffer":0,
"byteLength":80960,
"byteOffset":182160,
"target":34962
},
{
"buffer":0,
"byteLength":38784,
"byteOffset":263120,
"target":34963
},
{
"buffer":0,
"byteLength":53472,
"byteOffset":301904,
"target":34962
},
{
"buffer":0,
"byteLength":53472,
"byteOffset":355376,
"target":34962
},
{
"buffer":0,
"byteLength":35648,
"byteOffset":408848,
"target":34962
},
{
"buffer":0,
"byteLength":17824,
"byteOffset":444496,
"target":34962
},
{
"buffer":0,
"byteLength":71296,
"byteOffset":462320,
"target":34962
},
{
"buffer":0,
"byteLength":45120,
"byteOffset":533616,
"target":34963
},
{
"buffer":0,
"byteLength":1600,
"byteOffset":578736
}
],
"buffers":[
{
"byteLength":580336,
"uri":"Mannequin.bin"
}
]
}
+1 -1
View File
@@ -4,7 +4,7 @@ use studio::{StudioMode, ViewportSize};
fn main() {
// Edit the arguments here to change the default startup scene or skybox
let mut app = studio::start_internal(
"base-human-female",
"Mannequin.gltf",
"gum_trees_4k",
"", // ignored for non-WASM
"Storyteller Studio",
+1 -1
View File
@@ -193,7 +193,7 @@ fn init_scene_loading(
) {
if let Some(id) = er.read().last() {
let name = &**id;
let path = format!("gltf/{name}.glb");
let path = format!("gltf/{name}");
// Avoid trying to re-load this scene if it's already active
if let Some(active_scene_path) =