How can I query an edge if it's soft or hard?
polySoftEdge -q -a; //doesn't give me anything
I've had similar problems when querying before; it just prints the command... ? Please help me.
Claes
How can I query an edge if it's soft or hard?
polySoftEdge -q -a; //doesn't give me anything
I've had similar problems when querying before; it just prints the command... ? Please help me.
Claes
Ok, just found this in a script by Sean Dunn:
proc int GetEdgeHardness(string $edge)
{
// Holy [censored] hell. Hack.
//
polySelectConstraint -dis;
select $edge;
polySelectConstraint -m 2 -t 0x8000 -sm 1;
string $selList[] = ls -sl;
int $edgeHard = 0;
if(size($selList) > 0)
{
$edgeHard = 1;
}
polySelectConstraint -dis;
select -clear;
return $edgeHard;
}
It's that hard huh?
yeah its poly edge softness is a weird one... if you have a look in the connection editor, each edge has a .edgh attribute. unfortunately, when you try to do a getAttr on it, maya gives you an error, and plugging the attribute into anything else, yeilds a constant value of zero... pity it doesn't work, because it would be a cool way to get the hardness attrib of an edge.
I trhink it sometrhing else than that... i think its becuse there are no such things as soft edges... only unified normals (since edges dont realy have an soft option internally, in maya as far as i understand things), which reside at the vertices and face midpoints. So an edge would be soft if both the vertex normals are unified... So you should querry that.
hmmm, v.good point. however, it makes you wonder what exactly the .edgh attribs are for... ![]()
Maybe its some remains on something they were meant to implement?!? ![]()
But im pretty sure maya smoothing doesent work on edges like say max does!
If you make a simple poly object, say two faces and look at the file in ascii you can see in the poly node that edge attributes are not there at all. What is there are normal descriptions.
Yeah that figures since the smoothing isnt dependent on that info at all... maybe its a totaly unused flag? but you could check this yourself if you wish... just check the verices at both ends and if they are unified in a special way then its smooth!
Just came across this thread as I'm messing with normals in Maya 2013. I'm not sure how it looked back in 2002, but in a Maya 2013 Ascii file, the edge hardness is recorded.
In amongst the mesh data, you'll see a field like this:
setAttr -s 20 ".ed[0:19]" 0 1 1 2 3 0 4 5 0 6 7 0 8 9 1 10 11 1 0 2 0 1 3 1 2 4 0 3 5 0 4 6 0 5 7 0 6 8 0 7 9 0 8 10 1 9 11 1 10 0 1 11 1 1 9 3 1 8 2 0;
That's edge data for 20 edges. Each edge has the indices of two verts, followed by either '1' (soft) or '0' (hard/open).
Vertex normals are recorded like this:
setAttr -s 25 ".n[0:24]" -type "float3" 1e+020 1e+020 1e+020 1e+020 1e+020 1e+020 1e+020 1e+020 1e+020 -0.70999998 -0.70999998 0 -0.70999998 -0.70999998 0 1e+020 1e+020 1e+020 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 0 0 1 1e+020 1e+020 1e+020 -0.70710677 0.70710677 0 1e+020 1e+020 1e+020 1e+020 1e+020 1e+020 0 0 1 0 0 1 -0.70999998 -0.70999998 0 -0.70710677 0.70710677 0 -0.70999998 -0.70999998 0 0 0 1 0 0 1;
Where '1e+20' appears to mean that the vert normal is unlocked. Incidentally this object has 12 verts, so Maya is storing normals independently of the verts. It looks like the normals are listed in the same order as the verts, with one normal per vert, then extra normals are added at the end of the list.
Going off topic now...
the next field seems to be face data:
setAttr -s 10 -ch 40 ".fc[0:9]" -type "polyFaces"
f 4 0 7 -2 -7
mu 0 4 0 1 3 2
f 4 1 9 -3 -9
mu 0 4 2 3 5 4
f 4 2 11 -4 -11
mu 0 4 4 5 7 6
...
Each face has an 'f' line and an 'mu' line.
The 'f' line seems to reference the edges. The first number might be the number of edges; the others are edge indices. Sometimes they're negative, in which case they're -( + 1). For example, edge number 17 is recorded as -(17+1) = -18. So a line 'f 4 0 7 -2 -7' means a face with the 4 edges, 0, 7, 1 and 6. I don't know why. I noticed that each edge appears once normally and once in the negative format. The order of edges on a line appears to indicate the direction of the face.
The 'mu' line in my test example seems to reference the uvs. Mine all start with 'mu 0 4' and then 4 numbers that I assume are UV indices, although I haven't verified.
I'm not sure how vert-faces reference normals.
Oh, and after all of that, I still don't know how to actually ask Maya if the edge should be smooth. I just convert each end to vert-faces and see if they all point in the same direction.