Issue 211 in alembic: Maya AbcExport does not preserve hard edges

92 views
Skip to first unread message

ale...@googlecode.com

unread,
Aug 17, 2011, 11:45:42 PM8/17/11
to alemb...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect FoundBy-Community

New issue 211 by shinc...@gmail.com: Maya AbcExport does not preserve hard
edges
http://code.google.com/p/alembic/issues/detail?id=211

Reproduce:
1. Create a poly cube
2. AbcExport
3. AbcImport

What is the expected output? What do you see instead?
Expected: The edges of the cube are all hard edges
Actual: The edges of the cube are all soft edges

What version of the product are you using? On what operating system?
1.0rc has no problems. This bug is new in 1.0 on all platforms.

Please provide any additional information below.
It can be fixed by checking the smoothing for all edges.
In MayaMeshWriter.cpp,302:
MPlug plug = lMesh.findPlug("noNormals", true, &status);
if (status == MS::kSuccess && plug.asBool() == true)
{
return;
}
// we need to check the locked state of the normals
else if ( status != MS::kSuccess )
{
bool userSetNormals = false;
bool hasHardEdges = false;

// go through all per face-vertex normals and verify if any of them
// has been tweaked by users
unsigned int numFaces = lMesh.numPolygons();
for (unsigned int faceIndex = 0; faceIndex < numFaces; faceIndex++)
{
MIntArray normals;
lMesh.getFaceNormalIds(faceIndex, normals);
unsigned int numNormals = normals.length();
for (unsigned int n = 0; n < numNormals; n++)
{
if (lMesh.isNormalLocked(normals[n]))
{
userSetNormals = true;
break;
}
}
}

// go through all edges and verify if any of them is hard edge
unsigned int numEdges = lMesh.numEdges();
for (unsigned int edgeIndex = 0; edgeIndex < numEdges; edgeIndex++)
{
if (!lMesh.isEdgeSmooth(edgeIndex))
{
hasHardEdges = true;
break;
}
}

// we looped over all the normals and they were all calculated by
Maya
// so we won't write any of them out
if (!userSetNormals && !hasHardEdges)
{
return;
}
}

Thanks!

ale...@googlecode.com

unread,
Aug 25, 2011, 6:54:33 PM8/25/11
to alemb...@googlegroups.com
Updates:
Labels: Milestone-1.1

Comment #1 on issue 211 by ble...@gmail.com: Maya AbcExport does not

(No comment was entered for this change.)

ale...@googlecode.com

unread,
Aug 25, 2011, 7:29:16 PM8/25/11
to alemb...@googlegroups.com

Comment #2 on issue 211 by miller.l...@gmail.com: Maya AbcExport does not

We are double checking to make sure this is the best workflow to use.

In the meantime one way to force the normals to write out is to create a
noNormals boolean attribute and make sure it is set to false. The double
negative will always generate normals.

The reason we try to avoid writing out normals when it appears that they
are default is because of a bug in some versions of Maya where loading them
back in is waaaay too slow.

ale...@googlecode.com

unread,
Aug 25, 2011, 9:20:11 PM8/25/11
to alemb...@googlegroups.com
Updates:
Status: PleaseVerify
Owner: miller.l...@gmail.com

Comment #3 on issue 211 by miller.l...@gmail.com: Maya AbcExport does not

Fix implemented here:

http://code.google.com/r/millerlucas-dev/source/detail?r=cf06a89fbeda595effb7c75dc484b357d743f822

I moved the hard edge loop check inside the check for !userSetNormals so
cases where at least one of them was changed by the user, we won't need to
do a redundant edge check. (since the normals will get written anyway)

ale...@googlecode.com

unread,
Aug 29, 2011, 1:03:22 PM8/29/11
to alemb...@googlegroups.com
Updates:
Labels: -Milestone-1.1 Milestone-1.0.1

Comment #4 on issue 211 by miller.l...@gmail.com: Maya AbcExport does not

(No comment was entered for this change.)

ale...@googlecode.com

unread,
Sep 19, 2011, 5:42:00 PM9/19/11
to alemb...@googlegroups.com
Updates:
Status: Verified

Comment #5 on issue 211 by miller.l...@gmail.com: Maya AbcExport does not

Reply all
Reply to author
Forward
0 new messages