Center To Object - Workspace - Would this be possible?

free scripts, plugins, models, textures
User avatar
MikomDude
Captain
Posts: 1928
Joined: 04 Oct 2010, 11:12
Type the number ten into the box: 0
Location: The Hague, Netherlands
Contact:

Center To Object - Workspace - Would this be possible?

Post by MikomDude »

I was wondering, would it be possible to create a script/plugin for the workspace that with the click (or two clicks) of the mouse centers one object to the coordinates of another object?

I have no experience programming/scripting in trueSpace (or any program) myself so it's really just a suggestion but if it can be done I think it would be a very useful tool.
froo
Captain
Posts: 2554
Joined: 22 May 2009, 12:13

Re: Center To Object - Workspace - Would this be possible?

Post by froo »

Yes I believe that is possible.
User avatar
Draise
Captain
Posts: 3199
Joined: 21 Sep 2009, 19:33
Type the number ten into the box: 0
Location: Bogota, Colombia
Contact:

Re: Center To Object - Workspace - Would this be possible?

Post by Draise »

Actually... using the bridge, I made a button that first freezes the transforms on WS, then with the other button, it centers the axis onto the from the MS to the WS side.

1. You just need to copy the script into Custom Commands under the LE/Default/Scripts/ part of TS.
2. Then copy the button into a toolbar. LE/Default/Projects/Windows Space Manager/[Frame or Toolbar]/[Toolbar]/
3. Refresh the toolbar (change it's orientation or something) then turn the bridge on.
4. RMB = flatten axis, do this first. LMB = center axis.


You may need Clinton's extra LE navigator plugin to navigate to the default.

!
Warning: Doing so will erase your object's shader, but you can easily back it up and put it back on before doing so.
Attachments
Center Axis WS 0.2.zip
(10.66 KiB) Downloaded 275 times
User avatar
MikomDude
Captain
Posts: 1928
Joined: 04 Oct 2010, 11:12
Type the number ten into the box: 0
Location: The Hague, Netherlands
Contact:

Re: Center To Object - Workspace - Would this be possible?

Post by MikomDude »

Thank you Draise but I was looking for something just a little less complicated than that. I simply wanted a tool that with one click of the tool icon enables the function for the current object. Then, with the tool enabled, one would simply need to click whatever object I want to center the current object to and it will do so.

The reason I got this idea is because I tend to do this operation a lot only by using the object coordinates in the down-right corner of the Workspace. When I'm modeling, I tend to model very fast like I was drawing, so having to enter (and remember) these X-Y-Z values for each object takes time and momentarily halts my modeling.
I believe such a tool most likely would have been included in trueSpace, had anyone thought of this idea at the time it was being developed, since it is these types of quick-to-use tools that makes tS so great. :)
User avatar
Finis
Captain
Posts: 5266
Joined: 21 May 2009, 18:26
Type the number ten into the box: 0
Location: North Venezuela or West Korea
Contact:

Re: Center To Object - Workspace - Would this be possible?

Post by Finis »

If I was developing a 3D app, and there was time and money to reach this level of functionality, I'd make that one of the snap tools. Snap to center or snap to object axis. So, is there a TS snap tool that could do this?
The more laws, the less justice. -- Marcus Tullius Cicero
pugman 1
Captain
Posts: 1555
Joined: 21 May 2009, 19:26
Type the number ten into the box: 0
Location: Germany

Re: Center To Object - Workspace - Would this be possible?

Post by pugman 1 »

Modo and zbrush have this .but these are not ts i wish work space hadthis
to its the quickest modler i know. Modo is good but not as easy as ts
User avatar
Draise
Captain
Posts: 3199
Joined: 21 Sep 2009, 19:33
Type the number ten into the box: 0
Location: Bogota, Colombia
Contact:

Re: Center To Object - Workspace - Would this be possible?

Post by Draise »

MikomDude wrote:Thank you Draise but I was looking for something just a little less complicated than that. I simply wanted a tool that with one click of the tool icon enables the function for the current object. Then, with the tool enabled, one would simply need to click whatever object I want to center the current object to and it will do so.
Well...once you install the script and button, you only need to rightclick then leftclick the button to center the axis of the selected object. It isn't.. too complicated?
User avatar
MikomDude
Captain
Posts: 1928
Joined: 04 Oct 2010, 11:12
Type the number ten into the box: 0
Location: The Hague, Netherlands
Contact:

Re: Center To Object - Workspace - Would this be possible?

Post by MikomDude »

To center the axis of the selected object? Hmm, that's not what I meant. Besides, trueSpace already has a tool for that. I meant the function of the button to be that it would change the orientation of an object to the exact orientation of another object in the scene.

For example, if I wanted object A (at X-1.000 Y-1.000 Z-1.000) to position itself at the same coordinates as object B (which is at X-3.000 Y-5.000 Z-4.300) then all I would have to do is select object A --> click the button for the tool --> then click object B and it would automatically put object A at the coordinates of object B (X-3.000 Y-5.000 Z-4.300).
User avatar
Draise
Captain
Posts: 3199
Joined: 21 Sep 2009, 19:33
Type the number ten into the box: 0
Location: Bogota, Colombia
Contact:

Re: Center To Object - Workspace - Would this be possible?

Post by Draise »

OOOOOOOH..!!!!! Capich. Terrible english I've got sometimes... :roll: :P

hmmmmm... :geek:

Just expand the World Matrix output of the parent object, then expand the Matrix input of the child object, then link what you want to match to each other, and viola! If you want to snap another object to it's center, then unlink the parent object and put in another parent object.

Then when you are happy with the new position and you don't want it stuck to the center of the other object, then unlink them from the expanded nodes and you are good to go!

Image

Image


Or to the other object:

Image

Image


It's not a button solution..... :? but once you have the two extra exanded nodes, you just link and relink whatever you need in the LE to do what you want. Not quite a button, but it works.

Maybe a script can be made to do the like at the click of the button (like a constraint script around here somewhere) but I'm not sure how to write that.
froo
Captain
Posts: 2554
Joined: 22 May 2009, 12:13

Re: Center To Object - Workspace - Would this be possible?

Post by froo »

Actually, I think Draise's solution in the last post would work as a macro. You can enable the 'Macro Record' button, run through the steps, then click the Stop Macro Recording button. Save the macro, so you can run it whenever you want.
Post Reply