PDA

View Full Version : Snap to object



Wayne Heim
09-11-2013, 09:45 AM
I have a bunch of screws placed in specific places on one layer. Client has come back and wants to swap out the screws for a different screw. I have already done all the rotations and placement of the original screws and it's a real pain to realign the new screws on another layer to match the first batch. Is there a plugin or way to snap an object to the orientation and position of an object on another layer?

Thanks in advance.

Wayne.

Danner
09-11-2013, 10:32 AM
There are no objects in a layer, only geometry, there is no way for LW to know "which way is up" on each of those parts. There are no local axis on any of your screws so there is no way to get that information to any plugin or method directly. What does have orientation and position is the polygons themselves, What you need is a single polygon for each of your screws.
You could try merge points with tolerance or a reduce polygons + (or both) till you get a single polygon per screw, if all else fails, select the same from each, either by hand or using select Nth. Then isolate them, now you can use a tool like MGUltimate Clone to place a new screw on each of the polygons that represent the position an rotation of your older screws.

jeric_synergy
09-11-2013, 10:47 AM
hmmmm, good puzzle... There are no objects in a layer, but there are PARTS, i.e. connected meshes.
(thinking aloud here...)
There MIGHT be a way to use DPKit to place bounding boxes around each Part.
From each bounding box, a vector might be derived.
Using the position and vector, replacement objects could be placed and rotated.

Probably some custom programming required.
I suggest posting a 'bounty' for a solution: $XXX, first viable solution gets the cash.

daforum
09-11-2013, 10:59 AM
If you're using 11.5+ have a look at this tutorial:
http://www.foundation3d.com/forums/showpost.php?p=250493&postcount=2

...especially the part where the wheels are aligned to the plane. It's just an idea but you may be able to do the same with the screws.
Hope it helps :)

jeric_synergy
09-11-2013, 11:16 AM
How many screws are we talking about anyway?

BTW, if you find a good replacement strategy, I'd suggest NOT replacing the screws, but making a 'guidance layer' of polys or whatever you figure out works, because five bucks says they'll change the screws AGAIN.

Danner
09-11-2013, 11:59 AM
If all else fails, use the Place Mesh tool to place them again. At least you don't have to worry about rotation, only placement.

Surrealist.
09-11-2013, 12:42 PM
For something like this, using LightWave I'd be inclined to set it up as a scene in Layout. Not sure about the orientation for the screws, but I had an object once where I had to point a lot of elements to a particular angle that was hard to do in Modeler but easy to position in layout with a constraint. The plus side of this worklflow is to replace objects, you have a built in feature in layout. Save trans gives you the objects if you need them in Modeler to add to a finished model all positioned. Not ideal in any way, but something to think about for the future perhaps or maybe there is a way to Layout to position the screws faster with the help of other tools as well as the time spent in set up pays off if there are further changes.

JoePoe
09-11-2013, 02:14 PM
Without seeing exactly what's going on.....

Seems to me that Pictrix has several tools that could help cut down on the heavy lifting here.

I'm assuming the screws are "in" something yes? We will call that "Area X". And I'm also assuming that the screws are going into AreaX along AreaX's normal, yes?
Use Pictrix OnMove (http://www.pictrix.jp/lw/OnMove/mov.html). I would create a little flat poly on the bottom of the new screw (if there isn't something like that already) and just OnMove it onto Area X. Works interactively on the fly.
No need to manually adjust angle/rotation. Use "offset" to bury the screw up until it's head. (If it's just a head, all the better.... the flat surface of the bottom of the head is the perfect reference for OnMove).

You would still have to do each one individually.... but like I said, most of the heavy lifting is taken out of the equation. It's basically drag and drop!!

If the screws are NOT going into something, I would still try OnMove.... OnMove the new screw onto an appropriate reference poly on the old screw itself (with offset).

It's 32 bit, but the time you could save seems like it would be worth opening up a 32 bit version of LW for a bit.

Pictrix also has V-fit (http://www.pictrix.jp/lw/Vfit/index.html) which matches a mesh's rotation to a sample normal of a poly on another mesh.
And there are others that might help as well. :thumbsup:

Edit: maybe this is what Place Mesh does as recommended above (I'm not on LW 11).
Edit #2: Yup, same as Place Mesh.... so disregard, unless you're pre 11 also. :)

nickdigital
09-11-2013, 02:45 PM
I would recommend doing this with instances. If you actually need geometry you can use the python script that comes with LightWave that converts instances to geometry.

jeric_synergy
09-11-2013, 07:51 PM
Just to show the limits of text descriptions (really, howzabout a PICTURE?): I pictured a table or bench with screws scattered about.

jwiede
09-12-2013, 01:31 AM
I would recommend doing this with instances. If you actually need geometry you can use the python script that comes with LightWave that converts instances to geometry.

Yeah, I tend to agree with this approach. Replicating geometry in that way within an object seems inefficient and needlessly difficult to manage, at least while still in the scene setup stage. Is there a reason you chose to implement the screws as parts within an object, instead of as discrete, instantiated entities?

Surrealist.
09-12-2013, 07:10 AM
Well, I'll speak up on that one. It is mainly because using Layout is inconvenient. And because when modeling in LightWave you are "programed" to accept that the "advantage" is that the modeling environment is separate. Therefore you do all of your modeling in "Modeler". The reality is that Modeler is only a mesh edit tool within the clunky interface of two programs that should be one. And here is a classic example. And it is like being forced to do all of your modeling in component edit mode in unified apps. And so it goes. However, when you include Layout as a modeling tool the other half of the equation is introduced. You know have manipulation of the object as separate from the mesh data (as it should be) and all of the advantages of rendering, instancing, replacing objects, deform tools, constraints, rigging; the ability to transform the object shell as a container for the mesh data; the ability to (going back into Modeler) swap out mesh data from object to object (layer to layer) and maintain the object container position and orientation. This list could be expanded.

But, no. There are so many advantages to keeping the modeling application separate as one is taught based on technology that was introduced 2 decades past.

And while Layout is there to be used, it is far too inconvenient for most tasks not to say clunky and impractical. And many of the tools in Modeler fool you into thinking this is the best place to do all of this stuff when it is not. Because these tools are merely hacks for lack of the proper way to go about it in the first place.

tcoursey
09-12-2013, 09:26 AM
We'll you never know what things might change through the progress with a client but like others have stated instances are perfect for this situation. You place a small rotated aligned peice of geometry to "locate" the screw and then in layout you can "attach" any screw geometry you want. Changing it out easily in the future or mixing in other screw types to give it a different kind of look. Hope you find a good solution...

jeric_synergy
09-12-2013, 10:49 AM
That level of foresight is rare indeed..... although a couple of bouts of "client mind" will certainly make one more wary.

MEANWHILE, we really got nothing for the OP, do we?

+workflow?: would using Instances necessitate ping-ponging between LWM and Layout to correctly tweek the instance placeholders?

tcoursey
09-12-2013, 11:31 AM
That level of foresight is rare indeed..... although a couple of bouts of "client mind" will certainly make one more wary.

MEANWHILE, we really got nothing for the OP, do we?

+workflow?: would using Instances necessitate ping-ponging between LWM and Layout to correctly tweek the instance placeholders?

Yea I don't think there is an easy fix for the OP. And no ping ponging that I can think of. I use a place holder of sorts with a short edge and then in layout tell the instances to align (rotation) with the short edge. It works great. Then I can layout my objects that need special aligning in modeler and not worry in layout.

jeric_synergy
09-12-2013, 05:31 PM
I'm not fully up to speed on Instaqncing: the ping-poning I was anticipating was dealing w/client tweek requests.