View Full Version : Keyboard stuff
Wahooney 11-04-2004, 12:04 PM I want to write a plugin where you press a quick key, ie. Ctrl-B, enter a value (100) and the Paint Selection Brush size is set to that value, all without creating dialogs etc., I've done it like this.
maxOps.paintSelBrushSize = getKBLine() as integer
but the bugger is that it opens up the listener window...
Is there a way around this?
What other methods are there for polling the keyboard?
Thanks.
|
|
galagast
11-04-2004, 12:48 PM
hmm.. im not that good with maxscript, but can i make some suggestions? though i cant really assure u if its possible in max..
create a macroscript with a getkbkline, and something that checks whether you've pressed the ENTER key.. thus store the value to a variable which sends it to the brush size...
or create a When script, that looks at the change in a box's transform when it is changed, gets the value of one of its axis then applies that value to the brush size..
i mightt not be making any sense in this hehe, just trying to help.
Wahooney
11-04-2004, 12:53 PM
Thanks galagast, but no cigar :shrug:
kbGetLine() takes all your keyboard input and as soon as you press enter it returns whatever you typed in. What I want is a function, like kbGetLine(), that doesn't open the maxscript listener.
Thanks galagast, but no cigar :shrug:
kbGetLine() takes all your keyboard input and as soon as you press enter it returns whatever you typed in. What I want is a function, like kbGetLine(), that doesn't open the maxscript listener.
I don't think it would be easier for the user to type in into nothing, hoping that the value he is entering is received correctly. Why don't you create a dialog and define it as a dockable toolbar, then dock it in the interface and whenever you need the brush settings, just type in there? It does not eat too much space, esp. if you already have other toolbars docked...
Like this:
(
global SetBrushSize_Dialog
try(cui.UnRegisterDialogBar SetBrushSize_Dialog )catch()
try(destroyDialog SetBrushSize_Dialog )catch()
rollout SetBrushSize_Dialog "Brush"
(
spinner theSize "PSB Size:" range:[0,1000,maxOps.paintSelBrushSize] type:#float fieldwidth:50
on theSize changed val do maxOps.paintSelBrushSize = val
)
createDialog SetBrushSize_Dialog 120 25
cui.RegisterDialogBar SetBrushSize_Dialog style:#(#cui_dock_all)
cui.DockDialogBar SetBrushSize_Dialog #cui_dock_bottom
)
Wahooney
11-05-2004, 04:20 AM
I was hoping to make it kinda like photoshop, but as always Bobo your shaman-like wisdom comes to the rescue. I think I'll do that.
But I do have another question... Is there a way to show and hide any max toolbar through maxscript?
Thanks.
I was hoping to make it kinda like photoshop, but as always Bobo your shaman-like wisdom comes to the rescue. I think I'll do that.
But I do have another question... Is there a way to show and hide any max toolbar through maxscript?
Thanks.
Gonzalo Rueda used to have a DLX for Max 4 that did this. (Yascript)
Does not seem to be available for Max 6/7 though.
You might want to drop him an email and ask for recompile?
CGTalk Moderation
01-19-2006, 06:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.