david-cattermole / mayaMatchMoveSolver

A Bundle Adjustment solver for MatchMove related tasks.
https://david-cattermole.github.io/mayaMatchMoveSolver/
Other
101 stars 29 forks source link

Maya Tool - Convert to Marker - Bake Bundle to original 3D transform #227

Closed david-cattermole closed 2 years ago

david-cattermole commented 2 years ago

Feature

I have animated locators, from markers on a volumetric scan of an actor's face and headset.

I used Convert To Marker on the locators and they were converted to Bundles and Markers. But the translation of the original locators wasn't copied over to the Bundles, so I had to temporarily Point Constraint the Bundles to each individual locator. It wasn't automatic, the Bundles defaulted to the origin and then I used the mmSolver tool to snap them in screenZ to the Markers.

Instead, it would be nice to have an option to bake the Bundle position in world-space to the original input 3D transform.

Steps to Reproduce

  1. Create locator and animated it.
  2. Select locator and run "Convert to Marker" tool.

The newly created Marker and Bundle should match the locator in world-space (Bundle) and screen-space (Marker). Currently only the Marker is matched.

Software Versions

david-cattermole commented 2 years ago

The Convert to Marker tool has been updated to include this functionality.

Right now the tool does not provide a GUI, for final release it should.

The default behaviour of the tool has not changed. Users can run the tool with changed behaviour with the following Python code run from a shelf button.

import mmSolver.tools.convertmarker.tool as tool
tool.main(
    bundle_position_mode=tool.BUNDLE_POSITION_MODE_SOURCE,
    delete_static_anim_curves=True)

For users wanting to test this code before the v0.3.15 release, you can replace the file from v0.3.14 with this: https://raw.githubusercontent.com/david-cattermole/mayaMatchMoveSolver/ee0f8294491897f29f862e557061a9d6dc0c5749/python/mmSolver/tools/convertmarker/tool.py

This file should be added into python/mmSolver/tools/convertmarker/, replacing the existing tool.py file. As usual, back up your files.

david-cattermole commented 2 years ago

The reporting user has reported this tool is working as expected but may require more testing.

A UI is planned for this new option of the tool. The UI should remember the previously used values of the UI options. This UI may replace the existing "Convert to Marker" shelf button so that users can explicitly choose the option.

This feature is planned for release in v0.3.15.

David

MichaelKarp commented 2 years ago

This new Convert To Marker code works correctly. The resulting Bundles are now animated in the world space of the original locator.

Another possibility is to have the animated Bundles be the default behavior, so the Bundles aren't initially at the origin. But this method would create extra work for some artists., who would need to delete animation and them place their static bundles using a different method, like raycast onto polygon.

david-cattermole commented 2 years ago

I have added a GUI for this tool that allows users to change:

Additionally, since I do not expect this tool is commonly used, I have removed the tool from the default Maya "mmSolver" shelf. Instead, users can access the tool from the Marker Tools menu on the shelf or the mmSolver menu; "mmSolver > Marker Tools > Convert to Marker...".

This GUI will store the last used options, and reload them when the GUI is opened again.

This tool will be released in v0.3.15.