View Full Version : How to script a button to appear on left margin??
Sure, I got a nice bunch of buttons in a subpalette. But I'd like to have the script automatically create them on the left margin area (or shelf if you prefer:) )right under the color picker, so my artists don't have to dig for them and move them manually.
01-12-06, 01:50 PM
You can do this by saving a custom UI configuration. Arrange your buttons how you want (Ctrl+drag them) and save the UI by pressing Preferences>Config>Save UI. You can then have a button of your plugin load the arrangement by using
(In the above example you'd need to make sure the cfg file was in the same folder as your plugin.)
Yeah, I thought about doing that, but then that would overwrite their own config, so I was hoping there was a more localized way to do it rather than enforce an entire interface layout:confused:
I still might just do it anyway.
I do not think it is possible. I am afraid they will have to do it manually.
You can simulate a CTRL + Click + Drag on an interface item through zscripting, but I have not been able to simulate the drag into any of the margin areas. I can only simulate a drag to the canvas.
Yes I know, it is a drag. ( Ahem )
Well thanks anyway guys, guess I'll just have to keep envying that Projection Master button up there in the top left margin for at least another version or two.
01-12-06, 02:01 PM
It wouldn't overwrite their configuration. It's a separate UI and all they'd have to do is press the Custom button to restore their default set up. Even if you could script it to place the buttons where you want you wouldn't know that there weren't already buttons in the same place already, so if they want them to be part of their default set up they'd have to move them themselves.
This was actually how I worked the Zketchpad plugin -- I created my own environment for it and then loaded that interface when the plugin is initialized. To return to your own interface you simply click the Custom button at the top of the ZBrush window.
There's a lot of potential for using environments in this way. I'm kind of surprised that more scripters haven't started doing it.
02-18-06, 05:16 PM
To take Matthew's suggestion a step further, have a look at the little script I posted a while back called ALTVIEW (http://www.zbrushcentral.com/zbc/showthread.php?t=30302), which lets you (or your crew) load any of six different layouts or views using the backslash key as a toggle. The source .txt file is included so you can adapt it however you want.
I still haven't seen where anyone one has applied ALTVIEW yet but for what you want to setup, it might be just the thing...
edit: didn't notice the original date on this post! Wondering how you solved it Cwess?
yeah, I kinda just let my guys have the scripts to get by in a pre-alpha stage, without the nice UI stuff I'd like. But I can also get some more feedback from them after they use it, and set the z stuff aside for now so I can concentrate on some maxscripts I need to do.
I really appreciate your help guys, when I get back to zscript, I'm going to look into your suggestions.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.