I’m having a number of issues with the script I’m trying to build. Unfortunately I lack some clear documentation that would help me diagnosis the weirdness. So I’m getting a sense that Maya is doing some weird stuff and need to double check.
Basically I’m trying to avoid global variables and parallel arrays/matrixs. So I’m trying to track and adjust conditions by checking my UI through it’s own parameters. The intention is an alternative to the auto-keyframer: An UI that allows a user to select controls and attributes to track and then keyframe all in one button press/window. If you run the script as is the basic UI is set up and where I’m going with this.
The problem I’m running into is a lack of understanding of how Maya is treating window elements. For example I may have a frameLayout named
framenurbscurve1
. If I delete this frameLayout with deleteUI it removes the frame from my window but it still shows up as existing when I check with the -ex command.
Given that I want to use exist checks to make sure the object isn’t already in my manager this is an issue.
Another issue I ran into seems naming scheme related. I tried to build the names for frames using the long name node names. I had to change this to short names. Then I had to change the order of my name building.
// $sel[] is the array of results from a selection grab using `ls -sl -l` for long names.
//$selNice[] is the array of results from a selection grab using `ls -sl -sn` for short names.
//$obj is current position/object in the loop.
//$arrayPlacement is a simple variable to track current loop iteration so I can use short names.
//Iterations as described above are listed one by one below.
frameLayout -label $obj -collapsable true -bs "in" -collapse true ($obj+"Frame");
frameLayout -label $obj -collapsable true -bs "in" -collapse true ("$ selNice[$arrayPlacement]+"Frame");
frameLayout -label $obj -collapsable true -bs "in" -collapse true ("frame" +$ selNice[$arrayPlacement]);
So “|nurbsCone1Frame” to “nurbsCone1Frame” to “framenurbsCone1”. I believe it was a nurbsSphere that was returning as if the frame existed before I made it.
Also everything breaks when I add a scrollLayer to get a scrollbar and I’m not sure why.
So what do I get?
I get that there is the label and the name for a UI element. I get that I can tell Maya what to name a UI element. I could also allow Maya to name the new UI element and store the name in a variable to call later.
What don’t I get?
Is deleteUI only removing the frame from my window? What’s the lifespan of window UI elements? Not comprehensively knowledgeable about Maya’s own naming schemes. Having some trouble absorbing the way the UI is being executed and built. It seems to mantain a position in the window and new UI elements are put there?
I wanted to avoid sharing my current code but I suppose it’ll be needed. (I did intend to post the finished script here as thanks for the previous help.) I’ll put the current code in a second post after this one.
Any links to good information on building mel UI is useful. I’ve of course been looking at the reference library and a few tutorials that go into the basics. What I really need is insight in the way the logic is flowing behind the commands.