Problem with "Edit Normals" modifier

Problem with "Edit Normals" modifier

Anonymous
Not applicable
249 Views
1 Reply
Message 1 of 2

Problem with "Edit Normals" modifier

Anonymous
Not applicable
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:

// 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 &#40;int i = 0; i < numVertex; ++i&#41; {
RVertex& rv = mesh.getRVert&#40;i&#41;

if &#40;rv.ern&#41; {
for &#40;unsigned int n = 0; n < &#40;rv.rFlags & NORCT_MASK&#41; ++n&#41; {
// Add vertex in list
normals.push_back&#40;rv.ern.getNormal&#40;&#41;&#41;
}
} else {
normals.push_back&#40; rv.rn.getNormal&#40;&#41;&#41;
}
}

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?
0 Likes
250 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
0 Likes