Notifications
Clear all

[Closed] Obj Exporter

I’m trying to replicate the output of the max 2009 obj exporter by guruware but I don’t really understand the way they are creating the vertex normal’s.

 Apparently it goes trough the vertex twice but skipping some vertex the second time, I can get the first pass correctly with this code
tmpNormArr = #()
   
     for i = 1 to meshObj.numverts do
      (
     in coordsys local normals = meshop.getFaceRNormals meshObj i
   
     for j = 1 to 3 do 
      (
      n_X = normals[j][1] 
      n_Y = normals[j][2] 
      n_Z = normals[j][3]																	 
      format "vn % % % 
" n_X n_Y n_Z to:out_file
      )
     														   
     append tmpNormArr normals										   
     )
 But I have no idea what the second pass does.  Has anyone look at it?

Guillermo Leal.

1 Reply

Upps silly error I should have meshObj.numFaces and not meshObj.numverts

Thanks anyway.

Guillermo Leal.