Announcements
Due to scheduled maintenance, the Autodesk Community will be inaccessible from 10:00PM PDT on Oct 16th for approximately 1 hour. We appreciate your patience during this time.
Community
Maya Forum
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Maya Straighten Edge Tool

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
ARCL1GHT
5376 Views, 6 Replies

Maya Straighten Edge Tool

Hello,

I was wondering if anyone knew of a Maya equivalent tool/plugin to 3ds Max's 'Loop Tools' straighten edge function? To understand what I am after, please view the image attached. For further reading on the Loop Tools Dialog in 3ds Max, take a look here:

http://help.autodesk.com/view/3DSMAX/2015/ENU/?guid=GUID-C1D508AB-A3E5-4965-AAE3-4FA5EC48CA75

Thanks,

 

Brady

6 REPLIES 6
Message 2 of 7
mspeer
in reply to: ARCL1GHT

Hi!

 

There is no tool like this in Maya (as far as i know).

Message 3 of 7
Christoph_Schaedl
in reply to: mspeer

Those tools are able todo that. A bit tricky to get them working with maya2019.

https://www.highend3d.com/maya/script/zentools-for-maya

----------------------------------------------------------------
https://linktr.ee/cg_oglu
Message 4 of 7
brentmc
in reply to: ARCL1GHT

Hi,

 

You could try scaling the edges in component mode:

 

1) select edge loops or partial loops

2) activate the Scale tool

3) switch to Component mode (hold down R and left-click for menu)

4) scale to zero along desired axis

 

straighten_edges.gif

--

Brent

Brent McPherson
Principle Engineer
Message 5 of 7

Yup, zenTool's 'Curve Distribute Between Vertices' tool does the job! Set the curve type to 'CV' and distribution to 'chord length' and hit apply until straight.

 

For future readers, this is how you install the plugin:

1. Download 'Maya Bonus Tools' from here and zenTools from here.

2. Install Maya Bonus Tools by following its installation wizard.

3. Extract the compressed zenTools download. Copy the sub-folder titled 'zen' and place that in your Maya script directory.

4. After either restarting Maya or typing 'rehash' into the command line, open the script editor with a MEL textbox and type:

 

python("import zen"); evalDeferred("zenTools");

 

5. Save the script to a shelf and call it 'zenTools'

 

Clicking on the shelf's new button will open the zenTools dialogue where you can find the 'Curve Distribute Between Vertices' tool under the 'Model' drop down menu.

Message 6 of 7
ARCL1GHT
in reply to: brentmc

Thanks for your suggestion, Brent! I was actually using this method before making this post, though I found that the caveat was that if the edges were at an angle I would need to rotate the working pivot to be roughly perpendicular their orientation. Component mode helps in most cases, however if the scale tool is off angle, it will push the first and last vertices of the chain in to undesired directions. Regardless it’s a pretty good solution for those not willing to install zenTools.

Message 7 of 7

Here an other one from our TD Martin.

 

 

First install Maya Bonus Tools from here.  --> https://apps.autodesk.com/en/Detail/Index?id=8115150172702393827&os=Win64&appLang=en

 

Select the edges you like to straighten.

 

Than use this script.

{
	// Author: Martin "Sun's Skull" Posch
	// select edges and pres hotkey with this code to line them up along linear curve
	if (`pluginInfo -q -r "closestPointOnCurve"`)
	{
		if (!`pluginInfo -q -l "closestPointOnCurve"`)
		{
			loadPlugin "closestPointOnCurve";
		}
		string $elimination[];
	
		string $edges[]=`ls -sl -fl -type "float3"`;
		$edges=`filterExpand -sm 32 $edges`;
		string $slobjs[]=`ls -sl -o`;
		string $verts[]=`polyListComponentConversion -tv $edges`;
		$verts=`ls -fl $verts`;
		string $overts[]=$verts;
	
		clear $elimination;
		for ($a=0;$a<`size($verts)`;$a++)
		{
			$elimination[`size($elimination)`]=$verts[$a];
			$elimination[`size($elimination)`]=$verts[$a];
		}
		for ($a=0;$a<`size($edges)`;$a++)
		{
			$vtmp=`polyListComponentConversion -tv $edges[$a]`;
			$vtmp=`filterExpand -sm 31 $vtmp`;
	
			for ($b=0;$b<`size($vtmp)`;$b++)
			{
				for ($c=0;$c<`size($elimination)`;$c++)
				{
					if ($vtmp[$b]==$elimination[$c])
					{
						$elimination[$c]="";
						$vtmp[$b]="eliminated";
					}
				}
			}
		}
	
		$elimination=`stringArrayRemoveDuplicates($elimination)`;
		$verts=stringArrayRemove($elimination,$verts);
	
		float $dcsp1[]=`pointPosition -w $elimination[1]`;
		float $dcsp2[]=`pointPosition -w $elimination[2]`;
	
		string $dc_cpolcurve=`curve -d 1 -p $dcsp1[0] $dcsp1[1] $dcsp1[2] -p $dcsp2[0] $dcsp2[1] $dcsp2[2] -k 0 -k 1`;
		string $dc_cpolnode = `closestPointOnCurve -na "sun_dc_cpol" $dc_cpolcurve`;
	
		for ($a=0; $a<`size($overts)`; $a++)
		{
			float $dc_movp[]=`pointPosition $overts[$a]` ;
			float $dc_newpos[] = `closestPointOnCurve -ip $dc_movp[0] $dc_movp[1] $dc_movp[2] -q -p -u $dc_cpolcurve`;
			move -a $dc_newpos[0] $dc_newpos[1] $dc_newpos[2] $overts[$a]; 
		}
		delete $dc_cpolcurve;
		hilite $slobjs[0];
		select -cl;
	}
	else
	{
		warning "Please install closestPointOnCurve plugin.";
	}
	
}

 

----------------------------------------------------------------
https://linktr.ee/cg_oglu

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report