How to Check if Window Exists with Mel and Python in Maya

미연

·

2022. 3. 28. 12:19

The most effective method to check in the event that window exists with Mel and Python in Maya. Thus, returning to the model here, where, how about we utilize this rendition, so it's in Mel window, stature, these qualities titles were chosen, and I press enter with the numeric keypad on your console, not the normal enter, it will make that window currently says my helpful window since that is the name I put in the title. Presently the issue is, on the off chance that I erase this top word, the here, so assuming I select it again and press enter, you will get a mistake. Since I named this window my window, it doesn't must have quotes when you use Mel, however it will say object name isn't exceptional. Assuming the window as of now exists, it won't, you can't make another one. So now and then you should refresh it, or to stay away from that issue like assuming the windows exists, erased and made once more. So to check assuming a window exists, where you could do in Mel, go to Window. And afterward we'll see how about we go to the Help window and press enter on the numeric keypad.If I look up, you ought to see there's an exist banner here. Either utilize the long name rendition or the x simply the short name. So here utilizing the greeting and I could utilize, I could do run exists. Also, I need to provide it with the name of the window. So I named it that.And assuming I select this, and press enter, one method valid. There's one method valid. Furthermore, in the event that it doesn't exist, assuming I close this will erase it in memory. So on the off chance that I run a similar order is ought to run, you ought to zero mean bogus. So how you need to manage this, so assuming that I select this, I'm simply going to press Enter on my standard console, not the mathematical. Also, very much like is skirt the line. In the event that I will make you could do assuming explanations and Mel and I run this order, presently the take read free of a semicolon. Presently, and this is specific to Mel, not Python, for this order to work will return valid or misleading. However, to get the return and Mel, you need to utilize the tilde key, or the T the tilde character, which is an American console on the top over the tab, you're left on the left half of your console. So or the left of the one button. It resembles a solitary citation, however it's anything but a solitary citation is tilde. Furthermore, you put it here too. So you wrapped is the execute that and the Telesco to catch the return. Furthermore, you could involve it in the F. So since it's valid or bogus, you don't need to say rises to rises to valid. Assuming it's valid, assuming that will comprehend that is valid. Assuming it's bogus, you will comprehend that it's misleading. So you're essentially saying assuming that this is valid, on the grounds that you didn't say rises to approaches valid. As a matter of course, it implies assuming that this is valid, you could utilize statements, you could utilize the supports here, the squiggly line sections. Furthermore, there's one more male order called error.And you could place in quotations.And I could simply say no, me composed this, I can say stop.So window exists.All right. So the thing is, the window doesn't exist right now since I close it. So assuming I ran this nothing ought to occur in the event that I select it, and press the Enter key on my numeric keypad. It read nothing. All things considered, it just printed it over here yet you ought to didn't see a mistake down here so it didn't do anything.So nowif I return and really make the noticeable window with that equivalent nameit has set up there once more, I select it and press the Enter key on the numeric keypad. Presently assuming I select this square of code to see the F and press enter on the numeric keypad, presently you get the mistake saying sup the window exists in light of the fact that the window really exists this order return valid and utilize the tilde.Not the single citation is a tilde which is over the tab on your left side on American console or on the left half of the one button or right beneath the getaway. It returned valid And the order blunder really makes a mistake, print out in red and Maya. Also, I'm simply going to close this. So presently assuming I run this once more, I'll simply move in the viewport to reset it, and press enter on the numeric keypad, it doesn't appear. Just to show you going through the other code here, it's like my message up here to make the window however there's no apparent isn't on, there's no noticeable banner. So essentially, it will make the window inside memory, just to show you that so assuming I made, you don't see a window. However, assuming I ran, this will let me know a mistake since that this window exists. Furthermore, I can run this show window with the name of the window to show that it really exists here. So to do the comparable in Python to go to Python here. I will essentially make this window and make it apparent utilizing the Python variant. So the orders the name of the window, the name, all things considered, the window order, the name of the window is the principal contention with citations. And afterward catchphrase, watchword contentions set of you know, you have this is a rundown, this is a string, you so comma isolated. Furthermore, assuming it approaches a genuine noticeable is valid rather than odd. Since it's a Boolean, on the off chance that you press enter the numeric keypad, it makes the window. What's more, to actually look at it to check whether that window exists. What you could do under here, as can compose c min DS window. So I'm calling the milkman window, and I want to realize you need to pass the name of the window first. This is the name of the window object here. So then,I duplicate that I put it in here. What's more, I need to utilize the fly exists. So you say exists. Furthermore, assuming say valid. So recollect in Mel, when you use exists, with next to no contentions a while later, it implies valid. Here, returning to the Python, windows, the name of the window exists approaches valid. Assuming I select this and press enter, very to catch. I'll put an outcome. And afterward I'll choose this as enter. And afterward assuming I double tap this and press enter on the numeric keypad, you'll let me know genuine in light of the fact that that window exists. So essentially, in Python, that is the way you catch the outcomes, you could pass it into another variable.Now on the off chance that I close that window, and run it, press enter on the numeric keypad and afterward, press Enter.Select the variable outcome and press enter a numeric keypad presently says misleading on the grounds that the window doesn't exist any longer. Furthermore, that is the way you do it in Python.Thank you for watching. Make sure to like, remark, buy in, and hit the warning chime