Notifications
Clear all

[Closed] Looking for unusual scale tool

Light,

thank you. That’s basically what I was hoping for, but I guess the topology isn’t correct or something, here’s what mesh I get after the script:

there’s not much I can do about it right? Although it does work if I select just two tris, sometimes more than 2 and it still works ok, but that’s an exception rather than a rule, it always comes out like it’s shown in the pic.

Neithertheless, that’s already something! I thank you all for the help, if you have any other suggestions I’d really appreciate that.

Oleg

OK, try this:

Open Pola X > Length and select a diagonal edge you want to remove and press “?” and “=”. This should select all diagonal edges that are equal in size to the first one you have selected.

Light

Okay! That’s already better, though few edges were selected that way, so I’ve chosen to select by range (from-to) and that worked better Thanks for that!

Glad it worked for you! You can also do that by selecting 2 edges and pressing “@” which would define a range on the fly.

Light

In a case like that one, it would not be easier to modify original script ? …

Instead of to calculate the vector the vector based on the edge which contains 2 faces, it would be more interesting to calculate the perpendicular of the 2 open edges (in face plane)

I am not familiar with this kind of calculation but I am sure that it is easy for a good programmer.

you got me interested again
yea, the more I use the scripts the more I understand how powerful they are, pretty much anything can be done, even such unusual task, but then again, I’m good at setting unusual tasks Too bad I’m not a Max scripter nor am I a good modeler… but am a programmer :rolleyes: Without knowing 3dsmax inside out, my programming skills do not help me write scripts for 3dsmax, cause that’s just completely different…

Here is a modified version of bobo script.
His name is OffsetVertsByEdge2 and you will find it in the same category (Bobo’s Polytools).
I hope it does what you wish.
That seems correct.

macroScript OffsetVertsByEdge2 category:"Bobo's Polytools"
(
global OffsetVertsByEdges2
global thePairsArray=#()
on isEnabled return selection.count == 1 and subObjectLevel == 1 and classof selection[1] == Editable_Poly 

on execute do
(
theObj = selection[1]
thePairsArray = #()
theVerts = polyOp.getVertSelection theObj 
for v in theVerts do
(
	theEdges = polyOp.getEdgesUsingVert theObj v
	theEdgesToUse = for edge in theEdges where ((polyOp.getFacesUsingEdge theObj edge) as array).count == 1 collect edge
	theOtherEdgesToUse = for edge in theEdges where ((polyOp.getFacesUsingEdge theObj edge) as array).count == 2 collect edge
	if theOtherEdgesToUse.count > 0 then
	(
		theFullVector = [0,0,0]
		for edge in theEdgesToUse do
		(
			v1a=polyOp.getVert theObj v
			theVerts=(polyOp.getVertsUsingEdge theObj edge)as array
			if theVerts[1]==v then v1b=polyOp.getVert theObj theVerts[2] else v1b=polyOp.getVert theObj theVerts[1]
			v1=v1b-v1a
			theVerts=(polyOp.getVertsUsingEdge theObj theOtherEdgesToUse[1])as array
			if theVerts[1]==v then v2b=polyOp.getVert theObj theVerts[2] else v2b=polyOp.getVert theObj theVerts[1]
			v2=v2b-v1a
			theFullVector+=normalize (cross v1 (cross v1 v2))
		)	
		append thePairsArray #(v, polyOp.getVert theObj v, theFullVector )
	)
)--end v loop	

try(destroyDialog OffsetVertsByEdges2)catch()
rollout OffsetVertsByEdges2 "ScaleVertsByEdges2"
(
	spinner spn_scale "Offset:" range:[-100000.0,100000.0,0] fieldwidth:70 type:#worldunits
	on spn_scale changed val do
		for i in thePairsArray where length i[3] > 0.0 do
				polyOp.setVert $ i[1] (i[2] + (normalize i[3])*val)
)

createDialog OffsetVertsByEdges2 
)--end on execute


)--end script

Hope this helps

wow!! amazing stuff 😮
Thank you, prettyPixel! That’s 100% what I needed!
:bowdown: :bowdown: :bowdown:

Thank you all guys for the help, long live CGTalk and its members
:wavey:

Oleg

Page 2 / 2