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

Solver UI - Adding Attributes with Connections Should Print Warning #199

Open
david-cattermole opened this issue Jan 14, 2021 · 5 comments
Labels
enhancement maya tool A user tool inside Maya. user interface Related to a User Interface (Maya or Qt)

Comments

@david-cattermole
Copy link
Owner

Problem

Attributes that have incoming connections are considered to be "locked" (uneditable) by the solver.

This could be slightly confusing to new users, and a warning message might be helpful.

Following on from #183, rigs with Character Sets will not solve in mmSolver and rather than just erroring at Solve time, it would be helpful to inform the artist and let them know of workarounds.

If this is to be implemented, it can be added to the Attributes "Add" button, for example here:
https://github.com/ktonegawa/mayaMatchMoveSolver/blob/f4e58de6b7ca7be50d2dbf1629483791ca0f0877/python/mmSolver/tools/solver/widget/attribute_widget.py#L298-L342

Expected behavior:
When a user selects a rig control attribute with an input connection, and tries to add it to the Solver UI Output Attributes, print a warning to tell the user that the attribute will not be used.

Actual behavior:
When a rig control that is connected to (for example) a Character Set is added to the UI, the Solver UI will error like so:

# Traceback (most recent call last):
#   File "C:\Users\Desktop02\Documents\maya\2019\modules\mayaMatchMoveSolver-0.3.11-maya2019-win64\python\mmSolver\tools\solver\widget\attribute_widget.py", line 331, in addClicked
#     lib_attr.add_attributes_to_collection(attr_list, col)
#   File "C:\Users\Desktop02\Documents\maya\2019\modules\mayaMatchMoveSolver-0.3.11-maya2019-win64\python\mmSolver\tools\solver\lib\attr.py", line 57, in add_attributes_to_collection
#     return col.add_attribute_list(attr_list)
#   File "C:\Users\Desktop02\Documents\maya\2019\modules\mayaMatchMoveSolver-0.3.11-maya2019-win64\python\mmSolver\_api\collection.py", line 627, in add_attribute_list
#     self._set.add_members(name_list)
#   File "C:\Users\Desktop02\Documents\maya\2019\modules\mayaMatchMoveSolver-0.3.11-maya2019-win64\python\mmSolver\_api\sethelper.py", line 121, in add_members
#     maya.cmds.sets(*name_list, edit=True, include=set_node, noWarnings=True)
# RuntimeError: Error while parsing arguments.
# 

Software Versions

  • mmSolver version: v0.3.x and v0.4.x
  • Maya version: All supported
  • Operating System (OS): All supported.
@ktonegawa
Copy link
Contributor

I cannot seem to recreate that behaviour when solving (at least with the latest working build of v0.3.11 for Maya 2019), is it possible for a rig to be provided to replicate this or is this an issue that occurs >v0.3.11?

@ktonegawa
Copy link
Contributor

adding as per conversation with David (error with the plugin v0.3.12 and newer on Maya 2019):

  • when trying to solve an attribute for a rig connected to a Character Set node:
# mmSolver.ui.base_maya_window : is the window dockable?: False #
# Traceback (most recent call last):
#   File "C:\Users\Desktop02\Documents\maya\2019\modules\mayaMatchMoveSolver-0.3.13-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.13-maya2019-win64\python\mmSolver\tools\solver\lib\collection.py", line 811, in run_solve_ui
#     info_fn=info_fn,
#   File "C:\Users\Desktop02\Documents\maya\2019\modules\mayaMatchMoveSolver-0.3.13-maya2019-win64\python\mmSolver\tools\solver\lib\collection.py", line 654, in execute_collection
#     info_fn=info_fn,
#   File "C:\Users\Desktop02\Documents\maya\2019\modules\mayaMatchMoveSolver-0.3.13-maya2019-win64\python\mmSolver\_api\execute.py", line 797, in execute
#     save_node_attrs = collectionutils.disconnect_animcurves(kwargs)
#   File "C:\Users\Desktop02\Documents\maya\2019\modules\mayaMatchMoveSolver-0.3.13-maya2019-win64\python\mmSolver\_api\collectionutils.py", line 115, in disconnect_animcurves
#     connObj = connPlug.node()
#   File "S:\Maya_2019_DI\build\Release\runTime\Python\Lib\site-packages\maya\OpenMaya.py", line 16234, in node
# RuntimeError: (kFailure): Object does not exist

@david-cattermole
Copy link
Owner Author

Hello @ktonegawa,

I think the rig that generated the original error was this one from the #183 issue.

I have tried to re-created the issue with mmSolver v0.3.14 on Maya 2019 (2019.3.1), but I do not get any error.

It's strange you are getting something different. I will share an example Maya scene using Mr. SuRuj.

@ktonegawa
Copy link
Contributor

Well either way, I would think that for something like this since the issue would come at solve time and not necessarily at run time, perhaps either a pop up box, or alternatively a little exclamation mark icon can be placed within the interface to give the user a more obvious warning than a printed line. Any thoughts on these ideas...?

@david-cattermole
Copy link
Owner Author

@ktonegawa that makes sense.

Perhaps a special check that is run each time the user runs a solve to check if the attributes are connected to a Character Set and then a pop-up is displayed to the user explaining they cannot solve the attributes directly and must use the tool in the menu "mmSolver > General Tools > Create Controller..." instead?

I'm not against such a check and warning, as long as it doesn't cause a performance issue.
I would argue that this is a very specialised use-case and I'm not sure how often Character Sets are used in production for rigs nowadays (personally, I've not seen any rigs using Character Sets in production).

@david-cattermole david-cattermole added enhancement user interface Related to a User Interface (Maya or Qt) labels Jan 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement maya tool A user tool inside Maya. user interface Related to a User Interface (Maya or Qt)
Projects
None yet
Development

No branches or pull requests

2 participants