SpacePilot in MAX9 Manipulating Maxscripts?

Questions and answers about 3Dconnexion devices on Windows.

Moderator: Moderators

Mike Truly
Posts: 60
Joined: Tue Jan 09, 2007 9:31 am

SpacePilot in MAX9 Manipulating Maxscripts?

Post by Mike Truly »

Maxscripts in MAX can create various dialogs with buttons and text fields, etc. I am using the latest SP drivers with MAX9_32 and was trying to setup a config on the SP where I programmed the SP buttons to do simple things like press the 'Delete' key.

For example, in a Maxscript dialog text field, I would have some text, then I would use my mouse to highlight the text and then try to use my programmed SP button to 'Delete' the selected text. It does nothing even though the dialog titlebar is highlighted. I also have programmed a 'Paste' button but it also does nothing.

I also have programmed a 'Clone' button and when the Maxscript dialog has focus, and this button is pressed it WILL open the MAX Clone dialog.

So my question is, should the SpacePilot programmed buttons be able to do things in these Maxscript dialogs such as 'Delete' or 'Paste'?

Thanks!
Sincerely,

Mike Truly
----------------------------------------------------------------
Truly Media
http://www.trulymedia.com
jwick
Moderator
Moderator
Posts: 3340
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Post by jwick »

Hi Mike,

Haven't heard from you in a while.

It's a long answer. It depends on how the application is processing keyboard events. Some applications process keyboard events in a way that is compatible with the way we send keyboard events...and some don't. It's hard to tell w/o trying it. And if it doesn't work, it just doesn't work. I'd say if the Maxscript window has focus when you send these buttons and it doesn't work, it isn't going to work (assuming the actual keyboard keys work).

In some applications (like Notepad) those keyboard shortcuts work fine.

Jim
3Dx Software Development
Mike Truly
Posts: 60
Joined: Tue Jan 09, 2007 9:31 am

Post by Mike Truly »

Howdy Jim,

Thanks for the info.

In my crude understanding, Maxscripts are run and executed within MAX (they're not stand alone apps... they actually function within the MAX framework) so there possibly seems to be a focus issue related to this in that the one command I used as a button that DID work was 'Clone' which is a native MAX command and you normally use it by going to the Edit menu and choosing 'Clone'. When the focus was on my Maxscript dialog and I executed this SP button, the focus instantly changed to the main MAX window and opened the Clone dialog.

But when the focus was on the Maxscript dialog and I chose a button that executed a common command like 'Delete' (which I don't think was a MAX specific command but rather a basic keyboard command?), it did nothing.

Since I don't write scripts myself, I'm a little ignorant on this but my basic question is, is it possible for Maxscripts (which run under MAX) to be written in a way that will allow SP commands to be recieved and used?

There are literally hundreds (if not thousands) of Maxscript tools that open dialogs to present fields, buttons, etc. so it could be really handy if there was a way to make them receive commands from the SP.

I have also contacted the developer of this particular script to see if he is aware of any possibilities as well.

Thanks again.
Sincerely,

Mike Truly
----------------------------------------------------------------
Truly Media
http://www.trulymedia.com
jwick
Moderator
Moderator
Posts: 3340
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Post by jwick »

Hi Mike,

How are you assigning the Delete and Paste commands? Are you doing this within the 3DxMAX plugin's dialog, or are you assigning keyboard macros in the 3DxWare driver?

Jim
Mike Truly
Posts: 60
Joined: Tue Jan 09, 2007 9:31 am

Post by Mike Truly »

Jim,

I'm in MAX and I press the 'Panel' button and then the 'Button Editor' to open the dialog. Then I choose 'All Commands' and from that list add 'Delete' to one of the buttons. Same with 'Paste' or 'Copy'.

Since I'm in MAX and want to use these MAX tools (Maxscripts), this seemed the logical place to be setting this up. But as I mentioned, these tools (even with focus) don't seem to react to the SP commands.

Thanks!
Sincerely,

Mike Truly
----------------------------------------------------------------
Truly Media
http://www.trulymedia.com
jwick
Moderator
Moderator
Posts: 3340
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Post by jwick »

This is the panel that is inside Max that contains all the other Max commands? If you are in the Max panel (not the 3DxWare panel) this should work. If not, it could be a problem in our plugin (3DxMax).
Mike Truly
Posts: 60
Joined: Tue Jan 09, 2007 9:31 am

Post by Mike Truly »

Jim,

Yes, this is the MAX panel. When you choose 'All Commands', all are shown and you can choose Delete, Copy, Paste, etc. and assign them to SP buttons... but they don't do anything.

Not only do they not do anything in a floating Maxscript tool dialog (as I originally found), but I just tested the buttons with the basic MAX interface and they don't work there either.

For example, in the basic MAX9_32 interface, there is a panel called the Modify Panel. At the top of this panel, there is a name field that displays the name of the current object you have selected. I used the mouse to highlight this name and then tried to use the SP buttons to 'Delete' or to 'Paste' and nothing happens. The highlighted text is not deleted or pasted.

So it seems there may be some problem.

Thanks!
Sincerely,

Mike Truly
----------------------------------------------------------------
Truly Media
http://www.trulymedia.com
jwick
Moderator
Moderator
Posts: 3340
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Post by jwick »

Got it. I'll ask the Max engineer to take a look at it.
Mike Truly
Posts: 60
Joined: Tue Jan 09, 2007 9:31 am

Post by Mike Truly »

Thanks Jim!
Sincerely,

Mike Truly
----------------------------------------------------------------
Truly Media
http://www.trulymedia.com
jwick
Moderator
Moderator
Posts: 3340
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Post by jwick »

Hi Mike,

Can you assign those commands to a keyboard key in 3ds Max and do they then work under the same circumstances?

Jim
Mike Truly
Posts: 60
Joined: Tue Jan 09, 2007 9:31 am

Post by Mike Truly »

Jim,

When I use the standard CTRL-C (Copy), CTRL-V (Paste), and Delete key, they all work within MAX or any Maxscript dialog. So for example, if I highlight some text in a MAX field and use CTRL-C to copy and then hightlight another MAX field and hit CTRL-V to paste it works. Or if I select some text in a MAX field and hit the Delete key, it works.

But when I go into the customization dialog of MAX9_32, and try to look for these commands in the available list, only 'Paste' is available. And when I try to assign this to a different key combination from CTRL-V (such as CTRL-ALT-P), it will assign the command... but it doesn't seem to do anything. So I'm not sure this MAX list of commands is complete or if they are functional. I'll post about this on the MAX forum to see if anyone knows what this particular 'Paste' function is supposed to be.

Thanks!
Sincerely,

Mike Truly
----------------------------------------------------------------
Truly Media
http://www.trulymedia.com
Mike Truly
Posts: 60
Joined: Tue Jan 09, 2007 9:31 am

Post by Mike Truly »

OK, after further investigation... here's what I found out.

The only item (out of Copy, Paste and Delete functions found in the MAX SpacePilot config command list) found in the MAX UI Customization commands is 'Paste'. This does nothing when assigned to a keyboard shortcut as previously mentioned. As it turns out, this is not the standard system 'Paste' but rather a paste function of another specific MAX add-on tool. So it does not paste text like the standard system 'Paste' does.

So this leads me to believe that the Copy, Paste and Delete commands that are showing up in the SpacePilot MAX config dialog are not the standard system type commands which might explain why they are not working when assigned to the SP buttons. (Because they are meant for specific tools).

So... the question then becomes:

Since the SpacePilot can be configured such that buttons can be assigned keyboard shortcuts like the standard system Copy, Paste, Delete, etc. functions and used in other apps just fine...

Can the MAX driver and config dialogs be improved such that the user not only chooses pre-defined commands from the list to assign to buttons but can also assign specific keyboard shortcuts to the buttons like in the 3D Connexion Control Panel>Button Config>Custom Functions?

This would be ideal. Having both MAX specific commands and keyboard shortcut assignability.

Thanks!
Sincerely,

Mike Truly
----------------------------------------------------------------
Truly Media
http://www.trulymedia.com
jwick
Moderator
Moderator
Posts: 3340
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Post by jwick »

Hi Mike,

Yes, there is a point of confusion in there in that we don't tell you where we got those commands from when we populate the list. It's unfortunate that a MAX add-on used such a common name as Paste.

You should be able to create keyboard macros with unique names, e.g., "KB-Ctrl-p (Paste)", KB-Del, KB-Ctrl-c (Copy). They should then appear in the lists under distinctive labels. They still may not be understood by some apps, but it's been my experience that most normal windows apps (even Notepad) can understand them. They are just normal Windows keystroke events. If an app doesn't understand them, it is probably because it is hacking the message loop. If the actual keyboard keys work, there is a very good chance the macros will work.

Let us know.

Jim
3Dx Software Development
Mike Truly
Posts: 60
Joined: Tue Jan 09, 2007 9:31 am

Post by Mike Truly »

Jim,

I'm a little unclear on where these commands should be created.

MAX does not let you create new commands (at least for those of use who are not coders or scripters). It presents you with a list of commands and you select a command and assign a keyboard shortcut. So since I can't create new commands in MAX, I can't make that new command show up in the SpacePilot MAX Config Panel.

If, when MAX is running, I open the 3D Connexion Control Panel and use the Custom Functions to create the new commands, they are created just fine and I can assign them to SP buttons. I can then use those SP buttons in MAX and it copies, pastes and deletes just fine (as desired). Problem is, they aren't permanently saved with the MAX SpacePilot config so when I press the SP Config button to cycle through various configs I have (such as Modeling, Animation, Rendering, etc.) the newly create commands are lost as they were never stored properly.

So basically, there are two areas where you can assign macros/commands to SP buttons. The SP config panel within MAX and the 3D Connexion Config Panel (outside MAX). What would be great is if inside the SP config panel within MAX, you could create the custom functions and store them like you can in the 3D Connexion Config Panel. The commands DO work within MAX... I just can't get them to be saved permanently.

Thanks for any ideas!
Sincerely,

Mike Truly
----------------------------------------------------------------
Truly Media
http://www.trulymedia.com
jwick
Moderator
Moderator
Posts: 3340
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Post by jwick »

Hi Mike,

You need to open the 3DxWare GUI, create the KB-Paste, etc. keyboard macros as described above while Max is running. Stop MAX. This will save your kb macros to the "Max - mtruly" config file. Then restart Max and it will pick up the keyboard macros you saved in the "Max - mtruly" config file. They can then be assigned inside Max to your mode-specifc Max configs and will be saved from mode to mode.

Jim
Post Reply