Commit Graph

109 Commits

Author SHA1 Message Date
rewin bb81ca6806 Fixed empty field failure and fixed rotation showing 2024-02-16 22:14:32 +03:00
rewin 53b49e37dd Grid based style and pretty number inputs 2024-02-15 22:24:09 +03:00
rewin b1e21347a2 Fixed input update problem 2024-02-15 21:12:24 +03:00
rewin f78f4b8136 better event managment 2024-02-13 22:13:46 +03:00
rewin 5e5a6796f6 Safe unwrap id 2024-02-13 20:53:17 +03:00
rewin 89a870af7a Worked changing for trivial 2024-02-13 20:51:18 +03:00
rewin a81c8d226e Part of change pass to bevy 2024-02-11 20:01:11 +03:00
rewin 1597e6a164 Custom unpack with custom vnode 2024-02-11 18:08:31 +03:00
rewin 251cde8539 Worked connection in dioxus 2024-02-07 23:50:11 +03:00
rewin 73705ccec5 dioxus start working 2024-02-07 22:23:10 +03:00
rewin 7e0c3e850a testing 2024-02-02 21:14:54 +03:00
rewin ae6053cc06 fmt 2024-01-26 23:57:25 +03:00
rewin 5c50db1072 fix bvh start 2024-01-26 23:30:01 +03:00
rewin d505d20c5a fix build 2024-01-26 23:25:28 +03:00
rewin 89eb7d15ca fix loading screen 2024-01-26 23:09:43 +03:00
rewin 9a648b892a fix merge problem 2024-01-26 22:08:37 +03:00
rewin be93b20400 Merge branch 'main' into add-persistance 2024-01-26 21:11:29 +03:00
rewin 4318496d58 Finished persistance prototype 2024-01-25 23:34:25 +03:00
rewin 68833f0785 Fix wireframe bug and scene element tag 2024-01-25 21:09:14 +03:00
rewin 03a90daf6c Purely worked persistance 2024-01-23 23:21:27 +03:00
Danny McGee 2df86eaf58 Add support for alternate MocapNET bone names (#31)
This PR updates the retarget map to work for other variants of the
MocapNET bone names.
2024-01-19 02:34:38 -05:00
Danny McGee 0e3c285d30 Load remote BVH from URL param (#30)
This PR replaces the hard-coded BVH animation with a URL parameter, and
adds a specialized BVH viewer web component and entry-point function for
previewing the specified animation on our generic mannequin.
2024-01-19 00:17:51 -05:00
Danny McGee e1235d6a8f Mitigate BVH retargeting jitter (#29)
The initial BVH retargeting solution produced very jittery results. Much
of that jitter was eliminated by using linear interpolation between
frames instead of immediate stepped transitions, but some jittering
still remained, particularly noticeable in the finger motions.

This PR largely fixes remaining jitter issues by making a few changes:

#### Frame-time quantization

Previously, we had been using the `BvhAnim::timer` field incorrectly, by
manually resetting it after `Timer::just_finished` returned `true`, and
returning `0.0` as the interpolation parameter for that frame. This
resulted in a herky-jerky animation due to misalignment between the BVH
animation's frame time and the actual application refresh rate, meaning
we would lose fractions of a frame every time the timer elapsed and the
frame was incremented. This PR addresses that by never calling
`Timer::reset` and always using `Timer::percent` for the interpolation
parameter.

#### Matrix instability

This PR refactors the retargeting system to operate on `Affine3A`
matrices instead of `Mat4`s. `Affine3A` represents a SIMD-optimized 3x3
matrix + a translation vector, so using it provides a small performance
boost in addition to being slightly more numerically stable.
Additionally, we now periodically re-orthonormalize the 3x3 matrices
in-between operations to mitigate drifting due to the accumulation of
floating-point errors.
2024-01-19 00:11:01 -05:00
Brooks Palin 5cee4482ef Hotfix: Restore skybox property (#28)
Restores the `skyboxId` property that was acccidentally removed from the
`<sts-viewer />` element
2024-01-18 17:53:23 -05:00
Brooks Palin 4b19c76272 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.
2024-01-18 15:41:56 -07:00
Danny McGee 1687bfd6ed BVH animation loading / retargeting (#25)
This PR adds support for BVH animation files, with a custom animation
player and retargeting solution for our Blender Rigify-based skeletal
meshes.

---------

Co-authored-by: Brooks Palin <brookspalin710@gmail.com>
2024-01-18 17:28:25 -05:00
Danny McGee cc00f197dc Refactor entry-point functions (#26)
This PR refactors the `studio` project's entry-point functions for
better maintainability and ease of use for local development.

### Overview
* `start_internal` refactored to return a `bevy::app::App` instead of
  calling `App::run`, allowing for finer-grained configuration of unique
  use cases
* Temporary `start` function added for WASM
* `init` function removed
* `main` standalone entry-point refactored to call `start_internal`

### Fixes
* Crash on non-WASM builds due to missing `StudioMode` resource
* Warning on non-WASM builds due to an unused variable
2024-01-18 15:52:33 -05:00
rewin 71a17cdfca Merge branch 'main' into add-persistance 2024-01-18 21:59:36 +03:00
Danny McGee 5f62a4024b StudioMode switch for full-editor capabilities (#23)
This PR adds a `StudioMode` resource to toggle editing capabilities, and
configures the frontend application to read the desired mode from a URL
parameter.

For now, setting the app to `StudioMode::Viewer` with
`<app-url>?mode=viewer` hides the Transform Toolbar and disables most of
the interactive features of the app, but otherwise exhibits the same
behavior as `StudioMode::Editor` / `<app-url>?mode=studio`.

In the future, the "Viewer" and "Editor" modes will receive different
initialization inputs to better serve the needs of their use cases. In
particular:

* The "Viewer" mode will accept a BVH animation handle, which should be
  played in a loop on a simple mannequin asset, allowing a user to preview
  a given animation before using it within the full studio workflow.
* The "Editor" mode will accept a full Bevy scene handle which can be
  edited and saved to the user's account. These scenes will serve as the
  basis for the generative-AI workflows Storyteller Studio is ultimately
  seeking to facilitate.
* It will likely be useful for "Editor" mode to alternatively accept
  only a BVH animation handle, which would be used to initialize a new
  scene for editing similar to "Viewer" mode, but with editing
  capabilities enabled.
2024-01-18 13:56:46 -05:00
rewin 81b8dbd6ca fix delete event 2024-01-17 22:32:52 +03:00
rewin cfe849959e sync selection between editor and storyteller 2024-01-17 20:10:14 +03:00
rewin 8320297874 Fix camera drawing 2024-01-16 23:20:03 +03:00
rewin 657629f62a Fix debug ui 2024-01-16 22:15:57 +03:00
rewin e2cd421828 first step to persistance and space_editor integration 2024-01-15 23:20:41 +03:00
Danny McGee 3ef34ccd8c Update package-lock (#22)
Fixes the `package-lock.json` to match the `package.json` manifest.
2024-01-12 16:48:50 -05:00
Danny McGee afe6139f75 Refactor studio-frontend (#19)
This PR does some rudimentary cleanup / reorganizing to the
`studio-frontend` project.

### Changes
* Refactored `studio-frontend` to use the `<sts-canvas-provider/>` and
  `<sts-viewer/>` components from `studio-web`
* Added some CSS layout utilities for positioning overlayed UI elements
* Extracted `<sts-toolbar/>` and `<sts-toolbar-group/>` to their own
  components
* Extracted `<sts-transform-toolbar/>` to its own component
2024-01-12 16:35:32 -05:00
rewin 16fdd008a4 Merge pull request #21 from storytold/add-undo
Add undo
2024-01-12 22:53:42 +03:00
rewin 89e6a7bae8 remove rebuild gizmo 2024-01-12 22:48:19 +03:00
rewin fd35acc498 cargo fmt 2024-01-12 20:59:58 +03:00
rewin bd8cd88c50 lint fix 2024-01-12 20:59:31 +03:00
rewin 49db8a5fef cargo lock 2024-01-12 20:51:22 +03:00
rewin 9780020cc9 fix mouse motion delta counting 2024-01-12 20:51:07 +03:00
rewin 02a0233811 fix camera movement 2024-01-12 20:23:31 +03:00
rewin 2732237156 fix gizmo scale 2024-01-12 20:16:50 +03:00
rewin bb102221ef Fix wasm build 2024-01-11 23:09:30 +03:00
rewin 9d01036cd2 set version with no start undo bug 2024-01-11 22:26:42 +03:00
rewin 91ab46639a Finish refactor gizmo 2024-01-11 22:16:13 +03:00
rewin ce36fff9cd Rotation refactor 2024-01-11 21:03:47 +03:00
rewin 8bf6b796ae Gizmo refactor for translation local version 2024-01-10 23:08:08 +03:00
rewin a032561e40 Update lib.rs 2024-01-09 23:24:55 +03:00