Commit Graph

78 Commits

Author SHA1 Message Date
rewin c104e01adc Merge with main 2024-02-19 20:36:38 +03:00
rewin efe4299cc8 Merge branch 'main' into add-level-blocking 2024-02-19 20:32:44 +03:00
rewin e34f4c94ee Hide inspector if no selected elements 2024-02-19 20:27:31 +03:00
rewin 4e257af919 Allow to block drag logic for value changing 2024-02-16 22:40:25 +03:00
rewin bb81ca6806 Fixed empty field failure and fixed rotation showing 2024-02-16 22:14:32 +03:00
Danny McGee a1779fb1ec Add formatting, linting, and testing to CI checks (#44)
This PR adds `cargo fmt -- --check`, `nx lint ...` and `nx test ...` as
GitHub Actions. This will cause future PRs to automatically fail when
formatting issues, Clippy warnings, or test failures are present in the
changed code.
2024-02-15 16:04:45 -05: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
Danny McGee 32a8e80aa2 Hotfix: Console spam when animation retargeting is not running (#40)
This PR eliminates the console spam when a scene is loaded without an
animation retargeting source.
2024-02-09 14:26:36 -05:00
Danny McGee a5aeff7a3a Mixamo animation support (#37)
This PR adds support for Mixamo FBX imports (via backend conversion to
glTF/glB) and some miscellaneous improvements to the animation systems.

### User-facing improvements
* Retargeting math has been fixed to eliminate jittering issues
* Retargeter can now handle animated bone translations when present
  (generally this is only used for root motion)

### Housekeeping / Code improvements

* Animation-related components and system logic have been moved to a
  dedicated `anim` module and `AnimPlugin`
* Retargeting stuff has been moved from the `bvh` module to
  `anim::retargeting`
* Component-based solution for marking an entity as an animation
  retargeting source makes it easy to extend the retargeting functionality
  to new types of source animations

### Limitations

Currently the code assumes that there will be at most one animation
source at a time. That single animation (if present) will be retargeted
to all other skeletons in the scene. A component-based solution for
directing a specific target skeleton to use a specific source animation
is possible, but will require some additional consideration around the
implementation design for the read-only "viewer" modes.

### Test animations:

* Hip-Hop Dancing (Mixamo): ?mode=viewer&mixamo=mocap/hip-hop-dancing.gltf
* Shuffle (MocapNET): ?mode=viewer&bvh=mocap/shuffle.bvh
* Scott (MocapNET): ?mode=viewer&bvh=mocap/scott.bvh
* Scott 1 (MocapNET): ?mode=viewer&bvh=mocap/scott1.bvh
2024-02-09 13:21:16 -05: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 8f0b916eaa Scene in memory persistance and debug tools (#24)
![image](https://github.com/storytold/storyteller-bevy/assets/10954133/10eb5c33-2154-4e9d-95ce-1d8e8b822d22)
Debug tools example

---------

Co-authored-by: Danny McGee <dannymcgee@gmail.com>
2024-02-02 22:51:18 +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 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
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 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