Is there a script to toggle local and world coordinate?
James
Posts: 1,025
Is there a script to toggle local and world coordinate?
You currently have no notifications.
Is there a script to toggle local and world coordinate?
Licensing Agreement | Terms of Service | Privacy Policy | EULA
© 2024 Daz Productions Inc. All Rights Reserved.
Comments
Why do you need a script to do this? You can just use the drop-down in the Tool setting panel.
efficiency.
Since I switch between them many times.
Fair enough. I did look to see if there was a menu item you could assign a hotkey to which would do the job but I didn't spot one. There is no search there so I might have missed it.
I haven't heard of an existing script that would do this but a quick look in the API shows that DzUniversalTool::setCoordinateSpace() exists and so I imagine it's certainly possible to have a script that does this.
My Bad! There is an example script that almost does this: View_Tool_Set_Coordinate_Space.dsa - that will force the coordinates to WorldSpace. Technically you can then make a copy and swap the values in line 60 to make a version that forces LocalSpace. However, if you check in this thread then Flortale has already done the work to turn that script into the toggle you wanted. The forum CSS turns the inline code into an unhelpful ribbon that scrolls of the side of the page, but if you click to quote that post and then double-click the code block it turns into something from which you can copy and paste.
You can then save this script in your My Library/Scripts folder, right click it and create an action and then finally go into Window->Workspace->Customise and assign a hotkey to it.
Doesn't seem to work the script in that thread.
Nothing happens
It was working for me when I tried it. However, it is tied to the Universal (move + rotate) tool tho, are you using a different tool?
I tried universla, rotate, move
This script right?
That looks to be the right script but it could be that the silly formatting of the code block has broken it. I tried to attach it to this post but the uploads are still broken and actually now returning a write failure rather than just hanging forever.
I have uploaded it here for the time being: sofacitizen.uk/files/misc/Toggle Universal Tool CoOrdinates.dsa
With this, I have saved it into the scripts folder of My LIbrary, right-clicked on it in Content Library and created a custom action. Then gone into Window->Workspace->Customise, expanded the "Custom" section under Actions, right-clicked on the script and "Changed Keyboard Shortcut", picked a key combo and then hit Accept. With this done I created a new Primative, made sure the UniversalTool was active and the Tool Settings panel is open. Then when hitting the key combo I chose I could see the tool switching from World Coordinates to local and back again. To see it change on the tool widget you do have to rotate the primative a bit first since by default it is positioned in a way that world and local corrdinates are the same.
Hopefully that helps.
It works! Thank you.