PDA

View Full Version : Two Questions



rcallicotte
12-13-2014, 02:54 PM
How do I -

1. Center an object in Layout that did not come in centered on the XYZ axis 0?

2. In Layout, drop an object to the floor?

Would anyone be able to give me clear direction about these two things? It is not clear to me where to look inside the menus, though I have taken a gander at it.

ernpchan
12-13-2014, 03:27 PM
You can center it in Modeler with the Center tool. I believe the default shortcut key is F2. Or are you trying to center it a different way? Your view of it?

Bullet dynamics is perfect for this. Make a plane be a static object, and the object you want to drop a rigid object and then hit Play.

djwaterman
12-13-2014, 04:18 PM
If the object from Modeler is off center, and you have a reason not to correct that in Modeler, then you can center the object's pivot point in Layout, it's under the Modify Tab near the (Translate) move options 'Move Pivot'. Choose a top view ( or side view) and move the pivot to the center of the object. Then swap to the 'Move' tool and center the object, basically zero out the X Y Z values. If you just wanted to place it on the floor and not drop it (not using Dynamics), then you just use the move tool to position it to look like it's on the floor (sorry if this sounds obvious I'm just covering all bases).

rcallicotte
12-13-2014, 04:38 PM
I was trying to center in Layout. Thanks.


You can center it in Modeler with the Center tool. I believe the default shortcut key is F2. Or are you trying to center it a different way? Your view of it?

Bullet dynamics is perfect for this. Make a plane be a static object, and the object you want to drop a rigid object and then hit Play.

- - - Updated - - -

Ooooh. Good to know! I'll try this in Layout. Thanks!

As far as DROP, maybe I'm too accustomed to Vue. Just drop an object and it touches the object beneath it. Pretty handy.



If the object from Modeler is off center, and you have a reason not to correct that in Modeler, then you can center the object's pivot point in Layout, it's under the Modify Tab near the (Translate) move options 'Move Pivot'. Choose a top view ( or side view) and move the pivot to the center of the object. Then swap to the 'Move' tool and center the object, basically zero out the X Y Z values. If you just wanted to place it on the floor and not drop it (not using Dynamics), then you just use the move tool to position it to look like it's on the floor (sorry if this sounds obvious I'm just covering all bases).

jeric_synergy
12-13-2014, 04:39 PM
Apparently there USED to be a plugin/script called "CenterPivot" by Eki that would do so, but only for one object/layer at a time, one of the problems with Layers being considered objects in Layout. ( cite= http://forums.cgsociety.org/archive/index.php/t-195249.html )

It was on flay, and a search of the lw3dg (I should hotkey "lw3dg", I type it so much) plugin reference page did not turn it up. Sounds like it had serious limitations.

I think what people would generally desire is a script that moved the pivot point to the cumulative center of all an "object's" (damn you, Allen Hastings!) Layers. I'd do it both ways: "Center Pivot-Singular.py" and "Center Pivot-All.py". That way you wouldn't need to include a UI.

+++++++

EDIT: further down on that page is a LWM script that will bbox center every layer in a multi-layer object. SEARCH on "jacobo3d".

rcallicotte
12-13-2014, 04:52 PM
Thanks Jeric!

jeric_synergy
12-13-2014, 07:12 PM
This is the kind of script that Chazriker may have sitting in his back pocket.

jeric_synergy
12-13-2014, 07:21 PM
As far as DROP, maybe I'm too accustomed to Vue. Just drop an object and it touches the object beneath it. Pretty handy.
Now, how would we do this in LW?

PSUEDOCODE FOLLOWS:

determine lowest point on MESH1.
attach NULL to lowest point.
use RAYCAST to NULL.
drop ray in -Y vector.
determine distance to MESH2.
drop MESH1 that distance.

Obviously, this isn't collision detection and it would fail in many easily constructable scenarios. BUT, it might be scriptable today, and it could certainly be doable by hand-crafting.

And, if it were scriptable , you could make a "Drop Mesh" button on your UI, today.

rcallicotte
12-13-2014, 08:38 PM
I wish I knew Python...or is it even doable in Python? I know C#, but I'm not sure where that would be helpful here...or...?

jeric_synergy
12-13-2014, 09:49 PM
The script/plugin (since you know C#, which I think only gets you thru the door, then you gotta deal with the LW SDK) would determine and PLACE the null on the lowest point of the mesh. Ideally it could also construct and apply the required node network, which I believe is not possible, or more easily load a prepared/Saved node network to do the raycast bit.

(IOW: construct a network? Probably not. Load a pre-Saved network? Maybe.)

For large surfaces, probably just the bottom of the bounding box would do.

Of course, it's easy to construct an object that would only awkwardly fall onto a surface, or a surface that's tough to rest on. How good is Vue's "drop" function?

rcallicotte
12-14-2014, 05:20 AM
My experience with Vue is "usually", but I've tried it on some precarious surfaces, such as mountain crags and extremely uneven floors. It's pretty handy, though. It just drops to whatever is below it.

As far as writing this, since I've done nothing ever with this SDK, it's likely I won't know the first thing about the first thing. I don't think I'll try.

I did copy that script you pointed out by jacob3d and renamed it LS, only to wonder if it should not be a PY file.