Code Monkey home page Code Monkey logo

opensim-creator's Introduction

workflow DOI

OpenSim Creator OpenSim Creator Logo

A UI for building OpenSim models

๐Ÿ‘“ Overview

screenshot

OpenSim Creator (osc) is a standalone UI for building and editing OpenSim models. It is available as a freestanding all-in-one installer for Windows 10 (or newer), MacOS Ventura (or newer), and Ubuntu 20 (or newer).

Architecturally, osc is a C++ codebase that is directly integrated against the OpenSim core C++ API. It otherwise only uses lightweight open-source libraries that can easily be built from source (e.g. SDL, ImGui, and stb) to implement the UI on all target platforms. This makes osc fairly easy to build, integrate, and package.

osc started development in 2021 in the Biomechanical Engineering department at TU Delft. It is currently funded by the Chan Zuckerberg Initiative's "Essential Open Source Software for Science" grant (Chan Zuckerberg Initiative DAF, 2020-218896 (5022)).

Project Sponsors
TUD logo
Biomechanical Engineering at TU Delft
CZI logo
Chan Zuckerberg Initiative

๐Ÿš€ Installing

You can download a release from the ๐Ÿ“ฅ releases page. The latest release is ๐Ÿ“ฅ here. Also, OpenSim Creator is regularly built from source using GitHub Actions, so if you want a bleeding-edge--but unreleased--build of OpenSim Creator check โšก the actions page (downloading a CI build requires being logged into GitHub; otherwise, you won't see download links).

Windows (10 or newer)

  • Download an exe release
  • Run the .exe installer, continue past any security warnings
  • Follow the familiar next, next, finish wizard
  • Run OpenSimCreator by typing OpenSimCreator in your start menu, or browse to C:\Program Files\OpenSimCreator\.

Mac (Ventura or newer)

  • Download a dmg release
  • Double click the dmg file to mount it
  • Drag osc into your Applications directory.
  • Browse to the Applications directory in Finder
  • Right-click the osc application, click open, continue past any security warnings to run osc for the first time
  • After running it the first time, you can boot it as normal (e.g. Command+Space, osc, Enter)

Ubuntu (20 or newer)

  • Download a deb release
  • Double-click the .deb package and install it through your package manager UI.
  • Alternatively, you can install it through the command-line: apt-get install -yf ./osc-X.X.X_amd64.deb (or similar).
  • Once installed, the osc or OpenSim Creator shortcuts should be available from your desktop, or you can browse to /opt/osc

๐Ÿ“– Citing/Acknowledging

OpenSim Creator doesn't have a central written software publication that you can cite (yet ๐Ÿ˜‰). However, if you need to directly cite OpenSim Creator (e.g. because you think it's relevant that you built a model with it), the closest thing you can use is our DOI-ed Zenodo releases (metadata available in this repo: CITATION.cff/codemeta.json):

Kewley, A., Beesel, J., & Seth, A. (2024). OpenSim Creator (0.5.12). Zenodo. https://doi.org/10.5281/zenodo.11086325

If you need a general citation for the simulation/modelling technique, you can directly cite OpenSim via this paper:

Seth A, Hicks JL, Uchida TK, Habib A, Dembia CL, et al. (2018) OpenSim: Simulating musculoskeletal dynamics and neuromuscular control to study human and animal movement. PLOS Computational Biology 14(7): e1006223. https://doi.org/10.1371/journal.pcbi.1006223

๐Ÿฅฐ Contributing

If you would like to contribute to OpenSim Creator then thank you ๐Ÿฅฐ: it's people like you that make open-source awesome! See CONTRIBUTING.md for more details.

๐Ÿ—๏ธ Building

Note: The build instructions here are for general users who just want to build OSC.

Because everyone's C++ build environment is slightly different, there are no catch-all build instructions that will work for everyone. Instead, we recommend reading + running the automated build scripts, or reading some of the basic tips-and-tricks for Visual Studio or QtCreator (below).

Windows (10 or newer)

  1. Get git:
    1. Download+install it from https://git-scm.com/downloads
    2. Make sure to add it to the PATH. Usually, the installer asks if you want this. If it doesn't ask, then you may need to add it manually (google: "Modify windows PATH", add your git install: C:\Program Files\Git\bin)
    3. Verify it's installed by opening a terminal (Shift+Right-Click -> Open Powershell window here) and run git
  2. Get C++20-compatible compiler (Visual Studio 17 2022):
    1. Download+install it from https://visualstudio.microsoft.com/downloads/
    2. Make sure to select C/C++ development in the installer wizard when it asks you what parts you would like to install
  3. Get cmake:
    1. Download+install it from https://cmake.org/download/
    2. Make sure to add it to the PATH. Usually, the installer asks if you want this. If it doesn't ask, then you may need to add it manually (google: "Modify windows PATH", add your cmake install: C:\Program Files\CMake\bin)
    3. Verify it's installed by opening a terminal (Shift+Right-Click -> Open Powershell window here) and run cmake
  4. Get NSIS:
    1. Download+install it from https://nsis.sourceforge.io/Download
  5. Get python and pip:
    1. Download from https://www.python.org/downloads/
    2. Make sure python and pip are added to the PATH (the installer usually prompts this)
    3. Verify they are installed by opening a terminal (Shift+Right-Click -> Open Powershell window here) and run python --help and pip --help
  6. Build OpenSim Creator in a PowerShell terminal:
    1. Open a PowerShell terminal (Shift+Right-Click -> Open Powershell window here)
    2. Clone opensim-creator: git clone https://github.com/ComputationalBiomechanicsLab/opensim-creator
    3. cd into the source dir: cd opensim-creator
    4. Run the build script: python .\scripts\build_windows.py (warning: can take a long time)
  7. Done:
    1. The osc-build directory should contain the built installer

Mac (Ventura or newer)

  1. Get brew:
    1. Go to https://brew.sh/ and follow installation instructions
  2. Get git:
    1. Can be installed via brew: brew install git
  3. Get C++20-compatible compiler (e.g. clang via brew, or newer XCodes):
    1. OpenSim Creator is a C++20 project, so you'll have to use a more recent XCode (>14), or install a newer clang from brew (e.g. brew install clang)
  4. Get cmake:
    1. Can be installed via brew: brew install cmake
  5. Get python and pip (optional: you only need this if you want to build documentation):
    1. Can be installed via brew: brew install python
  6. Build OpenSim Creator in a terminal:
    1. Clone opensim-creator: git clone https://github.com/ComputationalBiomechanicsLab/opensim-creator
    2. cd into the source dir: cd opensim-creator
    3. If you have multiple C++ compilers, make sure that the CC and CXX environment variables point to compilers that are compatible with C++20. E.g. export CXX=$(brew --prefix llvm@15)/bin/clang++
    4. Run the build script: scripts/build_mac.sh (warning: can take a long time)
  7. Done:
    1. The osc-build directory should contain the built installer

Ubuntu (20 or newer)

  1. Get git:
    1. Install git via your package manager (e.g. apt-get install git)
  2. Get a C++20-compatible compiler:
    1. Install g++/clang++ via your package manager (e.g. apt-get install g++)
    2. They must be new enough to compile C++20 (e.g. clang >= clang-11)
    3. If they aren't new enough, most Linux OSes provide a way to install a newer compiler toolchain (e.g. apt-get install clang-11). You can configure which compiler is used to build OpenSim Creator by setting the CC and CXX environment variables. E.g. CC=clang-11 CXX=clang++-11 ./scripts/build_debian-buster.sh
  3. Get C++20-compatible standard library headers (usually required on Ubuntu 20):
    1. sudo apt-get install libstdc++-10-dev
  4. Get cmake:
    1. Install cmake via your package manager (e.g. apt-get install cmake)
    2. If your cmake is too old, build one from source, see: https://askubuntu.com/a/865294
  5. Get python and pip (optional: you only need this if you want to build documentation):
    1. Install python3 and pip3 via your package manager (e.g. apt-get install python3 pip3)
  6. Build OpenSim Creator in a terminal:
    1. Clone opensim-creator: git clone https://github.com/ComputationalBiomechanicsLab/opensim-creator --recursive
    2. cd into the source dir: cd opensim-creator
    3. If you have multiple C++ compilers, make sure that the CC and CXX environment variables point to compilers that are compatible with C++20. E.g. export CC=clang-12, export CXX=clang++-12
    4. Run the build script: scripts/build_debian-buster.sh
  7. Done:
    1. The osc-build directory should contain the built installer

๐Ÿ’ป Setup Development Environment

These are some generic tips that might be handy when setting up your own development environment.

Visual Studio 2022

  • Run build_windows.py --skip-osc (described above) to get a complete build of OSC's dependencies.
  • In Visual Studio 2020, open opensim-creator as a folder project
  • Later versions of Visual Studio (i.e. 2017+) should have in-built CMake support that automatically detects that the folder is a CMake project
  • Right-click the CMakeLists.txt file to edit settings or build the project
    • You may need to set your configure command arguments to point to the dependencies install (e.g. -DCMAKE_PREFIX_PATH=$(projectDir)/osc-dependencies-install)
  • Use the Switch between solutions and available views button in the Solution Explorer hierarchy tab to switch to the CMake Targets View
  • Right-click the osc CMake target and Set As Startup Project, so that pressing F5 will then build+run osc.exe
  • (optional): switch the solution explorer view to a Folder View after doing this: the CMake view is crap for developing osc
  • You should now be able to build+run osc from Visual Studio
  • To run tests, open the Test Explorer tab, which should list all of the googletest tests in the project

QtCreator

  • Run the appropriate (OS-dependent) buildscript (described above)
  • Open QtCreator and then open the opensim-creator source directory as a folder
  • For selecting a "kit", QtCreator usually detects that osc-build already exists (side-effect of running the buildscript). You may need to "import existing kit/build" and then select osc-build, though
  • Once QtCreator knows your source dir (opensim-creator/) and build/kit (opensim-creator/osc-build), it should be good to go

opensim-creator's People

Contributors

adamkewley avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

opensim-creator's Issues

Add the ability to record video files from simulations

Estimate: 4-7d (assuming recording the states etc. is already sorted and the user doesn't want fancy recording options)

This is a stub issue for implementing simulation recording.

High-level overview:

  • Find a basic, easy to compile from source, C/C++ library for video encoding to webm or one of the MPEG implementations
  • Add button into simulation UI to "record this simulation to a video" that collects up all of the (evenly-spaced) SimTK::States from the simulator into video frames
  • Perform any relevant fixups for video recording (resolution, aspect ratio, interpolating SimTK::States to align with the video framerate)
  • Render each frame to a render buffer/texture and read the pixels onto the CPU, use the video encoder to encode the frame bitmaps into a video stream
  • Prompt for save locations, implement other UX features like a saving bar, progress, etc. etc.

The encoder does not need to be high-perf, only "good enough" to provide the feature. It's preferred to use smaller libraries that OSC can build from source on all target platforms, rather than larger encoding libraries that are a complete PITA to build + integrate (looking at you, FFMPEG...)

Add connection lines into hierarchy viewer

Estimate: 2-4h

A nice-to-have feature - probably more useful on smaller models where everything in the hierarchy viewer is within one scroll page.

Items in the mesh importer scene graph are displayed in a hierarchy viewer. They may also be "attached" to each other (e.g. a mesh attaches to a body). One comment in a UX session was that it's unclear what's attached to what. The 3D viewer shows connection lines but one suggestion was to also show thin connection lines in the 2D hierarchy viewer.

Add "toggle frame visibility" contextual action for `OpenSim::Joint`

Estimate: 0.5-3d (large range because it's unclear what it would entail to be done robustly and clearly)

When a user hovers a joint in the osim hierarchy, it would be nice to show the joint center in the 3D visualizer, to make it easy to figure out its current orientation etc.

It might be that "show frames" effectively does this, but isn't clear enough yet.

Add ability to search physical frames in the add body (attach) modal

Estimate: 1-2d

When a user adds a new body, they are presented with a list of all the other frames the body can attach to. This list should (ideally) be sorted and searchable.

When the user adds some other component (e.g. a force), they are presented with a list of frames that the component's sockets will connect to. These, too, should be sorted + searchable.

Add support for adding wrapping surfaces in-UI

Estimate: 2-10d (wide range because it's ill-defined how robustly it needs to be implemented)

There isn't currently any support for this because wrapping surfaces are a little annoying to do with the existing automated modals. Iirc, it's because the wrapping geometry has to be added into the model's wrapset and connected to a relevant GeometryPath correctly etc. to all work.

Add ability to delete anything in the model

Estimate: 1-2 days for basic support (of the most used types, with some error swallowing), 2-5 days for more comprehensive support.

I anticipate adding okay support that enables deleting the most important component types (e.g. bodies, joints) may take a day or so with a little basic testing and some robustness code that rolls back if the operation breaks the model. A robust implementation that handles a wide variety of edge-cases, presents the users with appropriate options ("would you like to reassign that now-dangling socket?") may take several days.

Deleting things in an OpenSim model is currently quite difficult because only some items support deletion. The reason why is because some components can be dependent on other components (recursively). For example, a muscle might be dependent on a geometry path which is dependent on path points which are dependent on a body frame. Deleting a body might therefore require deleting the points, path, and muscle that are (in some cases, indirectly) dependent on it.

Add alpha blending to the selection rims

Estimate: 1-3d

If the user has an item selected in the UI and then hovers over an item that surrounds that item then the inner-item's rims will be dimmed. There's deeper technical reasons for why this happens, but it should ideally show each rim clearly.

Add a preview window when attaching geometry

Estimate: 1-2d

When the user is attaching geometry to a body or something, they're presented with text dropdowns like "cube", "sphere," etc. If they select one, or a file, it would be nice to have a little 3D viewer that shows what they're about to attach.

Add alternate 3D scene themes

Estimate: 2-3d

Giving the user the ability to configure the scene with a different floor, lighting, background image, etc. would be nice. Based on what I'm seeing in presentations etc. people seem to enjoy wooden floors (those monsters).

Adding a mesh in mesh importer (/w clicking) should also select the mesh

Estimate: 0.5-2d (depends on how we deal with the event propagation)

Minor bug

There is currently a bug in the mesh importer screen where importing a mesh using the mouse (i.e. clicking "open" in the dialog) causes the mesh to be imported, but de-selected.

The code for importing the mesh is fine, the problem is that the click event from clicking "open" is being propagated to the UI, which is intepreting it as a click

Add measurement tool w.r.t. a frame

Estimate: 0.5-1.5d

There's currently a hacky spatial measurement tool, but one thing that people are asking for is a measurement tool that measures things within a particular frame (coordinates, lengths, whatever).

The idea would be that a user selects some frame in the scene and then starts clicking somewhere else so that the UI says "oh yes, it's here in space and it's this far across, etc.)

Add solidworks-style "mate" function to mesh importer

Estimate: 1-5d (wide range because I don't know the alg at all)

This requires more investigation.

Based on user feedback, one thing that might be handy is the ability to "mate" two meshes toghether. Effectively, to slam two meshes into eachover until they collide as a way of positioning them relative to eachover (imagine having bone meshes that are separate in space but you want to position them such that they are touching - you want to "mate" them).

Fix measuring tool annotations overlapping at certain angles

Estimate: 1-4h (might end up requiring a little jiggling around to do robustly)

From Nerissa:

I found a 'problem' in the new measuring tool. As you can see in the image below, it is possible for the measured distance and the coordinates you point at to overlap, making it hard or impossible to read the measured length. Of course, with some manouvring, it is possible to work around it, but it might be nice to e.g. redirect the coordinates or length whenever this happens.

image

Add listing things connected (via sockets) to the currently-selected body

Estimate: 2-6d (wide range because doing this properly would also require stuff like drawing 3D connection lines, modals for displaying connectivity, etc.)

If the user selects a body in the UI, a common question is "which joints are connected to this body", or "which offset frames are connected to this body", or similar. There isn't currently an easy way to figure this out, bar going through the joints and manually checking.

Add support for all SimTK::DecorativeGeometry types (e.g. arrow geometry)

Estimate: 1-2d for partial support, 5-8 days for full support (TextGeometry) with the side-benefit that full support would also mean other parts of OSC would then be able to render 3D text.

The SimTK::DecorativeGeometryImplementation implementation that OSC uses, which is directly coupled to OSC's lower-level systems (notably, GPU allocation/caching) does not implement all geometry types yet. This means that if an OpenSim model / SimTK system contains one of those unknown geometries then it will not be visible in OSC.

Steps necessary:

  • DONE: install a one-time log warning message whenever the frontend (e.g. an OpenSim model) tries to emit a not-supported geometry to the backend

  • Find some OpenSim models that contain these not-yet-supported geometries, if possible, and install them into the examples/ dir so that we have in-prod testing of the geometry available (so it's easier to end-users to investigate)

  • Write custom OpenSim models that contain geometry that isn't exercised by existing OpenSim model files (e.g. a model containing toruses)

  • Implement each missing geometry:

    • PointGeometry
    • CircleGeometry
    • EllipsoidGeometry
    • TextGeometry (harder)
    • MeshGeometry (not MeshFile, which is already implemented)
    • ArrowGeometry
    • TorusGeometry
    • ConeGeometry
  • Ensure there is a model building route for adding these geometries (e.g. adding dropdows/buttons for attaching them to OpenSim::Bodys in the model)

Implement tabbed interface

At the moment, the OSC UI splits things into entirely sandboxed "screens" that may share a little state but have complete control over the entire window frame. The main screens users see are:

These need to be refactored into a "Tab" interface, which will largely be the same as the screen interface, but with the following differences:

  • All code in the screen class needs to be "tab-aware", in terms of figuring out where to draw its respective content
  • Each "tab" needs to have access to some kind of parent "tab controller", or an observer pattern needs to be implemented (e.g. onTabCloseRequested), so that tabs can close themselves, open other tabs, blink the tab (e.g. when a sim is complete), set the tab's title, etc.

Add shortest-path relative positioning in the mesh importer

Estimate: 2-4d

Some users prefer positioning things in the local coordinate system. This is particularly handy for users that have their frames set up in some external software that happens to use a different coordinate system.

"Shortest path" refers to the fact that a body may be joined to ground by multiple joints. The "shortest" path should be chosen when deciding which parent frame to use for this local-space transform.

Add gizmo support in the editor's 3D viewer

Estimate: 2-9d (wide range because grabbing and dragging might require a rehaul of the model commit system and UI renderer also, it would also require fairly tricksy heuristics for handling OpenSim)

This would require a property-to-viewer interaction, or at least some kind of heuristic (e.g. "is a freejoint selected? manipulate coords, is an offsetframe selected? manipulate transform, etc.)

Add basic screenshot support to 3D viewers

Estimate: 2-4d for most of the implementation (incl. UI windows for picking sizes etc.)

Add basic support for screen-shotting the 3D viewer alone.

Of course, users could just do this themselves with print screen/snippet tool. However, the main benefits of having something in-UI is that the UI has direct access to the renderer, so it can:

  • Snip out all the UI b.s. around the edges of the render (possible with a snippet tool on most OSes, but is a little annoying to get pixel-perfect with a mouse)
  • Disable (optionally) any gizmos in the viewer
  • Let the user select a standard resolution + aspect ratio (4:3, 16:9; 300 DPI, etc) for pasting the image into a powerpoint presentation, report, blog post, etc.
  • Let the user disable the background elements completely (floor, background color, etc.) so that they can save an alpha-blended image that only contains useful scene elements. Again, this makes it easier to place an image into a presentation slide, which may use a slighly different (maybe, even textured) background.

Committable osim editor

Estimate: 3-6d (the datastructure is used in a lot of places)

At the moment, the osim editor allows for Undo/Redo behavior. This works by enabling edits to a "scratch" model that's later system'd, state'd, and render'd before being pushed into an undo/redo circular buffer.

The current API effectively dirty-flags the model as it's edited and, finally, performs this commit magic at the end of the frame (if necessary). This is sub-optimal because there is no metadata. The client code just edits a model and forgets about undo/redo (it's automatic, based on the flag). This means we can't have a labelled history ("added this", "deleted that") and we can't easily later support features like labelled snapshots and model versioning.

Add shadow rendering

Estimate: 1-2d (basic impl.), 3-5d (impl that also takes things like crazy length scales into account correctly and has soft edges without blowing the GPU up)

The current implementation does not render any scene shadows, which gives a very "flat" look to the scene. I've previously implemented shadows using a standard shadowmapping technique, e.g. as in here:

https://learnopengl.com/Advanced-Lighting/Shadows/Shadow-Mapping

Integrating it into OSC shouldn't be too much work. Main issue is ensuring the shadowmap is aligned correctly relative to the current camera position, and ensuring the shadows don't become too messed up when the camera is (e.g.) zoomed out and the shadowmap's resolution is insufficient to map distant objects. It would be too much work to implement hierarchichal shadow maps.

Add putting currently-edited filename in window's titlebar

Medium prio: it's an easy(ish) change that helps a user know when their data is "safe"
Estimate: 1d, 2d if also implementing dirty flagging at the same time

When a model is opened, the window's titlebar should change from:

OpenSim Creator

To:

OpenSim Creator (file.osim)

And ideally there should be some dirty-flagging, so that an unsaved file shows with an asterisk:

OpenSim Creator (file.osim*)

But this might be a fair bit more work

Change window (open/closed) preferences to persist between boots

Estimate: 2-4d (it also requires robustly implementing a long-term per-user configuration system)

At the moment, if the user opens/closes windows it isn't remembered between boots of the application. This makes the UI feel a little less "homey" because the user may have set things up just how they like it to find that resetting the application wipes all memory of their changes.

Implement better splash screen layout

Estimate: 2-6h

Even the lowest-end of laptops render just enough of the splash screen, but it's unknown what our typical users actually use, so pessimistically assume "the worst laptops in the world".

The current splash screen uses a hard-coded main menu size. It's mostly ok, but can push the top logo etc. off the edges of the screen on low-res screens (e.g. the ones found on low-end laptops).

Add automatic vertex deduplication for meshes, etc.

Estimate: 1-3d

Currently, all meshes emitted by the backend are duped. As in, they're either:

  • Whatever the backend emits for a primitive like a sphere, where the algorithm might not be sophisticated enough to dedupe overlapping verts
  • Whatever is loaded from asset files, where the asset file may contain many duped verts

It would be advantageous to implement basic vert deduplication because we already have the necessary backend for it (the codebase is already using EBOs) and it would reduce the GPU's memory pressure slightly, which is a nice-to-have on lower-end devices.

Add support for axis-aligned (front, side) "flat" display-only images

Estimate: 2-6d (adding texture support is easy, most of the work is around adding relevant dialog boxes, buttons, etc.)

For model building.

Let the user add an image--e.g. an arm anatomy diagram--along an axis of the scene /w adjustable opacity, so that the user can edit the OpenSim model with that as a ("tracing") background. This is really handy for sculpting, where people usually work this way in other software (e.g. Blender).

Change mesh importer "Between 2 mesh points" to work with left-click only

Estimate: 1-4h

The "move something between two meshpoints" and similar actions currently rely on left- then right-clicking to get two points. The logic is that left-click assigns one point and right-click assigns the other.

The issue is that the screen immediately transitions once both points are set with no backsies. It would be better to instead make it such that users can do the entire thing with one button, but that there's some basic undo/redo support and a big "FINISHED" button once they're happy with placement.

Add a cancel button to the modal screens

High-prio: modal screens frequently confuse certain types of users and this fix isn't hard to implement
Estimate: 1-3h

A modal screen is one of the "do something" screens in the mesh importer. It's effectively a "mode" that the entire screen temporarily enters to prompt something from the user that can't allow any other actions to take place (e.g. "select something").

At the moment, modal screens only show a little bit of text in the top-left corner like "click something, or press ESC to exit". It would be better if there was also a cancel button that the user clearly sees and that takes them back.

Add better panel positioning logic

Estimate: 1-2d

At the moment, the initial position of ImGui panels is based on a hard-coded configuration file that I copy from my dev machine. Ideally, the initial position of panels would be calculated based on the host's computer (screen dimensions, etc.) because my screen might be a lot larger than some users (who might be using cheaper low-res laptops)

Add Mesh Importer modals for grabbing (G) rotating (R) and scaling (S) the scene

Estimate: 4-8d

This is a fairly big feature that tries to mimic how Blender works.

The idea is that users can click G, R, or S in a 3D scene to temporarily enter a "mode" in that screen that performs the specific action. The user can also press X, Y, or Z while in that mode to perform a transform in that axis.

E.g. this would enable a user:

  • Clicking something to select it
  • Pressing G to enter "grab" mode
  • Pressing X to enter "grab X" mode
  • Typing a number to move the element along X
  • Pressing enter to commit to the change, or ESC to back out of the mode

The benefit of this UX feature is that it removes the user from having to use the right-click menu or on-screen gizmos, which are harder to click.

Fix muscle coloring being dependent on the drawlist being coerced to "muscles only" first

The reason this bug exists is because muscle coloring requires scanning over the entire geometry list "looking" for muscle-related geometry.

If "coerce selection to muscle" is selected then the comparison is something like:

for (Component* c : drawlist) {
    if (dynamic_cast<Muscle>(c)) {
        // perform muscle coloring
    }
}

Which is O(n) w.r.t. the number of components in the drawlist - assuming dynamic_cast is asymtopically O(1) to figure out whether an instance is a child of some other class (this is implementation dependent and likely depends on how type information is loaded into the runtime vtable etc.). Whereas to make the feature work when "coerce selection to muscle" is not selected then the comparison is something like:

for (Component* c : drawlist) {
    if (dynamic_cast<Muscle>(c) || is_child_of<Muscle>(c)) {
        // perform muscle coloring
    }
}

Where is_child_of is an algorithm that needs to crawl up the model hierarchy until it either hits a muscle (it is a child of a Muscle) or root (it is not a child of a muscle). The crawl is O(m) in average depth of the component in the model hierarchy. Most subcomponents in a model are deeper (the tree "fans out" to many lower levels, like individual points in a muscle, quite a bit).

OpenSim models also aren't exactly memory-local, so you're trading a linear scan over the drawlist (the for) and an (assumed O(1)) dynamic_cast with a not-memory-local tree traversal that performs many dynamic_casts also. The perf hit is mostly in memory locality issues.

I'll re-insert the is_child_of code and see if it's actually a problem, though. It's probably better to have a consistent user experience (changing muscle coloring "just works" rather than being dependent on some unrelated setting) than be a few percent faster in rendering.

Add a search bar to combo boxes

Estimate: 2-6h

If the user clicks a combo box, it lists the options. However, some users expect to be able to type the first few letters of an option case-insentively to find something.

Implement tabbed interface

Estimate: 2-6d (wide range because the code is ready for it, but there might be some annoying edge-case stuff to kick out during implementation)

At the moment, the OSC UI splits things into entirely sandboxed "screens" that may share a little state but have complete control over the entire window frame. The main screens users see are:

These need to be refactored into a "Tab" interface, which will largely be the same as the screen interface, but with the following differences:

  • All code in the screen class needs to be "tab-aware", in terms of figuring out where to draw its respective content
  • Each "tab" needs to have access to some kind of parent "tab controller", or an observer pattern needs to be implemented (e.g. onTabCloseRequested), so that tabs can close themselves, open other tabs, blink the tab (e.g. when a sim is complete), set the tab's title, etc.

Add a basic simbody simulation viewer screen

Estimate: 1-2d for a basic 3D visualizer with basic tooling.

The OSC backend could easily support directly rendering Simbody simulations, because it already (effectively) does this via OpenSim.

Although this isn't a core required feature of OSC, the advantage of implementing a basic Simbody visualizer is that it enables exercising Simbody features directly in OSC separately from OpenSim, which is useful for debugging a simulation/rendering issue (it removes OpenSim from the equation).

Change sliders (eg in the coordinate panel) to look more like sliders

Estimate: 1d

The ImGui default slider (e.g. the one use to slide along coordinate values) is difficult for some users to identify. This is because modern software like blender, youtube, etc. use a slider design that is a thinner line with a larger circular slider button.

Sliders should also make it clearer how to edit their value (Ctrl+LeftClick) - it's not obvious right now.

Implement adding bodies via a context menu

Estimate: 2-4d (it would also require re-architecting the 3D viewport API to robustly handle specialized context menus, which would be nice to have for other reasons though)

Right-clicking a body in the visualizer should, ideally, show a contextual action like attach new body to this or something. This is so that the user doesn't have to separately find the body in the add body modal

Add DOF lengths to all joint types in the mesh importer

Estimate: 0.5-2d (depends on how easy it is to automate)

At the moment, the mesh importer tries to show which axis has a degree of freedom by lengthening it and shortening the others. For example, a PinJoint has a longer Z than the other axes.

This is not currently implemented for all supported joint types. E.g. universal joints have equal-length axes. A robust implementation would handle this for all axes. Ideally, by creating a fake joint, perturbing it slightly, and seeing what effect that has on the parent-to-child relationship (e.g. if a coordinate seems to rotate it by some axis then it's probably an axis-aligned rotation).

Add ability to pause+resume simulation playback

Estimate: 2-5h

This could either be done in an OpenSim-agnostic software engineering way, by having the simulation thread sleep on a condition_variable shouldSleep type thing (so rebooting would be achieved by resetting the flag and re-waking the simulation thread). It could also be done in an OpenSim-specific way, by having the simulation save its latest (post-integration) state before collapsing the worker thread entirely (so rebooting would be achieved by restarting the simulation with the saved state as the initial state)


This was simplified to pausing/resuming the playback, which is easier than implementing an interruptable simulation (the sim will continue, but the playpack will pause).

Add support for copy + pasting vector values

Estimate: 1d (assuming it's fairly easy to implement an in-app clipboard abstraction)

It's been noticed in several UX sessions that it's kind of annoying to copy each vector component one-by-one between things in the mesh importer

At the moment, copying a Vec3 (for example) involves copying over each value one-at-a-time into another Vec3 field (e.g. to copy a property value around)

This might be implementable as a generic property-copying approach, maybe.

Make osc::Transform hierarchical

Estimate: 2-5h

The osc::Transform class is specifically designed for 3D rendering (as opposed to the SimTK::Transform, which is better-suited for accurate simulation transform encoding). A common feature in other transform classes (e.g. Unity's, here) is to have the ability to chain together transforms as part of a scene graph computation.

This is similar to chaining OpenSim::Frames, in that it's there for creating topologies, but the utility of an osc::Transform is that it's designed to have a lower memory footprint (10 floats vs. 12 doubles) and be trivially tween-able for when the UI decides to do things like tween between transforms.

Add support for automatically backing up editor state to non-volatile storage

Estimate: 3-5d (bulk of the work is in establishing temporary locations, expiring files, when to persist, etc.)

E.g. if the user is editing/making a model but hasn't saved in a while, it might be advantageous to save the model to some temporary location that, when the user reboots OSC, a popup comes up saying "oi, you have unsaved changes, what do you want to do about that?" or something along those lines.

The benefit of a feature like this is that it makes unhandle-able crashes (e.g. segfaults) a little less painful. At the moment, the system can only try to automatically recover from runtime exceptions.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.