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

feat: measure panel #170

Merged

Conversation

maryam-fatima
Copy link

@maryam-fatima maryam-fatima commented Jan 17, 2024

Description

  • Added a new property in Model named metric for system selection. Added code to get the current measurement of the various measurement targets based on vertices list and display them for measure related inputs in UI.
  • Added code to read the measure targets data and cache it in dictionaries for min/max calculation, used lru_cache.
  • Added code to update the key value in the target stack given the new value in real world measurement, took inspiration from MakeHuman source code. Although this ensures that values don't cross the real world measurements range, occasionally doesn't work and needs to be run twice.

Issues to be addressed:

  • the logic of calculating the min/max using target data with current verts position doesn't work in most cases, if I didn't make a mistake in implementation.
    • It only works if one of the opposite shape keys is 1 or close to 1.
Screenshot 2024-01-17 at 6 27 29 PM Screenshot 2024-01-17 at 6 30 04 PM
  • stategy for updating slider min-max to use target's min-max range.
  • slow UI due to measures being calculated in get_measure_target at each draw.
  • occasional divergence in algorithm used in set_measure_target which disappears when same call is made again.
Screenshot 2024-01-17 at 6 31 08 PM Screenshot 2024-01-17 at 6 31 40 PM
  • Inputs for the measure panel targets cannot be set through terminal as apparently the name is not a valid modifier. I tried converting it to a valid modifier but got another error that property of the [new name] is not defined.
Screenshot 2024-01-17 at 6 22 29 PM

Issue #168

Added a new property in Model named metric for system selection.
Added code to get the current measurement of the various measurement
targets based on vertices list and display them for measure related
inputs in UI.
Added code to read the measure targets data and cache it in dictionaries
for min/max calculation, used lru_cache.
Added code to update the key value in the target stack given the new
value in real world measurement, took inspiration from MakeHuman source code.
Although this ensures that values don't cross the real world measurements range,
occasionally doesn't work and needs to be run twice.

Issues to be addressed:
- the logic of calculating the min/max using target data with current
verts position doesn't work in most cases, if I didn't make a mistake in implementation.
- stategy for updating slider min-max to use target's min-max range.
- slow UI due to measures being calculated in get_measure_target at each draw.
- occasional divergence in algorithm used in set_measure_target which
disappears when same call is made again.
@joepal1976
Copy link
Contributor

Thanks. I've taken a look at this, and it looks like a promising start. As blender4_measure is an experimental feature branch, I'm going to merge your PR to it as is.

As you note, the draw cycle performance is an issue. On my high end machine, each draw cycle takes approx 250ms, which is way too much as it makes the entire UI feel sluggish. My guess is that it will be hard to trim this significantly if doing a complete recalculation each time, and that some caching mechanism need to be added.

I'll see if I can think up an efficient way for fingerprinting the target stack to determine if things have changed or if a cached value could be used.

I'll keep digging in the things listed in the description of your PR above and see if I can come up with further suggestions.

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

Successfully merging this pull request may close these issues.

2 participants