Custom hotkey to toggle proportional modelling on and off

Article needs peer review

Summary

The button to toggle proportional modelling on and off is not listed as a 'Command' within the Keyboard Mapping tool so it is not possible to simply choose to assign a hotkey to this command.

However, when the Proportional Modelling option is activated or deactivated the action is recorded in the Command History so it is quite straightforward to create a custom button to toggle this setting. This custom button can be assigned to a hotkey because it will be listed as a command under the Custom Script Commands group within the Keyboard Mapping tool.

Steps

  • Turn Proportional Modelling on and off and note the command which appears in the command history.
  • When Proportional Modelling is activated the following command is logged:
 SetUserPref "3D_TRANSFO_PROPORTIONAL_CHANGED", 1
  • When Proportional Modelling is de-activated the following command is logged:
 SetUserPref "3D_TRANSFO_PROPORTIONAL_CHANGED", 0
  • These two commands can be combined in a simple script to toggle Proportional Modelling on and off:
 pref = GetUserPref ("3D_TRANSFO_PROPORTIONAL_CHANGED")
 if pref = 1 
 then
 SetUserPref "3D_TRANSFO_PROPORTIONAL_CHANGED", 0
 else
 SetUserPref "3D_TRANSFO_PROPORTIONAL_CHANGED", 1
 end if
  • Use this script to create a custom command button in a custom toolbar which you can use to toggle Proportional Modelling on and off and it will now be possible to assign this command to a hotkey.
  • To do this, open the Keyboard Mapping tool and under the Custom Script Commands group you will see the name of your Proportional Modelling toggle button. Assign this command to a hotkey of your choice to create a hotkey that will toggle Proportional Modelling on and off.



More Information

This technique makes it possible to create a hotkey or toggle button for various scene settings which you might want to toggle on and off regularly.



Applies To: XSI 3.0,XSI 3.0.1 on NT,Win2K,Irix,Linux

Posted: 4/8/2003


This page was last modified 17:44, 6 Dec 2010.
This page has been accessed 9043 times.

© Copyright 2009 Autodesk Inc. All Rights Reserved. Privacy Policy | Legal Notices and Trademarks | Report Piracy