ScriptSpot

Forum topic · Scripts Wanted

Target Align Vertex

By asymptote · 2010-09-07

Downloads
Description

I was wondering if it would be possible to use the target weld process to target align ?

I've been given a script by Daniel Swahn over at the Area forums, he's happy for his script to be modified as long as credits are provided.(file attached)

I'm asking here because I don't know maxscript, but see how this script might be improved.

All it needs is the target weld process combined with the axis constraints, only aligning, not welding. ie, click first vertex (copy) click second vertex (paste).
Currently I have it set to hotkeys, which is fine but targeting would be a breeze to use.
Here's a vid of the process, you can see how i got the targeting idea.

http://www.youtube.com/watch?v=exXrkx1-fxo

thx

Comments (13)

asymptote · 2010-09-18

"so would you say it'd be better working in subObject mode than on top level?"

No....as long as the verts being manipulated are visible, and it doesn't affect the procedure,  I don't see a need.

(maybe an option to use subobject mode?...I suppose the verts will be more visible.The snap procedure works independent  of the sub object mode..ie: it has no influence..it works in both)

If you use a procedure like the "Snap" cross...but the pointer as  green circles or points I don't think sub-object mode is necessary, and imho it's cooler working without sub-object ;)
This script definitely need the precision of the snap...at the moment it's very vague which vert is under the mouses influence. (I have noticed that the snap cursor disappears when your script is activated)

it might also be good for this one to put the RO into the ePoly mod interface

Hell no!..there's enough buttons there already.....much better to have it's own floating dialogue :)

Hope you can see these pics alright , this forum is a real pita ;) Just Right click and save as ... I had to resize them

Graph · 2010-09-18

so would you say it'd be better working in subObject mode than on top level?

ive got a few ideas for that with selection change callbacks but gotta check if there are sum for subObj mode
it might also be good for this one to put the RO into the ePoly mod interface

i could also do a permaUpdate and highlight the vert thats gonna be influenced in the same way i highlight the targetVert atm, so you'd be selecting the targetVert and then whenever you'd move your mouse over the object it'd highlight the closest vert to the mouse, you click and dun.

nice vid :)

JokerMartini · 2010-09-17

Very cool script. I'd agree it seems a bit corky and not very user friendly and intuitive. Great script starting point.

asymptote · 2010-09-17

Neat script, this is some pretty cool coding.....
I do find it a bit fiddly to use tho' It's not always apparent which vertex is being influenced. The only thing I can suggest is a cursor similar to the "Snap" cursor for more precision.
Also noticed that It only works on faces with normals pointing towards you.
Early days yet tho' this thing can only get better :)
I've upped a vid to youtube to show this thing off

http://www.youtube.com/watch?v=_Bf3hE6SrUM

PS Anyone know how to embed youtube in this forum ??

Graph · 2010-09-16

grant your flash uploader crashes the submit in opera

now on topic

how to use:
run script
select poly object
activate
(
select targetVert
select vert to influence
--somewhere inbetween select the axes to influence/align
next itteration
)

to select a vert click on a polygon, the vert closes to where you clicked will be used
the targetVert if selected successfully will be marked by a green circle
you dont need to be in subObject mode or modify mode

http://insanto.3d.lc/toolsIndex/files/Target%20Align%20Vertex.mse

have phun

asymptote · 2010-09-14

Cool Insanto, glad there's progress on this, I've been having trouble connecting with skype, hope to get it sorted soon.

JokerMartini · 2010-09-14

Any word on an update on this?

Graph · 2010-09-10

dont worry ill have a neat and easy to use tool by tomorrow
just gotta cross some Is, dott the Ts

asymptote · 2010-09-08

Yup ..editable poly.

It was just an idea to avoid going through the process of setting up the snaps switching views ...then 2.5d aligning.

Original thread where it was discussed is here ...

http://area.autodesk.com/forum/autodesk-3ds-max/modeling/copy--paste--ve…

I just don't like to be dragged away from the viewport to faff around with the UI.
Daniel Swahn's code is great , but I thought it needed fine tuning ;)

But my Maxscript skills are...enable macro-recorder, record, drag to toolbar. :)

Graph · 2010-09-08

oh lol
something like that is easy
for editable polys?

asymptote · 2010-09-08

I forgot to add the link to the video.
I wouldn't know what to do with that code, I don't know maxscript. ;)

Emphasis on...."I'm asking here because I don't know maxscript, but see how this script might be improved." :)

Graph · 2010-09-08

so you want target welding without welding?

basically this: (with then aligning the verts (for poly or mesh))


(
	
	
	
		fn pickVert obj = 
		(
			local closestVert
			local closestPos 
			
			theRay =mapscreenToWorldRay mouse.pos
			
			theInt = intersectRay obj theRay
			
			 if theInt != undefined do
			 (
				local pt = theInt.pos
				local msh = snapshotAsMesh obj
			 
				local closestDist = distance pt (getVert msh 1)
				
				
				for i = 2 to msh.numVerts do (
					local vPos = (getVert msh i)
					local dist = distance pt vPos
					if dist < closestDist do (closestDist = dist ; closestVert = i; closestPos = vPos)
				)
				
				delete msh
				
				--return closestDist
				
			 )
			 #(closestVert, closestPos)
		)	
	
	pickpoint()
	local vert1 = pickVert $Box002
	
	
	pickpoint()
	
	local vert2 = pickVert $Box002
	
	format "align vert % at vert %'s position\n" vert1 vert2
	
	
)

JokerMartini · 2010-09-09

This does not seem to be working for me. How do i use this? Does there have to be an existing selection of a vertex in the subobject level?
Is it possible to add the Rubberband on the cursor so its more like the target weld?