get and set to Ini

get and set to Ini

Anonymous
Not applicable
591 Views
4 Replies
Message 1 of 5

get and set to Ini

Anonymous
Not applicable
Hi

I'm looking into a script that resets the Dialogpos. of the Material Editor, Curve Editor &
the RenderDialog. (When you have a dual monitor setup and change the virtual position of
you secondary monitor, Dialogs are left behind.)

I can find the position of 'Select Objects' dialog, but nothing else:

getinisetting "C:\etcetc\Application Data\Autodesk\3dsmax\9 - 64bit\enu\3dsmax.ini"
"DialogResizer_SizeAndPositions" "SelectObjectsDialog"

Does anyone know where to find it?

BR,
Aplomo
0 Likes
592 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
Hi,

Same file: 3dsmax.ini, try to search for "Position", you should be able to find them . Curve Editor stays with the main Max window AFAIK.

Cheers,

--Nam
0 Likes
Message 3 of 5

Anonymous
Not applicable
Thanks!

It works for the RenderDialog but not for the materialbrowser.

This is my first test:


macroscript Resetter category:"TT_Tools"
(
global inidir64 = "C:\yada\9 - 64bit\enu\3dsmax.ini"
global inidir32 = "C:\yada\9 - 32bit\enu\3dsmax.ini"
global reser()
global dialogarray = #("MaterialBrowserDialogPosition","RenderDialogPosition")


rollout ReSetIt "ReSetIt"
(
button reset_btn "Reset Dialogs"

fn reser =
(
if is64bitApplication() == true then
(
setIniSetting inidir64 dialogarray "Dimension" "1 1 355 1045"
completeRedraw()
)
else
(
setIniSetting inidir32 dialogarray "Dimension" "1 1 355 1045"
)
)

on reset_btn pressed do
(
reser()
)
)
createDialog ReSetIt
)


I also want to check to see if the Dialogs are open and if so, close them.

Does anyone know why this doesn't work with the materialeditor the way I've written it?

BR,
Aplomo
0 Likes
Message 4 of 5

Anonymous
Not applicable
Hi Aplomo,

Material Editor position should be under

Are you looking for <bool>MatEditor.isOpen()? and renderSceneDialog.isOpen()

Hope this helps,

--Nam
0 Likes
Message 5 of 5

Anonymous
Not applicable
Thats the one!

I really should do more research before posting 🙂

Thanks alot NamNguyen!..

Edit: For those interested here's the script.


macroscript Resetter category:"TT_Tools"
(
global inidir = getMAXIniFile&#40;&#41;
global reser(&#41;
global closedd = #(MatEditor,RenderSceneDialog&#41;
global dialogarray = #("MtleditorPosition","RenderDialogPosition")
global Varoptions = #("MainWindow","Dimension")
global DPos = "1 1 400 600"
global checknclose()

fn reser =
(
for i in 1 to dialogarray.count do
(
setIniSetting inidir dialogarray Varoptions DPos
completeRedraw()
closedd.open()

)

)

fn checknclose =
(
for i in 1 to closedd.count do
(
if closedd.isOpen() == true then closedd.close()
)
)

rollout ReSetIt "ReSetIt" width:112 height:40
(

button reset_btn "-- Reset --" pos: width:82 height:24
button q_btn "?" pos: width:16 height:24

on q_btn pressed do messagebox("Resets your MtlEditorDialog and RenderDialog")

on reset_btn pressed do
(
checknclose()
reser()
)
)
createDialog ReSetIt
)


Could this be done much easier? I suspect so.... 🙂
Let me know!

BR,
Aplomo
0 Likes