[Closed] How to write to sme.ini file
Hi,
I am unable to write/make changes to the SME.ini file.
Am I doing something wrong here or is it Windows 7 that does not let me allow this?
All help greatly appreciated
Rollout Roll_OldMtlBtn "Old Days - MAX Settings"
(
group "Set/Use Old Material Browser"
(
button btn_OldMtlEdit "Set Old Mtl Browser" width:180 height:20 align:#center
)
on btn_OldMtlEdit pressed do
(
local inipathSME = (getdir #plugcfg) + "\ \SME.ini"
setINISetting inipathSME "Material Browser Section" "ShowMtlBrowser" "1"
setINISetting inipathSME "Material Browser Section" "UseOldMtlBrowser" "1"
)
)
Have you verified that your code is changing the file? You may need to access the user plugcfg folder as well/instead (#maxdata+”\plugcfg\”). Also, for those to work you will need to make sure that the dialogs are closed, both the CME one as well as the one in the SME dialog.
-Eric
PiXeL_MoNKeY:
Thanks for your reply. I'm in the beginning when it comes to max scripting, so my level is very basic yet. I have created a script that writes to 3dsmax.ini, but I can not enter data into SME.ini file.
Here's the link to my script: [ http://www.scriptspot.com/3ds-max/scripts/reset-3ds-max-windows ]( http://www.scriptspot.com/3ds-max/scripts/reset-3ds-max-windows)
what I'm trying to do is type the following into the SME.ini:
setINISetting inipathSME "Material Browser Section" "ShowMtlBrowser" "1"
setINISetting inipathSME "Material Browser Section" "UseOldMtlBrowser" "1"
-------------------------------------------------------------------------------------------------
I would also like to changed the file CurrentDefaults.ini with this:
[Scene Explorer]
SelectByNameUsesSceneExplorer = 0
Location:
************ \ AppData \ Local \ Autodesk \ 3dsMaxDesign \ 2012 - 64bit \ enu \ defaults \ Max.mentalray \ CurrentDefaults.ini
Hmmm…
It looks like 3ds max writes to the SME.in file when it quits. Then i can not change the last 2 lines of SME.ini because it sets the values back to the same as when you started 3ds max.
If you go in manually and edit before 3ds max starts up, it seems to be working.
Sorry for taking up the thread again ;o)
Is it possible to write the settings to the sme.ini when max quit (override) with callbacks or something?
This code does work and write the settings to the sme.ini file, but the settings are writen back to the default when quiting max.
inipathSME=(GetDir #plugcfg + "\SME.ini")
setFileAttribute inipathSME #readOnly false
setINISetting inipathSME "Material Browser Section" "ShowMtlBrowser" "1"
setINISetting inipathSME "Material Browser Section" "UseOldMtlBrowser" "1"
Hi,
Max changes the “UseOldMtlBrowser” when it starts,
but if you place you script in the startup folder, it should work…
if (getINISetting (GetDir #plugcfg + "\SME.ini") "Material Browser Section" "UseOldMtlBrowser") != "1" do
setINISetting (GetDir #plugcfg + "\SME.ini") "Material Browser Section" "UseOldMtlBrowser" "1"
Sorry to bump this thread.
Unfortunately that script doesnt work. Either its max 2012 or the script is being read BEFORE max writes the defaults at start up.
Mind you my sme.ini is in a complete different location and not in the standard #plugcfg dir.
Using this:
macroScript oldMEatStartUp
(
if (getINISetting "C:\Documents and Settings\user\Local Settings\Application Data\Autodesk\3dsMaxDesign\2012 - 32bit\enu\plugcfg\SME.ini" "Material Browser Section" "UseOldMtlBrowser") != "1" do
setINISetting "C:\Documents and Settings\user\Local Settings\Application Data\Autodesk\3dsMaxDesign\2012 - 32bit\enu\plugcfg\SME.ini" "Material Browser Section" "UseOldMtlBrowser" "1"
)