Introduction to Maya - Modeling Fundamentals Vol 2
This course will look in the fundamentals of modeling in Maya with an emphasis on creating good topology. It's aimed at people that have some modeling experience in Maya but are having trouble with complex objects.
# 1 06-03-2006 , 12:41 AM
Falott's Avatar
Registered User
Join Date: Jan 2005
Location: vienna
Posts: 1,095

snapVertsToZero_X.mel

I´ve been working on this for some time now and finally got it working yippeee!




// snapVertsToZero_X.mel
// this script selects borderVerts and snaps them to 0 on x-axis
// select your object and execute

global proc snapVertsToZero_X(){
ConvertSelectionToVertices;
SelectPolygonSelectionBoundary;

// filter selected points
string $selVerts[] = `filterExpand -fullPath 1 -expand 1-sm 31`;
string $vtx;

//select each vertex in array
for ($vtx in $selVerts){

//and snap it to x-axis
setAttr ($vtx + ".pntx") 0;

}
}


everything starts and ends in the right place at the right time.

Last edited by Falott; 07-03-2006 at 04:47 PM.
# 2 08-03-2006 , 09:59 AM
skywola's Avatar
Registered User
Join Date: Jan 2004
Location: Tempe, Arizona, USA
Posts: 224
This brings to mind a question I have had for some time, it must be a specific setting in Maya that I am unaware of, but it use to be, if I was using the snap to grid function, and I had for example 3 vertexes that are not aligned with each other, and I want to snap them all to the grid, I would could select them all, hit the "w" key and move them and they would ALL line up to the grid, despite the fact that they were offset from each other.

However, if I try that now, it does not work that way anymore . . . only one vertex snaps to the grid, and the other ones remain offset. . . . So I have to select each individual vertex to get the thing lined up to the grid . . . uhhhh! . . . :headbang:


"The Sage as an Astronomer: If you still see the stars as something above you, you lack the eye of knowledge." Friedrich Nietzsche
# 3 08-03-2006 , 10:22 AM
Falott's Avatar
Registered User
Join Date: Jan 2005
Location: vienna
Posts: 1,095
since I can remember, this never worked for me. whenever selecting offsetted vertices, I always thought that the selGroups pivotpoint snaps to grid. maybe writing a tool would be fun.


everything starts and ends in the right place at the right time.
# 4 08-03-2006 , 10:36 AM
Falott's Avatar
Registered User
Join Date: Jan 2005
Location: vienna
Posts: 1,095
I would try to scale the selected group of vertices in the specific axis needed down to zero, and in the next step snap them all to grid, or something like that?


everything starts and ends in the right place at the right time.
# 5 08-03-2006 , 10:41 AM
skywola's Avatar
Registered User
Join Date: Jan 2004
Location: Tempe, Arizona, USA
Posts: 224
That's a two-step process, but I guess it is a solution! I checked the preferences, and could not find any way to modify settings there, I was just thinking that there might be some setting you can change, because in earlier versions of Maya I was a ble to do it.


"The Sage as an Astronomer: If you still see the stars as something above you, you lack the eye of knowledge." Friedrich Nietzsche
Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off