How to set hotkey for Local & World Coordinates under Tool Settings for Trans/Rotate tool?

If you have the Rotate or Translation Tool selected, you can change between local & world coordinates in the Tool Settings, but I'd like to be able to set a hotkey for local coordinates and a separate hotkey for world coordinates. How would I achieve this? I looked through the F3 menu, but couldn't find them.

Comments

  • FlortaleFlortale Posts: 611

    Hmm, are you saying that I can tie the script to a hotkey?

    So, I press a hotkey, it runs the script which changes the coordinate from local to world under tool settings?

  • Yes, any script can be made into a custom action (most easily by right-click on its thumbnail in the content pane) and then assigned a shortcut in Window>Workspace>Customise.

  • FlortaleFlortale Posts: 611

    Yes, any script can be made into a custom action (most easily by right-click on its thumbnail in the content pane) and then assigned a shortcut in Window>Workspace>Customise.

    Thanks, this worked out great.

    I modified the script  and turned it into a toggle, hope someone finds this useful, you only need one hotkey, and it toggles between Local & World: 

    // Define an anonymous function;// serves as our main loop,// limits the scope of variables(function(){ 	// Get the viewport manager	var oViewportMgr = MainWindow.getViewportMgr();	// If we don't have an viewport manager	if( !oViewportMgr ){		// We're done...		return "";	} 	// Find the tool;	// DzUniversalTool, DzUniversalRotateTool, DzUniversalTranslateTool, DzUniversalScaleTool	//var oTool = oViewportMgr.findTool( "DzUniversalRotateTool" );	// If the tool was not found	//if( !oTool ){		// We're done...	//	return;	//}        // Find the tool;	// DzUniversalTool, DzUniversalRotateTool, DzUniversalTranslateTool, DzUniversalScaleTool	//var oTool = oViewportMgr.findTool( "DzUniversalTranslateTool" );	// If the tool was not found	//if( !oTool ){		// We're done...	//	return;	//}     // get active tool    var oTool = oViewportMgr.getActiveTool();    // get current tool coordinate space    var oToolCoordinateSpace = oTool.getCoordinateSpace();        // if local space    if (oToolCoordinateSpace == DzUniversalTool.LocalSpace) {        // Set the coordinate space of the tool to world space        oTool.setCoordinateSpace( DzUniversalTool.WorldSpace );    } else {        // Set the coordinate space of the tool to local space        oTool.setCoordinateSpace( DzUniversalTool.LocalSpace );    }    //} // Finalize the function and invoke})();
     
  • It is possible to modify this script to switch between World Coordinates and Screen Coortdinates?

    Thank you.

  • Thanks Richard, but the script only mentions the code "If the apppliation version is older than 4.11.0.52".
    Finally I discovered that it is enough to replace "DzUniversalTool.LocalSpace" with "DzUniversalTool.CameraSpace" in the script uploaded by Fortale.
    Thanks again.

Sign In or Register to comment.