Skip to content

Import a 3D Model and automatically assign and export animations

TypeScript

Add more props and label button

Scott Petrovic79f3f61a9852
diff --git a/src/create.html b/src/create.html
index 6dc2127..a3b6873 100644
--- a/src/create.html
+++ b/src/create.html
@@ -430,6 +430,7 @@
aria-label="Attach props to the hands"
>
<img src="images/icons/props.svg" alt="Props" width="32" height="32" />
+ Props
</button>
<div id="props-panel" class="props-panel" role="region" aria-label="Props" hidden>
<div id="props-left-hand" class="prop-picker"></div>
@@ -441,6 +442,7 @@
aria-label="Close props"
>
<img src="images/icons/props.svg" alt="" width="32" height="32" />
+ Props
</button>
</div>
</div>
diff --git a/src/index.html b/src/index.html
index b7ba9a5..588b0fa 100644
--- a/src/index.html
+++ b/src/index.html
@@ -180,12 +180,14 @@
<div id="props-dock" style="display: none">
<button class="secondary-button" id="props-toggle-button" aria-expanded="false" aria-controls="props-panel" data-tippy-content="Attach props to the hands" aria-label="Attach props to the hands">
<img src="images/icons/props.svg" alt="Props" width="32" height="32" />
+ Props
</button>
<div id="props-panel" class="props-panel" role="region" aria-label="Props" hidden>
- <div id="props-left-hand" class="prop-picker"></div>
<div id="props-right-hand" class="prop-picker"></div>
+ <div id="props-left-hand" class="prop-picker"></div>
<button class="secondary-button" id="props-close-button" data-tippy-content="Close props" aria-label="Close props">
<img src="images/icons/props.svg" alt="" width="32" height="32" />
+ Props
</button>
</div>
</div>
diff --git a/src/lib/processes/animations-listing/props/PropCatalog.ts b/src/lib/processes/animations-listing/props/PropCatalog.ts
index 1955c9a..feac844 100644
--- a/src/lib/processes/animations-listing/props/PropCatalog.ts
+++ b/src/lib/processes/animations-listing/props/PropCatalog.ts
@@ -4,7 +4,7 @@ import { SkeletonType } from '../../../enums/SkeletonType.ts'
import { PropType } from './PropType.ts'
import { PropSide } from './PropSide.ts'
-export type PropCategory = 'Polearms' | 'Staves' | 'Ranged' | 'Axes' | 'Daggers' | 'Fist Weapons' | 'Hammers' | 'Shields' | 'Swords' | 'Wands'
+export type PropCategory = 'Polearms' | 'Staves' | 'Ranged' | 'Axes' | 'Daggers' | 'Fist Weapons' | 'Hammers' | 'Shields' | 'Swords' | 'Wands' | 'Guns' | 'Tools'
export interface PropMountOffset {
// meters for a rig at skeleton scale 1.0, along the hand bone toward the fingers
@@ -70,6 +70,8 @@ export class PropCatalog {
create_definition(PropType.AxeC, 'Broad-Headed Battle Axe', 'Axes', 'axe_C.glb'),
create_definition(PropType.DaggerA, 'Double-Edged Dagger', 'Daggers', 'dagger_A.glb'),
create_definition(PropType.DaggerB, 'Sai', 'Daggers', 'dagger_B.glb'),
+ create_definition(PropType.KnifeA, 'Combat Knife', 'Daggers', 'Knife_1.glb'),
+ create_definition(PropType.KnifeB, 'Hunting Knife', 'Daggers', 'Knife_2.glb'),
create_definition(PropType.FistWeaponA, 'Brass Knuckles', 'Fist Weapons', 'fistweapon_A.glb'),
create_definition(PropType.FistWeaponB, 'Tekko-Kagi (Hand Claws)', 'Fist Weapons', 'fistweapon_B.glb'),
create_definition(PropType.HammerA, 'Sledgehammer', 'Hammers', 'hammer_A.glb'),
@@ -83,7 +85,20 @@ export class PropCatalog {
create_definition(PropType.SwordC, 'Katana', 'Swords', 'sword_C.glb'),
create_definition(PropType.SwordD, 'Rapier', 'Swords', 'sword_D.glb'),
create_definition(PropType.SwordE, 'Greatsword', 'Swords', 'sword_E.glb'),
- create_definition(PropType.WandA, 'Crystal Wand', 'Wands', 'wand_A.glb')
+ create_definition(PropType.WandA, 'Crystal Wand', 'Wands', 'wand_A.glb'),
+ create_definition(PropType.Pistol, 'Pistol', 'Guns', 'Pistol.glb'),
+ create_definition(PropType.Revolver, 'Revolver', 'Guns', 'Revolver.glb'),
+ create_definition(PropType.RevolverSmall, 'Snub-Nose Revolver', 'Guns', 'Revolver_Small.glb'),
+ create_definition(PropType.SMG, 'Submachine Gun', 'Guns', 'SMG.glb'),
+ create_definition(PropType.AK, 'Assault Rifle', 'Guns', 'AK.glb'),
+ create_definition(PropType.Shotgun, 'Shotgun', 'Guns', 'Shotgun.glb'),
+ create_definition(PropType.Sniper, 'Sniper Rifle', 'Guns', 'Sniper.glb'),
+ create_definition(PropType.SniperB, 'Heavy Sniper Rifle', 'Guns', 'Sniper_2.glb'),
+ create_definition(PropType.GrenadeLauncher, 'Grenade Launcher', 'Guns', 'GrenadeLauncher.glb'),
+ create_definition(PropType.RocketLauncher, 'Rocket Launcher', 'Guns', 'RocketLauncher.glb'),
+ create_definition(PropType.ShortCannon, 'Hand Cannon', 'Guns', 'ShortCannon.glb'),
+ create_definition(PropType.Shovel, 'Shovel', 'Tools', 'Shovel.glb'),
+ create_definition(PropType.Sickle, 'Sickle', 'Tools', 'Sickle.glb')
]
public static all (): PropDefinition[] {
diff --git a/src/lib/processes/animations-listing/props/PropType.ts b/src/lib/processes/animations-listing/props/PropType.ts
index 15ccc90..340dd6e 100644
--- a/src/lib/processes/animations-listing/props/PropType.ts
+++ b/src/lib/processes/animations-listing/props/PropType.ts
@@ -28,5 +28,20 @@ export enum PropType {
SwordC = 'sword-c',
SwordD = 'sword-d',
SwordE = 'sword-e',
- WandA = 'wand-a'
+ WandA = 'wand-a',
+ KnifeA = 'knife-a',
+ KnifeB = 'knife-b',
+ Shovel = 'shovel',
+ Sickle = 'sickle',
+ Pistol = 'pistol',
+ Revolver = 'revolver',
+ RevolverSmall = 'revolver-small',
+ SMG = 'smg',
+ AK = 'ak',
+ Shotgun = 'shotgun',
+ Sniper = 'sniper',
+ SniperB = 'sniper-b',
+ GrenadeLauncher = 'grenade-launcher',
+ RocketLauncher = 'rocket-launcher',
+ ShortCannon = 'short-cannon'
}
diff --git a/src/lib/processes/animations-listing/props/Props.test.ts b/src/lib/processes/animations-listing/props/Props.test.ts
index fad0da8..1161f1e 100644
--- a/src/lib/processes/animations-listing/props/Props.test.ts
+++ b/src/lib/processes/animations-listing/props/Props.test.ts
@@ -19,10 +19,10 @@ describe('PropCatalog', () => {
it('registers every bundled prop model and keeps legacy Pole and Staff choices', () => {
const definitions = PropCatalog.all()
- expect(definitions).toHaveLength(31)
- expect(new Set(definitions.map((definition) => definition.asset_path)).size).toBe(31)
+ expect(definitions).toHaveLength(44)
+ expect(new Set(definitions.map((definition) => definition.asset_path)).size).toBe(44)
expect(PropCatalog.find(PropType.Pole)?.asset_path).toBe('props/spear_A.glb')
- expect(PropCatalog.find(PropType.Pole)?.model_offset_y).toBe(0.93)
+ expect(PropCatalog.find(PropType.Pole)?.model_offset_y).toBe(0)
expect(PropCatalog.find(PropType.Staff)?.asset_path).toBe('props/staff_A.glb')
})
})
diff --git a/src/lib/processes/animations-listing/props/props.css b/src/lib/processes/animations-listing/props/props.css
index 6da9bc1..17d8c8d 100644
--- a/src/lib/processes/animations-listing/props/props.css
+++ b/src/lib/processes/animations-listing/props/props.css
@@ -139,8 +139,8 @@
top: calc(100% + 0.25rem);
right: 0;
z-index: 20;
- width: 22rem;
- max-height: min(34rem, calc(100vh - var(--navigation-height) - 8rem));
+ width: 16rem;
+ max-height: calc(100vh - var(--navigation-height) - 17rem);
overflow-y: auto;
padding: 0.5rem;
border: 1px solid var(--bg-tertiary);
@@ -160,17 +160,14 @@
.prop-picker-group-label {
margin: 0 0 0.25rem 0.15rem;
-
+ padding: 0.5rem;
text-transform: uppercase;
letter-spacing: 0.05em;
background: var(--bg-alternate);
+ text-align: center;
}
-.prop-picker-grid {
- display: flex;
- flex-direction: column;
- gap: 0.25rem;
-}
+
.prop-picker-option {
display: flex;
diff --git a/static/props/AK.glb b/static/props/AK.glb
new file mode 100644
index 0000000..a53b791
Binary files /dev/null and b/static/props/AK.glb differ
diff --git a/static/props/GrenadeLauncher.glb b/static/props/GrenadeLauncher.glb
new file mode 100644
index 0000000..0b3a491
Binary files /dev/null and b/static/props/GrenadeLauncher.glb differ
diff --git a/static/props/Knife_1.glb b/static/props/Knife_1.glb
new file mode 100644
index 0000000..66d709d
Binary files /dev/null and b/static/props/Knife_1.glb differ
diff --git a/static/props/Knife_2.glb b/static/props/Knife_2.glb
new file mode 100644
index 0000000..57c8c07
Binary files /dev/null and b/static/props/Knife_2.glb differ
diff --git a/static/props/Pistol.glb b/static/props/Pistol.glb
new file mode 100644
index 0000000..c06f7cd
Binary files /dev/null and b/static/props/Pistol.glb differ
diff --git a/static/props/Revolver.glb b/static/props/Revolver.glb
new file mode 100644
index 0000000..3894b1b
Binary files /dev/null and b/static/props/Revolver.glb differ
diff --git a/static/props/Revolver_Small.glb b/static/props/Revolver_Small.glb
new file mode 100644
index 0000000..5773dde
Binary files /dev/null and b/static/props/Revolver_Small.glb differ
diff --git a/static/props/RocketLauncher.glb b/static/props/RocketLauncher.glb
new file mode 100644
index 0000000..15477d0
Binary files /dev/null and b/static/props/RocketLauncher.glb differ
diff --git a/static/props/SMG.glb b/static/props/SMG.glb
new file mode 100644
index 0000000..1ccc09f
Binary files /dev/null and b/static/props/SMG.glb differ
diff --git a/static/props/ShortCannon.glb b/static/props/ShortCannon.glb
new file mode 100644
index 0000000..fb00d33
Binary files /dev/null and b/static/props/ShortCannon.glb differ
diff --git a/static/props/Shotgun.glb b/static/props/Shotgun.glb
new file mode 100644
index 0000000..97b8ac1
Binary files /dev/null and b/static/props/Shotgun.glb differ
diff --git a/static/props/Shovel.glb b/static/props/Shovel.glb
new file mode 100644
index 0000000..2c62d9c
Binary files /dev/null and b/static/props/Shovel.glb differ
diff --git a/static/props/Sickle.glb b/static/props/Sickle.glb
new file mode 100644
index 0000000..c299d6e
Binary files /dev/null and b/static/props/Sickle.glb differ
diff --git a/static/props/Sniper.glb b/static/props/Sniper.glb
new file mode 100644
index 0000000..d1f3b5f
Binary files /dev/null and b/static/props/Sniper.glb differ
diff --git a/static/props/Sniper_2.glb b/static/props/Sniper_2.glb
new file mode 100644
index 0000000..35fe00b
Binary files /dev/null and b/static/props/Sniper_2.glb differ
diff --git a/static/props/preview/AK.png b/static/props/preview/AK.png
new file mode 100644
index 0000000..2e5ca53
Binary files /dev/null and b/static/props/preview/AK.png differ
diff --git a/static/props/preview/GrenadeLauncher.png b/static/props/preview/GrenadeLauncher.png
new file mode 100644
index 0000000..333aab1
Binary files /dev/null and b/static/props/preview/GrenadeLauncher.png differ
diff --git a/static/props/preview/Knife_1.png b/static/props/preview/Knife_1.png
new file mode 100644
index 0000000..ae62f6b
Binary files /dev/null and b/static/props/preview/Knife_1.png differ
diff --git a/static/props/preview/Knife_2.png b/static/props/preview/Knife_2.png
new file mode 100644
index 0000000..597385a
Binary files /dev/null and b/static/props/preview/Knife_2.png differ
diff --git a/static/props/preview/Pistol.png b/static/props/preview/Pistol.png
new file mode 100644
index 0000000..113f1b2
Binary files /dev/null and b/static/props/preview/Pistol.png differ
diff --git a/static/props/preview/Revolver.png b/static/props/preview/Revolver.png
new file mode 100644
index 0000000..baccb6e
Binary files /dev/null and b/static/props/preview/Revolver.png differ
diff --git a/static/props/preview/Revolver_Small.png b/static/props/preview/Revolver_Small.png
new file mode 100644
index 0000000..5e23362
Binary files /dev/null and b/static/props/preview/Revolver_Small.png differ
diff --git a/static/props/preview/RocketLauncher.png b/static/props/preview/RocketLauncher.png
new file mode 100644
index 0000000..be1141d
Binary files /dev/null and b/static/props/preview/RocketLauncher.png differ
diff --git a/static/props/preview/SMG.png b/static/props/preview/SMG.png
new file mode 100644
index 0000000..eaef9b9
Binary files /dev/null and b/static/props/preview/SMG.png differ
diff --git a/static/props/preview/ShortCannon.png b/static/props/preview/ShortCannon.png
new file mode 100644
index 0000000..db32e5b
Binary files /dev/null and b/static/props/preview/ShortCannon.png differ
diff --git a/static/props/preview/Shotgun.png b/static/props/preview/Shotgun.png
new file mode 100644
index 0000000..e8da986
Binary files /dev/null and b/static/props/preview/Shotgun.png differ
diff --git a/static/props/preview/Shovel.png b/static/props/preview/Shovel.png
new file mode 100644
index 0000000..e1109e0
Binary files /dev/null and b/static/props/preview/Shovel.png differ
diff --git a/static/props/preview/Sickle.png b/static/props/preview/Sickle.png
new file mode 100644
index 0000000..ccd6e6c
Binary files /dev/null and b/static/props/preview/Sickle.png differ
diff --git a/static/props/preview/Sniper.png b/static/props/preview/Sniper.png
new file mode 100644
index 0000000..4bbbb06
Binary files /dev/null and b/static/props/preview/Sniper.png differ
diff --git a/static/props/preview/Sniper_2.png b/static/props/preview/Sniper_2.png
new file mode 100644
index 0000000..123cd4f
Binary files /dev/null and b/static/props/preview/Sniper_2.png differ
diff --git a/static/props/preview/arrow_A.png b/static/props/preview/arrow_A.png
index 9d6cbae..3ab5fde 100644
Binary files a/static/props/preview/arrow_A.png and b/static/props/preview/arrow_A.png differ
diff --git a/static/props/preview/arrow_B.png b/static/props/preview/arrow_B.png
index 0fceb09..4d443fb 100644
Binary files a/static/props/preview/arrow_B.png and b/static/props/preview/arrow_B.png differ
diff --git a/static/props/preview/axe_A.png b/static/props/preview/axe_A.png
index b4934dc..d03c53b 100644
Binary files a/static/props/preview/axe_A.png and b/static/props/preview/axe_A.png differ
diff --git a/static/props/preview/axe_B.png b/static/props/preview/axe_B.png
index 99ebeea..adf25a9 100644
Binary files a/static/props/preview/axe_B.png and b/static/props/preview/axe_B.png differ
diff --git a/static/props/preview/axe_C.png b/static/props/preview/axe_C.png
index e050fb7..1b7b3aa 100644
Binary files a/static/props/preview/axe_C.png and b/static/props/preview/axe_C.png differ
diff --git a/static/props/preview/bow_A.png b/static/props/preview/bow_A.png
index c7722b1..b596b91 100644
Binary files a/static/props/preview/bow_A.png and b/static/props/preview/bow_A.png differ
diff --git a/static/props/preview/bow_A_withString.png b/static/props/preview/bow_A_withString.png
index b2701eb..be41c63 100644
Binary files a/static/props/preview/bow_A_withString.png and b/static/props/preview/bow_A_withString.png differ
diff --git a/static/props/preview/bow_B.png b/static/props/preview/bow_B.png
index 830ce8e..a9e65a6 100644
Binary files a/static/props/preview/bow_B.png and b/static/props/preview/bow_B.png differ
diff --git a/static/props/preview/bow_B_withString.png b/static/props/preview/bow_B_withString.png
index 5f40a26..00e6a24 100644
Binary files a/static/props/preview/bow_B_withString.png and b/static/props/preview/bow_B_withString.png differ
diff --git a/static/props/preview/dagger_A.png b/static/props/preview/dagger_A.png
index be46ddc..1be9ed3 100644
Binary files a/static/props/preview/dagger_A.png and b/static/props/preview/dagger_A.png differ
diff --git a/static/props/preview/dagger_B.png b/static/props/preview/dagger_B.png
index 6362db8..e9412f7 100644
Binary files a/static/props/preview/dagger_B.png and b/static/props/preview/dagger_B.png differ
diff --git a/static/props/preview/fistweapon_A.png b/static/props/preview/fistweapon_A.png
index cf6443d..4e7a543 100644
Binary files a/static/props/preview/fistweapon_A.png and b/static/props/preview/fistweapon_A.png differ
diff --git a/static/props/preview/fistweapon_A_stacked.png b/static/props/preview/fistweapon_A_stacked.png
new file mode 100644
index 0000000..0c626ce
Binary files /dev/null and b/static/props/preview/fistweapon_A_stacked.png differ
diff --git a/static/props/preview/fistweapon_B.png b/static/props/preview/fistweapon_B.png
index 06a7e4e..d829cd8 100644
Binary files a/static/props/preview/fistweapon_B.png and b/static/props/preview/fistweapon_B.png differ
diff --git a/static/props/preview/fistweapon_B_stacked.png b/static/props/preview/fistweapon_B_stacked.png
new file mode 100644
index 0000000..9ca0d72
Binary files /dev/null and b/static/props/preview/fistweapon_B_stacked.png differ
diff --git a/static/props/preview/halberd.png b/static/props/preview/halberd.png
index b3729d4..24a5c74 100644
Binary files a/static/props/preview/halberd.png and b/static/props/preview/halberd.png differ
diff --git a/static/props/preview/hammer_A.png b/static/props/preview/hammer_A.png
index ff83a02..fba891d 100644
Binary files a/static/props/preview/hammer_A.png and b/static/props/preview/hammer_A.png differ
diff --git a/static/props/preview/hammer_B.png b/static/props/preview/hammer_B.png
index 6bee10e..03efa7c 100644
Binary files a/static/props/preview/hammer_B.png and b/static/props/preview/hammer_B.png differ
diff --git a/static/props/preview/hammer_C.png b/static/props/preview/hammer_C.png
index 5ea8587..cf74b93 100644
Binary files a/static/props/preview/hammer_C.png and b/static/props/preview/hammer_C.png differ
diff --git a/static/props/preview/shield_A.png b/static/props/preview/shield_A.png
index 4bffdc6..1d71759 100644
Binary files a/static/props/preview/shield_A.png and b/static/props/preview/shield_A.png differ
diff --git a/static/props/preview/shield_B.png b/static/props/preview/shield_B.png
index 1163032..401b278 100644
Binary files a/static/props/preview/shield_B.png and b/static/props/preview/shield_B.png differ
diff --git a/static/props/preview/shield_C.png b/static/props/preview/shield_C.png
index d930338..981d82d 100644
Binary files a/static/props/preview/shield_C.png and b/static/props/preview/shield_C.png differ
diff --git a/static/props/preview/spear_A.png b/static/props/preview/spear_A.png
index 0f3e6ff..e0b5a45 100644
Binary files a/static/props/preview/spear_A.png and b/static/props/preview/spear_A.png differ
diff --git a/static/props/preview/staff_A.png b/static/props/preview/staff_A.png
index 6acd403..477b480 100644
Binary files a/static/props/preview/staff_A.png and b/static/props/preview/staff_A.png differ
diff --git a/static/props/preview/staff_B.png b/static/props/preview/staff_B.png
index 1372d8c..db1ff2a 100644
Binary files a/static/props/preview/staff_B.png and b/static/props/preview/staff_B.png differ
diff --git a/static/props/preview/sword_A.png b/static/props/preview/sword_A.png
index adf41b8..15b6342 100644
Binary files a/static/props/preview/sword_A.png and b/static/props/preview/sword_A.png differ
diff --git a/static/props/preview/sword_B.png b/static/props/preview/sword_B.png
index 909a393..e92f4e0 100644
Binary files a/static/props/preview/sword_B.png and b/static/props/preview/sword_B.png differ
diff --git a/static/props/preview/sword_C.png b/static/props/preview/sword_C.png
index 13234cc..6bf8b20 100644
Binary files a/static/props/preview/sword_C.png and b/static/props/preview/sword_C.png differ
diff --git a/static/props/preview/sword_D.png b/static/props/preview/sword_D.png
index 52f8db9..faf7a7b 100644
Binary files a/static/props/preview/sword_D.png and b/static/props/preview/sword_D.png differ
diff --git a/static/props/preview/sword_E.png b/static/props/preview/sword_E.png
index c450135..63ed80a 100644
Binary files a/static/props/preview/sword_E.png and b/static/props/preview/sword_E.png differ
diff --git a/static/props/preview/wand_A.png b/static/props/preview/wand_A.png
index 312b2fa..9dc7fc4 100644
Binary files a/static/props/preview/wand_A.png and b/static/props/preview/wand_A.png differ