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

Current Frame solve erroring in Maya 2019 #232

Closed
ktonegawa opened this issue Jan 1, 2022 · 10 comments
Closed

Current Frame solve erroring in Maya 2019 #232

ktonegawa opened this issue Jan 1, 2022 · 10 comments
Assignees
Labels
bug core solver Related to the low-level solver functions.
Milestone

Comments

@ktonegawa
Copy link
Contributor

Problem or Feature

Submitting as per recommendation from David. Feel free to disregard if its a non-issue.

When trying to solve a simple bundle with the "current frame" mode in any of the solvers in versions of the mmSolver plugin v0.3.12 and newer we get an error.

Expected behavior:
regular solve on current frame

Actual behavior:
errors with:

# Traceback (most recent call last):
#   File "C:\Users\Desktop02\Documents\maya\2019\modules\mayaMatchMoveSolver-0.3.15-maya2019-win64\python\mmSolver\tools\solver\ui\solver_window.py", line 696, in apply
#     self)
#   File "C:\Users\Desktop02\Documents\maya\2019\modules\mayaMatchMoveSolver-0.3.15-maya2019-win64\python\mmSolver\tools\solver\lib\collection.py", line 810, in run_solve_ui
#     info_fn=info_fn,
#   File "C:\Users\Desktop02\Documents\maya\2019\modules\mayaMatchMoveSolver-0.3.15-maya2019-win64\python\mmSolver\tools\solver\lib\collection.py", line 653, in execute_collection
#     info_fn=info_fn,
#   File "C:\Users\Desktop02\Documents\maya\2019\modules\mayaMatchMoveSolver-0.3.15-maya2019-win64\python\mmSolver\_api\execute.py", line 727, in execute
#     status_fn=status_fn
#   File "C:\Users\Desktop02\Documents\maya\2019\modules\mayaMatchMoveSolver-0.3.15-maya2019-win64\python\mmSolver\_api\compile.py", line 794, in collection_compile
#     withtest=withtest):
#   File "C:\Users\Desktop02\Documents\maya\2019\modules\mayaMatchMoveSolver-0.3.15-maya2019-win64\python\mmSolver\_api\solverstandard.py", line 1371, in compile
#     for action, vaction in generator:
#   File "C:\Users\Desktop02\Documents\maya\2019\modules\mayaMatchMoveSolver-0.3.15-maya2019-win64\python\mmSolver\_api\solverstandard.py", line 813, in _compile_single_frame
#     sol.set_remove_unused_markers(remove_unused_objects)
#   File "C:\Users\Desktop02\Documents\maya\2019\modules\mayaMatchMoveSolver-0.3.15-maya2019-win64\python\mmSolver\_api\solverstep.py", line 294, in set_remove_unused_markers
#     assert isinstance(value, (bool, int))
# AssertionError

Steps to Reproduce

  1. [First Step]
  2. [Second Step]
  3. [and so on...]

Software Versions

  • mmSolver version: v0.3.12 and newer

  • Maya version:
    2019

Operating System: Microsoft Windows 7 Business Edition, 64-bit Windows 7 Service Pack 1 (Build 7601)

Cut ID: 201905131615-158f5352ad
Maya Version: Autodesk Maya 2019.1
Maya API: 20190100
Qt Version: 5.6.1
Compositing Manager: True
Window Manager: Windows Aero
GPU: Version : 2016.11.44.12. Feature Level 5.
Adapter : GeForce GTX 560 Ti/PCIe/SSE2
Vendor ID: 4318. Device ID : 4608
Driver : nvoglv64.dll:23.21.13.9135.
API : OpenGL V.4.6.
Max texture size : 16384 * 16384.
Max tex coords : 32
Shader versions supported (Vertex: 5, Geometry: 5, Pixel 5).
Shader compiler profile : (Best card profile)
Active stereo support available : 0
GPU Memory Limit : 1024 MB.
CPU Memory Limit: 31107 MB.
-->

  • Operating System (OS): Windows 7
@david-cattermole
Copy link
Owner

It was also mentioned that this was using the develop_v0.3.x branch.

This shouldn't be happening... initially I'm not sure what could be wrong.
I'll do some tests with the latest develop_v0.3.x branch.

@ktonegawa
Copy link
Contributor Author

ktonegawa commented Jan 2, 2022

an additional note: I did create a quick scene from scratch (since the scene i was getting this error on was created with i believe v0.3.11) to create a collection from the latest v0.3.15 (compiled from source) to see what happens and what is interesting is that in this scene it does not error on a "Current frame" solve but rather it just does not solve in general, and gives this output:

// Warning: mmSolver._api.solverstep : No Attributes found! //
// mmSolver.tools.solver.lib.collection : Total Time: 0.118 seconds //
// mmSolver.tools.solver.lib.collection : Max Frame Deviation: -0.00 pixels at frame None //
// mmSolver.tools.solver.lib.collection : Average Deviation: 0.00 pixels //
// Warning: mmSolver.tools.solver.lib.collection : 2022-01-02 11:51:43 | Solved | Average Deviation 0.00px | Max Deviation -0.00px at None | Time 0.118sec //

@david-cattermole
Copy link
Owner

Hello @ktonegawa,

I have a feeling the issue you're having is related to #222. I added a feature to automatically detect and determine the relationships between the Markers and Attributes. Unfortunately there was a bug that caused the feature to never be turned off once it was enabled (using the "Object Relationships" check box) for a Collection.

I suspect that if you delete the Collection in your original scene (created in v0.3.11) and re-create a new one with v0.3.15 then it will produce Warning: mmSolver._api.solverstep : No Attributes found!.

The fact that no attributes can be found can be caused by a few reasons:

  1. You're using the "Basic" solver tab with only static attributes - "Basic" tab will only solve keyed animated attributes.
  2. If the user preference "Allow Object Relationships" is "Yes" and the Solver UI's "Evaluate Object Relationships" check box is enabled and your scene is using custom nodes or weird/unsupported connections or very complex node setups then the feature may not be able correctly find the object relationships and will filter all attributes and produce the warning you see.

I think the reason 1 is more likely.

I have attached a screenshot (taken in an experimental branch - so you won't have the "Scene Graph" option) showing the "Evaluate Object Relationships" and the preferences option too:
image

@ktonegawa
Copy link
Contributor Author

Hi @david-cattermole, i just tried out some more things and i have confirmed that even in the "Standard" solver tab the "Current Frame" mode does not work and once again gives this error:

# Traceback (most recent call last):
#   File "C:\Users\Desktop02\Documents\maya\2019\modules\mayaMatchMoveSolver-0.3.15-maya2019-win64\python\mmSolver\tools\solver\ui\solver_window.py", line 696, in apply
#     self)
#   File "C:\Users\Desktop02\Documents\maya\2019\modules\mayaMatchMoveSolver-0.3.15-maya2019-win64\python\mmSolver\tools\solver\lib\collection.py", line 810, in run_solve_ui
#     info_fn=info_fn,
#   File "C:\Users\Desktop02\Documents\maya\2019\modules\mayaMatchMoveSolver-0.3.15-maya2019-win64\python\mmSolver\tools\solver\lib\collection.py", line 653, in execute_collection
#     info_fn=info_fn,
#   File "C:\Users\Desktop02\Documents\maya\2019\modules\mayaMatchMoveSolver-0.3.15-maya2019-win64\python\mmSolver\_api\execute.py", line 727, in execute
#     status_fn=status_fn
#   File "C:\Users\Desktop02\Documents\maya\2019\modules\mayaMatchMoveSolver-0.3.15-maya2019-win64\python\mmSolver\_api\compile.py", line 794, in collection_compile
#     withtest=withtest):
#   File "C:\Users\Desktop02\Documents\maya\2019\modules\mayaMatchMoveSolver-0.3.15-maya2019-win64\python\mmSolver\_api\solverstandard.py", line 1371, in compile
#     for action, vaction in generator:
#   File "C:\Users\Desktop02\Documents\maya\2019\modules\mayaMatchMoveSolver-0.3.15-maya2019-win64\python\mmSolver\_api\solverstandard.py", line 813, in _compile_single_frame
#     sol.set_remove_unused_markers(remove_unused_objects)
#   File "C:\Users\Desktop02\Documents\maya\2019\modules\mayaMatchMoveSolver-0.3.15-maya2019-win64\python\mmSolver\_api\solverstep.py", line 294, in set_remove_unused_markers
#     assert isinstance(value, (bool, int))
# AssertionError

I then tested the "Legacy" tab and tried to set the frame range to 1-1, which actually did seem to solve the bundle correctly.

So is the "Current Frame" option also in theory not supposed to work in "Standard" mode as well? If so perhaps these options should be removed from "Basic" and "Standard" tabs to avoid confusion...?

@david-cattermole
Copy link
Owner

I'll dig deeper into this issue.

So is the "Current Frame" option also in theory not supposed to work in "Standard" mode as well? If so perhaps these options should be removed from "Basic" and "Standard" tabs to avoid confusion...?

"Current Frame" should work in the Standard and Basic tabs - if it's broken it should be fixed.

@david-cattermole
Copy link
Owner

@ktonegawa I can confirm using your test scenes I can reproduce the same error in the latest v0.3.15, in both Basic and Standard tabs.

The steps for reproducing the problem are:

  1. Create a new scene.
  2. Create a camera.
  3. Add a marker (with a bundle created too)
  4. Open the Solver UI
  5. Add the marker to the Input objects.
  6. Add the bundle translate X and Y attributes to the Output Attributes.
    • The bundle attributes can be keyed or not.
  7. Change Solver UI tab to "Standard".
  8. Change the "Frames" option to "Current Frame".
  9. Press Solver UI "Solve" button.

The same error will occur with the "Basic" tab if the bundle's attributes are keyed. The reason the "No Attributes found!" warning was displayed in the Basic tab is because the attributes are Static and therefore ignored. Using the Standard solver stops the solver from filtering the static attributes and therefore producing the same error.

I will look into this problem and create a fix for the v0.3.15 release milestone.

The following error will be displayed:

# Traceback (most recent call last):
#   File "C:\Users\username\Documents\maya\2019\modules\mayaMatchMoveSolver-0.3.15-maya2019-win64\python\mmSolver\tools\solver\ui\solver_window.py", line 696, in apply
#     self)
#   File "C:\Users\username\Documents\maya\2019\modules\mayaMatchMoveSolver-0.3.15-maya2019-win64\python\mmSolver\tools\solver\lib\collection.py", line 810, in run_solve_ui
#     info_fn=info_fn,
#   File "C:\Users\username\Documents\maya\2019\modules\mayaMatchMoveSolver-0.3.15-maya2019-win64\python\mmSolver\tools\solver\lib\collection.py", line 653, in execute_collection
#     info_fn=info_fn,
#   File "C:\Users\username\Documents\maya\2019\modules\mayaMatchMoveSolver-0.3.15-maya2019-win64\python\mmSolver\_api\execute.py", line 727, in execute
#     status_fn=status_fn
#   File "C:\Users\username\Documents\maya\2019\modules\mayaMatchMoveSolver-0.3.15-maya2019-win64\python\mmSolver\_api\compile.py", line 794, in collection_compile
#     withtest=withtest):
#   File "C:\Users\username\Documents\maya\2019\modules\mayaMatchMoveSolver-0.3.15-maya2019-win64\python\mmSolver\_api\solverstandard.py", line 1371, in compile
#     for action, vaction in generator:
#   File "C:\Users\username\Documents\maya\2019\modules\mayaMatchMoveSolver-0.3.15-maya2019-win64\python\mmSolver\_api\solverstandard.py", line 813, in _compile_single_frame
#     sol.set_remove_unused_markers(remove_unused_objects)
#   File "C:\Users\username\Documents\maya\2019\modules\mayaMatchMoveSolver-0.3.15-maya2019-win64\python\mmSolver\_api\solverstep.py", line 294, in set_remove_unused_markers
#     assert isinstance(value, (bool, int))
# AssertionError

Thanks for reporting this @ktonegawa!

@david-cattermole david-cattermole added this to the v0.3.15 milestone Jan 3, 2022
@david-cattermole david-cattermole added the core solver Related to the low-level solver functions. label Jan 3, 2022
david-cattermole added a commit that referenced this issue Jan 3, 2022
…rame()

I have incorrectly passed the arguments to the function creating the
"single frame solver" recipe. This created a silent error where the
"precomputed data" (a `dict`) was passed to the
`remove_unused_objects` argument which then asserted the wrong type.

I have added more type asserts to mitigate type of problem, in this
file.

Issue #232
@david-cattermole
Copy link
Owner

I see the bug now. I have incorrectly passed the arguments to the function creating the "single frame solver" recipe. This created a silent error where the "precomputed data" (a dict) was passed to the remove_unused_objects argument which then asserted the wrong type.

The moral of the bug is that I should have added asserts to the mmSolver._api.solverstandard._compile_single_frame() function confirming the types of each argument.

Although this bug started in the Standard solver tab, I think the data on the Collection became corrupted somehow, which caused the Basic solver tab to also produce the same error.

I actually found this bug yesterday and fixed it in another branch; 2c7d6c9 as part of #114 (to be part of the v0.4.0 release)

I have ported this fix over to the develop_v0.3.x in 5a39fa0, and also added more assert statements to try to stop this same problem from happening again.

@ktonegawa can you pull the latest commit and confirm this is now working for you?

This fix will be part of the v0.3.15 release.

david-cattermole added a commit that referenced this issue Jan 3, 2022
…tations

Add fix from #232, adds more assert statements for function argument types.

# Conflicts:
#	python/mmSolver/_api/solverstandard.py
@ktonegawa
Copy link
Contributor Author

I just compiled the latest changes and here are the test results:

########## Basic Tab Current Frame mode ##########
// Warning: mmSolver._api.solverstep : No Attributes found! // 
// mmSolver.tools.solver.lib.collection : Total Time: 0.112 seconds // 
// mmSolver.tools.solver.lib.collection : Max Frame Deviation: -0.00 pixels at frame None // 
// mmSolver.tools.solver.lib.collection : Average Deviation: 0.00 pixels // 
// Warning: mmSolver.tools.solver.lib.collection : 2022-01-02 22:40:02 | Solved | Average Deviation 0.00px | Max Deviation -0.00px at None | Time 0.112sec // 

########## Standard Tab Current Frame mode ##########
# Warning: No plugs or nodes selected. Nothing to do. # 
// mmSolver.tools.solver.lib.collection : Total Time: 0.123 seconds // 
// mmSolver.tools.solver.lib.collection : Max Frame Deviation: 57.73 pixels at frame 120 // 
// mmSolver.tools.solver.lib.collection : Average Deviation: 57.73 pixels // 
// Warning: mmSolver.tools.solver.lib.collection : 2022-01-02 22:39:15 | Solved | Average Deviation 57.73px | Max Deviation 57.73px at 120 | Time 0.123sec // 

So it seems to snap fine in Standard but not Basic (which seems to be in line with what you described).

Is this the result you are expecting?

@david-cattermole
Copy link
Owner

Yes, this seems like it's working correctly! This is now fixed and working as I expect.

@ktonegawa
Copy link
Contributor Author

ktonegawa commented Jan 3, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug core solver Related to the low-level solver functions.
Projects
None yet
Development

No branches or pull requests

2 participants