Message 1 of 2
Problem with "Edit Normals" modifier

Not applicable
08-31-2009
06:04 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, I have some problems with getting normal data when modifiers pipeline contains "Edit Normals" modifier.
I am using such code to apply all modifiers and get normal data:
The problem is that normals obtained this way are not modified by "Edit Normals" modifier. However, rest of the modifiers works correctly. What am I doing wrong?
I am using such code to apply all modifiers and get normal data:
// apply all modifiers
ObjectState os = node->EvalWorldState(getTimeOfExporting())
Object* object = os.obj;
...
//Build normals if needed
if (!mesh.normalsBuilt) {
mesh.checkNormals(true)
}
...
//Find all normals
int numVertex = mesh.getNumVerts()
for (int i = 0; i < numVertex; ++i) {
RVertex& rv = mesh.getRVert(i)
if (rv.ern) {
for (unsigned int n = 0; n < (rv.rFlags & NORCT_MASK) ++n) {
// Add vertex in list
normals.push_back(rv.ern.getNormal())
}
} else {
normals.push_back( rv.rn.getNormal())
}
}
The problem is that normals obtained this way are not modified by "Edit Normals" modifier. However, rest of the modifiers works correctly. What am I doing wrong?