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® / 3ds Max through 2008 / Getting explicit normals
  RSS 2.0 ATOM  

Getting explicit normals
Rate this thread
 
2148
 
Permlink of this thread  
avatar
  • nedelman
  • Posted: 30 November 2007 07:02 AM
  • Total Posts: 1
  • Joined: 30 November 2007 02:55 PM

I’ve been struggling to find a good, reliable way of extracting normals from a mesh that were explicitly specified using the Edit Normals modifier.

The problem is that these normals do not appear to pass through to the Mesh that is created as a result of converting a node’s Object to a TriObj. I’ve tried getting the normals using the IEditNormalsMod interface (after searching for the appropriate modifier) and while this works sometimes, there are a few shortcomings:
1)The mesh’s node needs to be selected.
2)The ‘modify’ panel needs to be visible.
3)If I force steps 1 and 2 using GetCOREInterface()->SelectNode() and GetCOREInterface()->SetCommandPanelTaskMode(), Max sometimes crashes.
4)This approach is ugly.

This doesn’t seem like such a difficult problem to solve but I’ve spent an enormous time looking for a solution. Any help would be appreciated.

P.S. - Using IGame is not an option.



Replies: 0
avatar

Did you figure out a solution for this? If not, I can ask one of the coders here how we did it for our exporter.



Replies: 0
avatar

Try this… currently only spits our the “true” explicit test...but I’m sure you can mod it
you can do a quick test using $geometry as the objs_array argument.

Hope it helps.

fn exp_norms objs_array =
(
max modify mode
for each in objs_array do
(
if(validmodifier each each.modifiers[#edit_normals]) then
(
each
select each
normnum = (each.modifiers[1].editnormalsmod.getnumnormals node:each)
format “%\n” each.name
for i = 1 to normnum do
(
format “Normal#:% Value:%\n” i (each.modifiers[1].editnormalsmod.getnormalexplicit i node:each)
)
)
)
)



Replies: 0