Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk 3ds® Max® / SDK / Problem with "Edit Normals" modifier
  RSS 2.0 ATOM  

Problem with "Edit Normals" modifier
Rate this thread
 
33833
 
Permlink of this thread  
avatar
  • qwas-
  • Posted: 31 August 2009 02:04 AM
  • Total Posts: 8
  • Joined: 17 August 2009 08:28 AM

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 (int i 0numVertex; ++i) {
    RVertex
rv mesh.getRVert(i)

    
if (rv.ern) {
        
for (unsigned int n 0(rv.rFlags NORCT_MASK) ++n) {
            
// Add vertex in list
            
normals.push_back(rv.ern[n].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?



Replies: 1
/img/forum/dark/default_avatar.png

The solution is here: http://dl3d.free.fr/phpBB2/viewtopic.php?t=1166

Author: qwas-

Replied: 31 August 2009 07:46 PM