Program a boolean attribute to set an object to a specified position

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, first time on the forums.
I'm in a 3D animation course at college and I'm currently working on a rigging assignment. I want the pivots of certain control objects to be oriented a specific way, just to make rotating the parented objects a bit easier. However realized rather quickly that freezing the controls resets the orientation of the pivot, and conversely baking the pivot back to the desired orientation returns the transform values of the object back to its relative position in the scene (not sure if that really makes sense, but I don't know how else to word it).
I've already attempted a tactic I found elsewhere where you put the desired control within a group, but I couldn't quite get it to work. So I came up with an idea to use a boolean attribute to toggle the controls back into place. I did manage to program an expression that will translate and rotate the object to the position I want it at. However, I can't figure out how to get the attributes to accept user input again after the boolean is toggled off, as it just remains locked into place otherwise.
I have asked my instructor about it, but he seemed to imply it was very difficult to do and I was and told me to not to worry about it. I'm curious, though. Exactly what would I have to do in order to get this to work?
Here's the code that I'm trying to use to do this:
I'm currently using the 2019 student version of Maya.
Any help is appreciated. Thanks!