Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add UI tooling for editing muscle curves (e.g. ForceVelocityCurve) #836

Open
mrrezaie opened this issue Apr 7, 2024 · 3 comments
Open

Comments

@mrrezaie
Copy link

mrrezaie commented Apr 7, 2024

Hi,

First of all, thank you so much for developing such an amazing software.

In Properties window, I couldn't find a way to change the properties of muscle curves such as ActiveForceLengthCurve and others in a model with Millard2012EquilibriumMuscle, e.g., Rajagopal. I was wondering if this feature is available.
image

OC 0.5.8

Thank you.

@adamkewley
Copy link
Collaborator

Hi @mrrezaie , thanks for your praise!

The curves aren't currently edit-able in the UI because it seemed likely that it would require a custom UI (e.g. to select function shape, place spline points, change params, etc.), but it's something that's obviously a UX gap that we need to bridge with a custom UI eventually 😉

For now, unfortunately, the best that you can do in OSC 0.5.8 (or newer) is to open the osim in OSC and then edit the curves in raw XML (perhaps I should at least provide a raw XML editor in-UI for stuff like this, but that's another feature :-))

@mrrezaie
Copy link
Author

mrrezaie commented Apr 9, 2024

I appreciate the time and endeavor you put on this.

@adamkewley adamkewley changed the title Change the properties of muscle curves Add UI tooling for editing muscle curves (e.g. ForceVelocityCurve) May 3, 2024
@adamkewley
Copy link
Collaborator

The main branch now contains the ability to visualize OpenSim::Functions in the specific case of when they are direct properties of a component in the model (i.e. it isn't generic enough to crawl through the various internals of CustomJoint, yet, to fish out the Function).

What this practically means is that components like MillardEquilibriumMuscle2018 will now show an eye icon for Function properties:

image

And if you click that icon, a popup will appear that--because it doesn't know what it's plotting (it just "sees" a Function) will default to plotting 100 datapoints between -1.0 and 1.0 in X. The user can edit the number of data points and the data range:

image

The plot is automatically updated if the model file is externally changed, which means that you can open this popup and, separately, edit the XML that's behind that component (e.g. search recfem_r in the osim file and find the parameters behind the ActiveForceLengthCurve).

Current limitations:

  • Currently spawns a modal popup, which blocks the rest of the UI. This should become a panel that the user can dock somewhere (e.g. like the live muscle plotting that's available by right-clicking a muscle)
  • The historical curves aren't shown etc. because this plotting widget is separate from the live muscle plotting one
  • (the above are to say, "we really ought to centralize model plotting to behave the same as live muscle plotting")
  • There is no way to edit the function properties yet, because the Properties editor in OpenSim Creator only goes one step deep. The "hack" around this is to either open the osim in a text editor, or open it in OpenSim GUI and edit the property there. Saving the model in OpenSim GUI should trigger OSC to reload it and show you the new curve.

Not exactly what your'e asking for @mrrezaie , but it might be useful either way!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants