Script to keep dialog box from resetting on exit

Script to keep dialog box from resetting on exit

Anonymous
Not applicable
1,848 Views
6 Replies
Message 1 of 7

Script to keep dialog box from resetting on exit

Anonymous
Not applicable

Hi! I've tried searching for this and don't see anything on it, so if I've missed it I apologize. It's an annoying little problem that maybe one of you could help me fix?

 

I just installed Max 2019. I have some art tools that I use that were written several years ago by someone at my company that is way smarter than me when it comes to this stuff, and in prior versions the little dialog boxes for my art tools would stay where I put them when I exited the program. I generally kept them docked at the bottom next to the time slider. However, with 2019 they don't stay put. They reset on exit and when I re-open Max they take up half the screen. The files are in the startup folder in the location: AppData\Local\3ds Max\2019 - 64bit\ENU\scripts\startup, so they run when I start Max. I can move them back next to the time slider, but it's really pretty annoying. Is there some way I could update the script to tell them to stay docked at the bottom next to the time slider? They have the command "cui.DockDialogBar ArtTools #cui_dock_Bottom" but this just puts them above the time slider and like I said, they take up half the screen. I only know enough about scripting to be dangerous LOL Please help! Thank you so much!

0 Likes
1,849 Views
6 Replies
Replies (6)
Message 2 of 7

Swordslayer
Advisor
Advisor

If you put them in the startup folder, they will exist only after the UI was already loaded. If you want them to keep their docked state, you can try moving them to either stdplugs\stdscripts folder or into the plugins folder, both in the root 3ds max directory.

0 Likes
Message 3 of 7

Anonymous
Not applicable

Thanks! That worked to put them next to the time slider, but they take up a lot of real estate, and I'm not sure why. They squeeze the time slider over to the right. There's code in the script to define their size, but it doesn't seem to be working as a default display. I can scale them down, but when restarting they are back to taking up more than half the time slider area when they aren't that big. Most of it is blank space. The code is "CreateDialog ArtTools 266 20" Is there something else to do to make them smaller? I tried locking the UI but that didn't do it. Thanks again!

0 Likes
Message 4 of 7

Swordslayer
Advisor
Advisor
Message 5 of 7

ads_royje
Alumni
Alumni

Hi @Anonymous 

 

Would you mind trying to remove the size of the createDialog ?

CreateDialog ArtTools

instead of

"CreateDialog ArtTools 266 20"


if that does not work, as @Swordslayer suggests, some sample, a screenshot, can help! 🙂

0 Likes
Message 6 of 7

Anonymous
Not applicable

Sorry for the delay, so busy lately - Thank you for your responses, but that didn't change anything. I did try docking it at the top and that helped some as it's out of the way now, but I do wonder why it's not sticking to the 266 width that it's supposed to be. Never had a problem in a prior version. Here's what it looks like if I adjust it (left picture), and then if I reopen Max, it's back how it was (right picture). Again, much improved over docking it at the bottom, it took up half the screen. The tools were about ten times the height they are supposed to be and were all the way across. If docked with the time slider, they take up half the real estate of the time slider. With them at the top, they are much less obtrusive for animation as there's extra room with the modeling bar and I don't use it much, whereas I use the time slider a lot. Interestingly enough, when adjusting it, the amount you can adjust it does respect that 266 pixel width - but Max forgets it when you close out.

 

How it should look.pngToo much space.png

 

 

 

 

 

As an aside, these were written a really, really long time ago, probably for Max 8 LOL and so I actually really only use one of them, as most of the rest I think are for an engine we don't even use any more, is there any way to add a 'script as a button' like in Maya? In Maya you just drag the MEL command into any of the tool bars at the top of the UI, but that doesn't work in Max afaik. I could just have a single button for one of the scripts and that would suit what I need, if there's some way to do that?

 

 

Message 7 of 7

Swordslayer
Advisor
Advisor

@Anonymous wrote:

As an aside, these were written a really, really long time ago, probably for Max 8 LOL and so I actually really only use one of them, as most of the rest I think are for an engine we don't even use any more, is there any way to add a 'script as a button' like in Maya? In Maya you just drag the MEL command into any of the tool bars at the top of the UI, but that doesn't work in Max afaik. I could just have a single button for one of the scripts and that would suit what I need, if there's some way to do that?


Works the same way in max, you can select just that part of the script text and drag it to any toolbar and a new button will be created for it - it will work provided that the code snippet works on its own. If there're any variables or references to other parts of the code and you can attach the code here, I can have a look, too.

0 Likes