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.htmlindex 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.htmlindex 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.tsindex 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.tsindex 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.tsindex 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.cssindex 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.glbnew file mode 100644index 0000000..a53b791Binary files /dev/null and b/static/props/AK.glb differdiff --git a/static/props/GrenadeLauncher.glb b/static/props/GrenadeLauncher.glbnew file mode 100644index 0000000..0b3a491Binary files /dev/null and b/static/props/GrenadeLauncher.glb differdiff --git a/static/props/Knife_1.glb b/static/props/Knife_1.glbnew file mode 100644index 0000000..66d709dBinary files /dev/null and b/static/props/Knife_1.glb differdiff --git a/static/props/Knife_2.glb b/static/props/Knife_2.glbnew file mode 100644index 0000000..57c8c07Binary files /dev/null and b/static/props/Knife_2.glb differdiff --git a/static/props/Pistol.glb b/static/props/Pistol.glbnew file mode 100644index 0000000..c06f7cdBinary files /dev/null and b/static/props/Pistol.glb differdiff --git a/static/props/Revolver.glb b/static/props/Revolver.glbnew file mode 100644index 0000000..3894b1bBinary files /dev/null and b/static/props/Revolver.glb differdiff --git a/static/props/Revolver_Small.glb b/static/props/Revolver_Small.glbnew file mode 100644index 0000000..5773ddeBinary files /dev/null and b/static/props/Revolver_Small.glb differdiff --git a/static/props/RocketLauncher.glb b/static/props/RocketLauncher.glbnew file mode 100644index 0000000..15477d0Binary files /dev/null and b/static/props/RocketLauncher.glb differdiff --git a/static/props/SMG.glb b/static/props/SMG.glbnew file mode 100644index 0000000..1ccc09fBinary files /dev/null and b/static/props/SMG.glb differdiff --git a/static/props/ShortCannon.glb b/static/props/ShortCannon.glbnew file mode 100644index 0000000..fb00d33Binary files /dev/null and b/static/props/ShortCannon.glb differdiff --git a/static/props/Shotgun.glb b/static/props/Shotgun.glbnew file mode 100644index 0000000..97b8ac1Binary files /dev/null and b/static/props/Shotgun.glb differdiff --git a/static/props/Shovel.glb b/static/props/Shovel.glbnew file mode 100644index 0000000..2c62d9cBinary files /dev/null and b/static/props/Shovel.glb differdiff --git a/static/props/Sickle.glb b/static/props/Sickle.glbnew file mode 100644index 0000000..c299d6eBinary files /dev/null and b/static/props/Sickle.glb differdiff --git a/static/props/Sniper.glb b/static/props/Sniper.glbnew file mode 100644index 0000000..d1f3b5fBinary files /dev/null and b/static/props/Sniper.glb differdiff --git a/static/props/Sniper_2.glb b/static/props/Sniper_2.glbnew file mode 100644index 0000000..35fe00bBinary files /dev/null and b/static/props/Sniper_2.glb differdiff --git a/static/props/preview/AK.png b/static/props/preview/AK.pngnew file mode 100644index 0000000..2e5ca53Binary files /dev/null and b/static/props/preview/AK.png differdiff --git a/static/props/preview/GrenadeLauncher.png b/static/props/preview/GrenadeLauncher.pngnew file mode 100644index 0000000..333aab1Binary files /dev/null and b/static/props/preview/GrenadeLauncher.png differdiff --git a/static/props/preview/Knife_1.png b/static/props/preview/Knife_1.pngnew file mode 100644index 0000000..ae62f6bBinary files /dev/null and b/static/props/preview/Knife_1.png differdiff --git a/static/props/preview/Knife_2.png b/static/props/preview/Knife_2.pngnew file mode 100644index 0000000..597385aBinary files /dev/null and b/static/props/preview/Knife_2.png differdiff --git a/static/props/preview/Pistol.png b/static/props/preview/Pistol.pngnew file mode 100644index 0000000..113f1b2Binary files /dev/null and b/static/props/preview/Pistol.png differdiff --git a/static/props/preview/Revolver.png b/static/props/preview/Revolver.pngnew file mode 100644index 0000000..baccb6eBinary files /dev/null and b/static/props/preview/Revolver.png differdiff --git a/static/props/preview/Revolver_Small.png b/static/props/preview/Revolver_Small.pngnew file mode 100644index 0000000..5e23362Binary files /dev/null and b/static/props/preview/Revolver_Small.png differdiff --git a/static/props/preview/RocketLauncher.png b/static/props/preview/RocketLauncher.pngnew file mode 100644index 0000000..be1141dBinary files /dev/null and b/static/props/preview/RocketLauncher.png differdiff --git a/static/props/preview/SMG.png b/static/props/preview/SMG.pngnew file mode 100644index 0000000..eaef9b9Binary files /dev/null and b/static/props/preview/SMG.png differdiff --git a/static/props/preview/ShortCannon.png b/static/props/preview/ShortCannon.pngnew file mode 100644index 0000000..db32e5bBinary files /dev/null and b/static/props/preview/ShortCannon.png differdiff --git a/static/props/preview/Shotgun.png b/static/props/preview/Shotgun.pngnew file mode 100644index 0000000..e8da986Binary files /dev/null and b/static/props/preview/Shotgun.png differdiff --git a/static/props/preview/Shovel.png b/static/props/preview/Shovel.pngnew file mode 100644index 0000000..e1109e0Binary files /dev/null and b/static/props/preview/Shovel.png differdiff --git a/static/props/preview/Sickle.png b/static/props/preview/Sickle.pngnew file mode 100644index 0000000..ccd6e6cBinary files /dev/null and b/static/props/preview/Sickle.png differdiff --git a/static/props/preview/Sniper.png b/static/props/preview/Sniper.pngnew file mode 100644index 0000000..4bbbb06Binary files /dev/null and b/static/props/preview/Sniper.png differdiff --git a/static/props/preview/Sniper_2.png b/static/props/preview/Sniper_2.pngnew file mode 100644index 0000000..123cd4fBinary files /dev/null and b/static/props/preview/Sniper_2.png differdiff --git a/static/props/preview/arrow_A.png b/static/props/preview/arrow_A.pngindex 9d6cbae..3ab5fde 100644Binary files a/static/props/preview/arrow_A.png and b/static/props/preview/arrow_A.png differdiff --git a/static/props/preview/arrow_B.png b/static/props/preview/arrow_B.pngindex 0fceb09..4d443fb 100644Binary files a/static/props/preview/arrow_B.png and b/static/props/preview/arrow_B.png differdiff --git a/static/props/preview/axe_A.png b/static/props/preview/axe_A.pngindex b4934dc..d03c53b 100644Binary files a/static/props/preview/axe_A.png and b/static/props/preview/axe_A.png differdiff --git a/static/props/preview/axe_B.png b/static/props/preview/axe_B.pngindex 99ebeea..adf25a9 100644Binary files a/static/props/preview/axe_B.png and b/static/props/preview/axe_B.png differdiff --git a/static/props/preview/axe_C.png b/static/props/preview/axe_C.pngindex e050fb7..1b7b3aa 100644Binary files a/static/props/preview/axe_C.png and b/static/props/preview/axe_C.png differdiff --git a/static/props/preview/bow_A.png b/static/props/preview/bow_A.pngindex c7722b1..b596b91 100644Binary files a/static/props/preview/bow_A.png and b/static/props/preview/bow_A.png differdiff --git a/static/props/preview/bow_A_withString.png b/static/props/preview/bow_A_withString.pngindex b2701eb..be41c63 100644Binary files a/static/props/preview/bow_A_withString.png and b/static/props/preview/bow_A_withString.png differdiff --git a/static/props/preview/bow_B.png b/static/props/preview/bow_B.pngindex 830ce8e..a9e65a6 100644Binary files a/static/props/preview/bow_B.png and b/static/props/preview/bow_B.png differdiff --git a/static/props/preview/bow_B_withString.png b/static/props/preview/bow_B_withString.pngindex 5f40a26..00e6a24 100644Binary files a/static/props/preview/bow_B_withString.png and b/static/props/preview/bow_B_withString.png differdiff --git a/static/props/preview/dagger_A.png b/static/props/preview/dagger_A.pngindex be46ddc..1be9ed3 100644Binary files a/static/props/preview/dagger_A.png and b/static/props/preview/dagger_A.png differdiff --git a/static/props/preview/dagger_B.png b/static/props/preview/dagger_B.pngindex 6362db8..e9412f7 100644Binary files a/static/props/preview/dagger_B.png and b/static/props/preview/dagger_B.png differdiff --git a/static/props/preview/fistweapon_A.png b/static/props/preview/fistweapon_A.pngindex cf6443d..4e7a543 100644Binary files a/static/props/preview/fistweapon_A.png and b/static/props/preview/fistweapon_A.png differdiff --git a/static/props/preview/fistweapon_A_stacked.png b/static/props/preview/fistweapon_A_stacked.pngnew file mode 100644index 0000000..0c626ceBinary files /dev/null and b/static/props/preview/fistweapon_A_stacked.png differdiff --git a/static/props/preview/fistweapon_B.png b/static/props/preview/fistweapon_B.pngindex 06a7e4e..d829cd8 100644Binary files a/static/props/preview/fistweapon_B.png and b/static/props/preview/fistweapon_B.png differdiff --git a/static/props/preview/fistweapon_B_stacked.png b/static/props/preview/fistweapon_B_stacked.pngnew file mode 100644index 0000000..9ca0d72Binary files /dev/null and b/static/props/preview/fistweapon_B_stacked.png differdiff --git a/static/props/preview/halberd.png b/static/props/preview/halberd.pngindex b3729d4..24a5c74 100644Binary files a/static/props/preview/halberd.png and b/static/props/preview/halberd.png differdiff --git a/static/props/preview/hammer_A.png b/static/props/preview/hammer_A.pngindex ff83a02..fba891d 100644Binary files a/static/props/preview/hammer_A.png and b/static/props/preview/hammer_A.png differdiff --git a/static/props/preview/hammer_B.png b/static/props/preview/hammer_B.pngindex 6bee10e..03efa7c 100644Binary files a/static/props/preview/hammer_B.png and b/static/props/preview/hammer_B.png differdiff --git a/static/props/preview/hammer_C.png b/static/props/preview/hammer_C.pngindex 5ea8587..cf74b93 100644Binary files a/static/props/preview/hammer_C.png and b/static/props/preview/hammer_C.png differdiff --git a/static/props/preview/shield_A.png b/static/props/preview/shield_A.pngindex 4bffdc6..1d71759 100644Binary files a/static/props/preview/shield_A.png and b/static/props/preview/shield_A.png differdiff --git a/static/props/preview/shield_B.png b/static/props/preview/shield_B.pngindex 1163032..401b278 100644Binary files a/static/props/preview/shield_B.png and b/static/props/preview/shield_B.png differdiff --git a/static/props/preview/shield_C.png b/static/props/preview/shield_C.pngindex d930338..981d82d 100644Binary files a/static/props/preview/shield_C.png and b/static/props/preview/shield_C.png differdiff --git a/static/props/preview/spear_A.png b/static/props/preview/spear_A.pngindex 0f3e6ff..e0b5a45 100644Binary files a/static/props/preview/spear_A.png and b/static/props/preview/spear_A.png differdiff --git a/static/props/preview/staff_A.png b/static/props/preview/staff_A.pngindex 6acd403..477b480 100644Binary files a/static/props/preview/staff_A.png and b/static/props/preview/staff_A.png differdiff --git a/static/props/preview/staff_B.png b/static/props/preview/staff_B.pngindex 1372d8c..db1ff2a 100644Binary files a/static/props/preview/staff_B.png and b/static/props/preview/staff_B.png differdiff --git a/static/props/preview/sword_A.png b/static/props/preview/sword_A.pngindex adf41b8..15b6342 100644Binary files a/static/props/preview/sword_A.png and b/static/props/preview/sword_A.png differdiff --git a/static/props/preview/sword_B.png b/static/props/preview/sword_B.pngindex 909a393..e92f4e0 100644Binary files a/static/props/preview/sword_B.png and b/static/props/preview/sword_B.png differdiff --git a/static/props/preview/sword_C.png b/static/props/preview/sword_C.pngindex 13234cc..6bf8b20 100644Binary files a/static/props/preview/sword_C.png and b/static/props/preview/sword_C.png differdiff --git a/static/props/preview/sword_D.png b/static/props/preview/sword_D.pngindex 52f8db9..faf7a7b 100644Binary files a/static/props/preview/sword_D.png and b/static/props/preview/sword_D.png differdiff --git a/static/props/preview/sword_E.png b/static/props/preview/sword_E.pngindex c450135..63ed80a 100644Binary files a/static/props/preview/sword_E.png and b/static/props/preview/sword_E.png differdiff --git a/static/props/preview/wand_A.png b/static/props/preview/wand_A.pngindex 312b2fa..9dc7fc4 100644Binary files a/static/props/preview/wand_A.png and b/static/props/preview/wand_A.png differ