u can snap all vertice to the position of single vertice by holding v first the moving on a single axis (holding v is shortcut to some snap setting i forgot what it was) be sure to try it with a simple box first than u will get the concept just dont select the vertices u want to snap to
EDIT: List comprehensions to reduce amount of rows. I.e. a bit prettier ^^ ---------------------------------------------------------------------------------------------------------- I couldn't resist Only works with world space axises. Not sure if this is useful to you or not.
Average or the number series [0,1,1,10] is (0+1+1+10)/4 = 12/4 = 3. Scaling would be halfway between 0(the smallest numer) and 10(the largest number), 5.
Polygons current average what? The script i wrote averages currently selected vertices position in x/y/z(depending on what you choose when calling the function).
Average or the number series [0,1,1,10] is (0+1+1+10)/4 = 12/4 = 3. Scaling would be halfway between 0(the smallest numer) and 10(the largest number), 5.
Sorry mate, but I was more thinking along the lines of an artist. Unless modeling for micro-millimetre tolerances I don't think too many people modeling in Maya are going for mathematical perfection.
All I'm saying is there's a difference between an average value and a mid point value, and it's not necessarily "micro-millimeter tolerances" and "mathematical perfections".
No it works on vertices. But like I mentioned, converting selections in Maya is easy. You have a foldout menu for this under Modify. Or just ctrl+f9/f10/f11/f12. Actually I think the script does produce some result if you were to run it with faces selected. I managed to do this myself by mistake and oddly enough it produced the wrong result at that time. If I had continued working on the script I'd add error handling that would tell the user to select vertices if the user had anything other than vertices selected.
Did you look at the video? I show how you can use the script. You could just append the function call at the end of the script and store it as shelf buttons if you prefer that way.
I think the message you posted is because you didn't add the parenthesis after the function name. planarAverage <- Should produce the message you posted planarAverage() <- Should run the script as intended. Defaults to X-axis if you don't use any arguments. planarAverage('x') / planarAverage('y') / planarAverage('z') <- Should run the script on the x/y/z axis.
I want the script to read the polygon average as it is when selected and average all the polygons selected based on faces selected average. Instead of as your script and others, which is averaging based on an axis.
I want the script to read the polygon average as it is when selected and average all the polygons selected based on faces selected average. Instead of as your script and others, which is averaging based on an axis.
Check out the @Funky Bunnies script that @Joopson linked, it seems to do what you are looking for with the best plane command.
Can you maybe describe what you want a little better? I thought I knew what you were looking for, but now, I'm really not sure. Maybe some visual aids to help explain, because as far as I can tell, that script does what you've been describing. So if it's not what you're looking for, you're not describing it well enough for us to help you properly.
Look at Kodde video; in the video there is curved geometry.
If there is a edge loop around one of the peaks of the curves; I want to average all the polygons in the loop, that doesn't mean, I want to average them based on an X, Y or Z axes I want to average them based on the polygons individual angle.
Look at Kodde video; in the video there is curved geometry.
If there is a edge loop around one of the peaks of the curves; I want to average all the polygons in the loop, that doesn't mean, I want to average them based on an X, Y or Z axes I want to average them based on the polygons individual angle.
Sorry I still don't follow. Just saying that you want to average them isn't descriptive enough for me in this case. I need to grasp what it is you want to average, what attribute/property? I was wrong about you wanted earlier.
Do you mean that the selected faces are the ones that should assume an average rotation/position based on their neighboring faces(not selected)? If so it sounds like the already existing Maya command Average Vertices to me.
I'm sure many of you have encountered where you have polygons that are non-planar, to some they wouldn't care. Moving those polygons along an axis will deform the object, not a desired method.
Usually those polygons will simply require slight movement; doing this manually causes a domino effect whereas other polygons become non-planar. If there isn't a way to make the selected polygons, keep their position but make them planar; well I'll have to live with it
Oh, make each individual quad planar? I imagine that could potentially change the shape of the mesh quit a lot, at least in certain circumstances. I'd be interested in seeing if such a thing can be done though; planar quads look so clean. I suppose you could run the @Funky Bunnies script on each separate face, using the best plane setting, but that would suck if you had anything with any real number of polygons, and besides, each face you make planar would probably make the faces around it non-planar again. It would be like trying to empty a pond with a teacup.
Wow, yeah making all quads on a given mesh planar would be next to impossible. My head starts to hurt when I think about making something spherical all planar quads.
Blender has this functionality built-in. If you care about having all planar polygons in your mesh you can take it over there, run the Make Planar Faces operation, and take it back to Maya.
If you want to flatten based on the vertices average normal, just select the vertices you want to do that, select the scale tool, on the tool options choose normals average, then just scale, they will flatten on the chosen axis that is rotated to face the selection average normal.
If you want all polygons on your mesh to become planar... Triangulate it.
Other than that, it's not really feasible to do that without your mesh's shape drastically shifting, if it's possible at all. The domino effect you mentioned would just work in reverse, forcing vertices to move out of place across your entire mesh in order to settle into a planar arrangement respective to all other polygons.
Monkey after 5 iterations of flattening, triangulated
Is the shape different? You be the judge. It can't flatten every face because of the mesh density and odd topology, but it's loads better than the initial mesh and can usually get the faces to be around 95% planar. If you modeled your mesh well enough with enough resolution I bet it would barely change the shape at all.
The only thing about this operator is that it doesn't weight face averages by the area of the face, so it can behave poorly with thin bevels. But overall, it works OK. Do your bevels after flattening faces and you'll be fine.
There must be a method to which the angle of the polygon(s) are stored then simply evened out to be non-planar, even if that means the polygon(s) are moved extremely subtle ?
If I average based on a axis, the angle you see in the image is lost; no desired. If the vertices for the polygon, or polygons can be stored then averaged based on the vertices world position ?
Replies
This forum needs an option where as you can have in the corner the software you primarily use.
Or select the verts/edges/faces and scale until flat.
In Zbrush you can also scale until flat with the transpose line or transpose move along the local normal and use the clipping brush.
Yes ? I hope that is the correct terminology.
Well then all the options posted above will do that, either based on viewing angle or x/y/z
what software specifically?
Scaling doesn't give an average, it gives a mid point between min and max.
(holding v is shortcut to some snap setting i forgot what it was)
be sure to try it with a simple box first than u will get the concept
just dont select the vertices u want to snap to
http://polycount.com/discussion/54500/maya-make-planar-tool
----------------------------------------------------------------------------------------------------------
I couldn't resist
Only works with world space axises. Not sure if this is useful to you or not.
import maya.cmds as cmds
Sorry missed the Maya mention
pedantics aside, scaling in an axis is still effectively 'averaging' the position of the geo.
Average or the number series [0,1,1,10] is (0+1+1+10)/4 = 12/4 = 3. Scaling would be halfway between 0(the smallest numer) and 10(the largest number), 5.
Funky Bunnies' FB Poly Planarize script for Maya. He actually has a bunch of awesome scripts, besides that one, too.
It allows you to snap all selected vertices to a particular plane, or a "best plane" which is essentially the average direction of the verts.
http://www.funkybunnies3d.com/tools.php
The script i wrote averages currently selected vertices position in x/y/z(depending on what you choose when calling the function).
Kodde, I tried your script on some vertices, set the scene to world space and nothing happened ?
I ran the script on both and when the script is run on vertices I get this error;
Did you look at the video? I show how you can use the script.
You could just append the function call at the end of the script and store it as shelf buttons if you prefer that way.
I think the message you posted is because you didn't add the parenthesis after the function name.
planarAverage <- Should produce the message you posted
planarAverage() <- Should run the script as intended. Defaults to X-axis if you don't use any arguments.
planarAverage('x') / planarAverage('y') / planarAverage('z') <- Should run the script on the x/y/z axis.
Check out the @Funky Bunnies script that @Joopson linked, it seems to do what you are looking for with the best plane command.
If there is a edge loop around one of the peaks of the curves; I want to average all the polygons in the loop, that doesn't mean, I want to average them based on an X, Y or Z axes I want to average them based on the polygons individual angle.
http://www.youtube.com/watch?v=2va7YCsbMDE
Do you mean that the selected faces are the ones that should assume an average rotation/position based on their neighboring faces(not selected)? If so it sounds like the already existing Maya command Average Vertices to me.
Usually those polygons will simply require slight movement; doing this manually causes a domino effect whereas other polygons become non-planar. If there isn't a way to make the selected polygons, keep their position but make them planar; well I'll have to live with it
I suppose you could run the @Funky Bunnies script on each separate face, using the best plane setting, but that would suck if you had anything with any real number of polygons, and besides, each face you make planar would probably make the faces around it non-planar again. It would be like trying to empty a pond with a teacup.
Other than that, it's not really feasible to do that without your mesh's shape drastically shifting, if it's possible at all. The domino effect you mentioned would just work in reverse, forcing vertices to move out of place across your entire mesh in order to settle into a planar arrangement respective to all other polygons.
Monkey after 5 iterations of flattening, triangulated
Is the shape different? You be the judge. It can't flatten every face because of the mesh density and odd topology, but it's loads better than the initial mesh and can usually get the faces to be around 95% planar. If you modeled your mesh well enough with enough resolution I bet it would barely change the shape at all.
The only thing about this operator is that it doesn't weight face averages by the area of the face, so it can behave poorly with thin bevels. But overall, it works OK. Do your bevels after flattening faces and you'll be fine.
There must be a method to which the angle of the polygon(s) are stored then simply evened out to be non-planar, even if that means the polygon(s) are moved extremely subtle ?