PDA

View Full Version : move component tool


OmegaN
08-30-2006, 05:38 PM
Hey!

I want to make the move component tool a little smarter. All I want is to be able to move like faces in its normal direction fast. Right now i press and hold a hotkey for activating the tool and then i need to find the little translator to move in the Z direction wich is not very fast, AND this tool makes a history node wich i dont want. If i press MMB directly it will not only move in Z as you may know.

Is there a way to make a MEL that constraints my movement to Z while im holding my hotkey so I just can move with my MMB fast and easy without need to find and click that darn Z axis, and without the history node =) I played a little with the polyMoveFacets command but i dont really know how to do this.

OmegaN
08-30-2006, 07:27 PM
oh should add that i have read through the preformPolyMove mel file but didnt find what i was looking for, i think atleast as im not that pro at mel hehe =)

GennadiyKorol
08-30-2006, 08:17 PM
Hi, nice to see people customizing maya like that :)

As for your question, since this node uses its own manipulator, I didn't find a way to set its currently active axis ( could be done for move/rotate/scale tools though).
So instead you could just lock the local translate X and Y attributes of the node and drag with mmb or lmb as you like, only Z axis will be affected :)

Here's how it could look like:

string $moveFaceByNormalNodes[];

// creating the move facet node for selected faces
$moveFaceByNormalNodes = `polyMoveFacet -ch 1`;

// add the nodes to current selection for show manip tool
select -add $moveFaceByNormalNodes;

// set tool to show manipulator tool
setToolTo ShowManips;

string $node;

// for every node lock its local translate X and Y
for ($node in $moveFaceByNormalNodes){
setAttr -lock 1 ($node + ".localTranslateX");
setAttr -lock 1 ($node + ".localTranslateY");
}

For total nicety you could hide the manipulator by giving it a very small size with manipOptions command. Then you could set up a script job that will restore the previous manip size right after you'd change your selection :)

Hope it helps,
Henry

OmegaN
08-30-2006, 08:52 PM
Mr.Hawk saves the day AGAIN :D thx a bunch man it worked nicly and with "hiding" the manip it cleaned up the viewport of the growing number of manips =)

You dont know if theres any way I can kinda "collapse" the nodes transformations and delete the node. Like deleting history but only these nodes. The only thing i need the history node is for its localTranslate update when im moving my polys. Because if i move this way a few times the history gets kinda cluttered with polyMoveFace nodes =)

GennadiyKorol
08-30-2006, 09:14 PM
Depends on how you want it to work. For simple things like this one it's possible.
You'd have to write a mel that will read translated face's vertex positions. Then you can delete the node and use move or xform command to put vertices to their stored places.

OmegaN
08-30-2006, 09:36 PM
ah ok thx but it sounds to advanced for me =) but im happy anyway since i got that normal going smooth now on all my selections. Just smart highlighting with preselections thats missing now in maya and I will be satisfied with the modeling :)

GennadiyKorol
08-30-2006, 09:47 PM
Here it goes:) Hope comments will explain it.
Just attach this procedure to the clean up procedure on script job, that restores manipulator sizes:)

// to make things cleaner, remember the current face selection
string $selection[];
$selection = `filterExpand -sm 34`;

string $vertices[], $vertex;
// getting all the vertices contained in the current selection
$vertices = `polyListComponentConversion -tv`;
$vertices = `filterExpand -sm 31 $vertices`;

// create a vector array to store vertex positions
vector $positions[];

float $pos[];
int $i = 0;
// for each vertex - get's it's world position and store in the array
for ( $vertex in $vertices){
$pos = `pointPosition $vertex`;
$positions[$i] = <<$pos[0], $pos[1], $pos[2]>>;
$i++;
}

// delete the move facet node
delete $moveFaceByNormalNodes;

// now restore the vertices to their stored positions:
$i = 0;
for ( $vertex in $vertices){
$pos = $positions[$i];
move -a $pos[0] $pos[1] $pos[2] $vertex;
$i++;
}

// restore the face selection that was reset by the delete operation
select -add $selection;

Hope it helps :)
Prehiliting already works and I need some devoted beta testers, if you're interested - PM meh :)

OmegaN
08-31-2006, 02:26 PM
-- edit, oups double post

OmegaN
08-31-2006, 02:31 PM
thx man, i only have problem with the script that its adding a polytweak node instead and i dont know why. i dont use a scriptjob now, i just have the code under my hotkey that when pushed i make the manip small and locks the x,y axis and then when released i have the other script you wrote wich deletes the polymoveface node. any ideas why i get this polytweak node? :argh:

GennadiyKorol
08-31-2006, 02:40 PM
So you're kinda using the sticky hotkey setup:) I once wrote an article for customizing maya for modeling stuff for one book, hope to translate it and put on my site once I get my rights back on it :)

And about the poly tweak node, it's there cause I kinda tweak the geometry with that script by move command. I think you should be okay with that tweak node, since all the tweaks you perform further fill fall into this one. Also a delete history, freeze transforms and center the pivot should long time be on your marking menu :) Don't be aware of small nodes, they aren't evaluated there all the time:)

Cheers,
Henry

OmegaN
08-31-2006, 03:00 PM
ah ok, i discovered that the tweak node only appears if move something before i press the hotkey, eather if i move with the script or if i just move regulary and its only adding a new node when pressing the script hotkey. it kinda gets 20+ tweak nodes after a while, but thats nothing to worry about or? im not totally used to all the nodes in maya yet , (comes from max originally) and is kinda paranoid that having a cluster of history nodes will make my mesh buggy with undos or something like that hehe.

that article sounds interesting =) Its fun customizing but i would rather have the functions from the start in maya so i could concentrate on the modeling hehe ;D

OmegaN
09-01-2006, 11:13 PM
instead of posting a new thread i just add my question here =) :

i want to edit the RMB marking menu thats pops up when right clicking over a poly/nurbs etc that lets me select my faces,edges and so on when in object mode.

I just want to add center pivot and delete history on these MM =) I have read trough the different contextPolyTools MM and the ModelEdMenu but i cant find these menus. Am i just looking at the wrong place?

I have also tried the zootriggered script but that just adds menus for a specified object.

cpan
09-02-2006, 06:05 AM
it's the scripts/dagMenuProc.mel that handles the dag context menu.

OmegaN
09-02-2006, 09:30 AM
thx man , worked great =) btw thx for the context sensitive menus, they saved me a bunch of time trying to do it myself for nurbs etc :)

CGTalk Moderation
09-02-2006, 09:30 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.