Maya -> Settings -> Other: Move Object while holding mouse key

Questions and answers about 3Dconnexion devices on Windows.

Moderator: Moderators

Post Reply
brandario
Posts: 7
Joined: Mon Dec 18, 2023 6:39 pm

Maya -> Settings -> Other: Move Object while holding mouse key

Post by brandario »

I would like to know if is there any way I can use a Macro or develop by myself an association between a menu toogle property and a 3D mouse key.

Using Maya, 3DConnexion properties: in Advanced Settings, there is a "Other" tab, where you can toggle "Move Object".

For me it would be very intuitive to hold LEFT (or RIGHT) key while an object is selected, to move it arround, and return to Navigation Mode on mouse release. So basically, just conect that property to a press of the mouse.
Framed_Previz90
Posts: 37
Joined: Sat May 23, 2020 8:31 pm

Re: Maya -> Settings -> Other: Move Object while holding mouse key

Post by Framed_Previz90 »

When you change a 3D aware software's settings using the GUI, only some of the settings are saved to the corresponding xml config file found in ~\AppData\Roaming\3Dconnexion\3DxWare\Cfg, even if you quit the server through its own mechanism:

Code: Select all

3DxService -quiet -shutdown
In other words, when you change a setting such as Other > Move Objects for Maya, maya.xml config is never modified. The change corresponds in real time to a xml file found in ~AppData\Local\3Dconnexion\3DxWare\Cfg\Ext\36300.1758987104.settings.xml, the name 36300.1758987104.settings.xml might be different on your machine.

You can take advantage of this by foregoing the GUI altogether and writting to the 36300.1758987104.settings.xml file yourself to toggle to the desired state, the node that controls Move Objects in that file is:

Code: Select all

<Setting ID="MoveObjects"><Value>true</Value></Setting>
There are many ways to do this, one simply beginner friendly method I can suggest is to first, generate two 36300.1758987104.settings.xml files using the settings editor, one copy has Move Objects enabled and another does not. Save both files to somewhere like documents:
  • c:\users\user1\documents\MoveObjectsOff.xml
  • c:\users\user1\documents\MoveObjectsOn.xml
Now to toggle back and forth between moveObjects settings, You can copy one of the files to the folder ~AppData\Local\3Dconnexion\3DxWare\Cfg\Ext and overwrite the existing 36300.1758987104.settings.xml file as desired.

Of course you do not want to open file explorer every time you want to toggle this setting. You can use AutoHotkey, a exceedingly simple tool, to do this for you, so that when you press a key, it will toggle moveObjects setting.

Code: Select all

;this section is just to speed up the programme
#singleinstance, force
#NoEnv


left::																																															;Action triggers when you press left keyboard key
FileCopy, c:\users\user1\documents\MoveObjectsOn.xml, C:\Users\user1\AppData\Local\3Dconnexion\3DxWare\Cfg\Ext\36300.1758987104.settings.xml, 1		;On left key down, "MoveObjectsOn" file becomes the active config
KeyWait, left																																												;This command waits for Left key to be released
FileCopy, c:\users\user1\documents\MoveObjectsOff.xml, C:\Users\user1\AppData\Local\3Dconnexion\3DxWare\Cfg\Ext\36300.1758987104.settings.xml, 1	;On left key up, "MoveObjectsOff" file becomes the active config
You will need to update the file paths in the code to reflect your machines user name, and also 36300.1758987104.settings.xml might be something else on your system.

If you want to make the trigger right instead of left, then change the words left to right (both line 6 and 8 )

The good news is that this is not subject to delays or lags at all, its instant, I wish this was the case everywhere but its not.

AutoHotkey is currently in the middle of a major version bump, the correct installer that will let you run the above code is v1.1, which can be found at AutoHotkey.com. A basic guide to installing Autohotkey and running scripts can be found on the official documentation page, for example, How to run a script.

PS: I am not a 3dConnexxion developer at all, I discovered this on my own and it has only been tested on my home and work machine (driver 10.8.20), so it may not entirely be "correct". If you get stuck or figure out something cool, let me know :)
jwick
Moderator
Moderator
Posts: 3359
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Re: Maya -> Settings -> Other: Move Object while holding mouse key

Post by jwick »

There is a

Code: Select all

<ButtonAction><ID>V3DCMD_TOGGLE_MOVEOBJECT</ID></ButtonAction>
which can be added to the options in the GUI.
You can see how it works in our "assembly demo".
Maybe it doesn't work with Maya. I'll ask.

In any case, it is a toggle, not an ActiveOnlyWhilePressed Action.
Post Reply