OBJ import options

Anonymous

OBJ import options

Anonymous
Not applicable

Hello, I have a little problem with maxscript and the OBJ Import Options. I've made a script in wich i need to load some obj files and I would like to uncheck the Flip ZY-axis option and use the option From SM group for the Normals. I use importFile with #noPrompt and using:ObjImp and at the beginning of my script, I use the following lines :

 

theINI = objimp.getIniName()

setINISetting theINI "Geometry" "FlipNormals" "2"

setInISetting theINI "Geometry" "FlipZyAxis" "0"

 

But, the obj are imported as if the flipZyAxis option is checked and the normals are imported from the file.

Does someone know where the problem could comes from ?

0 Likes
Reply
1,261 Views
4 Replies
Replies (4)

senorpablo
Advocate
Advocate

First thing I would check is to see if the ini file gets properly modified and set with your setini calls? 

0 Likes

Anonymous
Not applicable

Thanks for your reply. When I execute this script, the two lines with setINISetting return true and I have the following gw_objimp.ini as a result:

 

 

[General]
UseLogging=0
Preset=UV Mapper
ResetScene=0
CurrObjColor=11
MapSearchPath=
[Objects]
SingleMesh=0
AsEditablePoly=0
Retriangulate=0
[Geometry]
FlipZyAxis=0
CenterPivots=0
Shapes=0
TextureCoords=1
SmoothingGroups=1
NormalsType=2
SmoothAngle=30.000000
FlipNormals=2
[Units/Scale]
Convert=0
ConvertFrom=5
ObjScale=1.000000
[Material]
UniqueWireColor=1
ImportMaterials=1
UseMatPrefix=1
DefaultBump=2
ForceBlackAmbient=0
ImportIntoMatEditor=1
ShowMapsInViewport=1
CopyMapsToProj=0
OverwriteImages=0
[DlgPos]
ImportSummary=470 318 969 542 1

0 Likes

senorpablo
Advocate
Advocate

Seems like the ini settings are working at least. If you import an obj manually, are those ini settings that you modified reflected in the import dialog? Maybe try changing the settings back and forth to make sure everything is being respected.

 

If that's all fine, then the only thing I can see that's happening is that the importer is not using the settings from the ini file. Maybe try specifying the import class explicitly if you're not already ("using:ObjImp"):

 

importFile <filename_string> [#noPrompt] [using:<maxclass>] 

 

Sorry I can't be of more specific help. I have used the fbx importer with success, but it uses a different method to set import options by script, not an ini file. 

 

 

0 Likes

Anonymous
Not applicable

I'm already using the using:objimp option and the changes made in the ini are not reflected when manually importing an obj.

0 Likes