.obj format negative face values


#1

When I’m exporting an .obj via MAXscript I am getting negative values for faces. This results as an error when trying to import it into SoftImage. It seemed to work ok on another computer so I’m thinking it may be something with my Max. Can someone check to see if they get negative values by following these steps?

- Open on Max 2010 32 or 64 bit
- Create a box
- Select the box and run this:
(
    	obj = selection[1]
    	objPath = (getDir #temp) + "\\" + obj.name + ".obj"
    	exportFile objPath #noPrompt selectedOnly:true using:objExp
    	objPath
    )
  • The path where the .obj exported to will show up in the listener, copy that path and open the .obj file in wordpad
  • Scroll down to the bottom where it should look like this:
s 2
   f -8/-4/-6 -7/-3/-6 -6/-2/-6 -5/-1/-6 
   s 4
   f -4/-1/-5 -3/-4/-5 -2/-3/-5 -1/-2/-5 
   s 8
   f -8/-1/-4 -5/-4/-4 -3/-3/-4 -4/-2/-4 
   s 16
   f -5/-1/-3 -6/-4/-3 -2/-3/-3 -3/-2/-3 
   s 32
   f -6/-1/-2 -7/-4/-2 -1/-3/-2 -2/-2/-2 
   s 64
   f -7/-1/-1 -8/-4/-1 -4/-3/-1 -1/-2/-1 
   # 6 polygons

Do you end up with negative values with the lines that start with ‘f’?
I get good values if I don’t use the #noPrompt parameter, but I’m setting the same settings as a manual export so not sure why it would be messing up.


#2

In max 2010_64I get:

# 3ds Max Wavefront OBJ Exporter v0.97b - (c)2007 guruware
 # File Created: 19.11.2010 14:45:10
 
 mtllib Box01.mtl
 
 #
 # object Box01
 #
 
 v  -20.0000 0.0000 20.0000
 v  -20.0000 0.0000 -20.0000
 v  20.0000 0.0000 -20.0000
 v  20.0000 0.0000 20.0000
 v  -20.0000 40.0000 20.0000
 v  20.0000 40.0000 20.0000
 v  20.0000 40.0000 -20.0000
 v  -20.0000 40.0000 -20.0000
 # 8 vertices
 
 vn 0.0000 -1.0000 -0.0000
 vn 0.0000 1.0000 -0.0000
 vn 0.0000 0.0000 1.0000
 vn 1.0000 0.0000 -0.0000
 vn 0.0000 0.0000 -1.0000
 vn -1.0000 0.0000 -0.0000
 # 6 vertex normals
 
 vt 1.0000 0.0000 0.0000
 vt 1.0000 1.0000 0.0000
 vt 0.0000 1.0000 0.0000
 vt 0.0000 0.0000 0.0000
 # 4 texture coords
 
 g Box01
 usemtl wire_145028177
 s 2
 f 1/1/1 2/2/1 3/3/1 4/4/1 
 s 4
 f 5/4/2 6/1/2 7/2/2 8/3/2 
 s 8
 f 1/4/3 4/1/3 6/2/3 5/3/3 
 s 16
 f 4/4/4 3/1/4 7/2/4 6/3/4 
 s 32
 f 3/4/5 2/1/5 8/2/5 7/3/5 
 s 64
 f 2/4/6 1/1/6 5/2/6 8/3/6 
 # 6 polygons
 
 

#3

Thanks for the effort. I wonder if it’s just something corrupt with my exporter :S


#4

Figured it out. I guess some settings in \Autodesk\3ds Max 2010\plugcfg\gw_objexp.ini were creating conflicts.


#5

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.