Need help on Docking Rollout
So i want to dock my rollout on open and remember where it was docked on close
but run into problem, it seems that on close the dialog is undocked and the status is #cui_floatable which make it always float on start and not docked. :/ is there any work around for that?
<code>
try (
cui.UnRegisterDialogBar TestDialog
destroyDialog TestDialog
) catch ()
rollout TestDialog "Title"
(
local DialogDock
local scriptpath = @"D:\MAX - Script\"
local INIfile = scriptpath + "Settings.ini"
button btn "Button"
function dockstatus = (
DialogDock = getINISetting INIfile "Dialog" "Dock"
TestDock = case DialogDock of (
("cui_dock_left"): #cui_dock_left
("cui_dock_right"): #cui_dock_right
("cui_dock_bottom"): #cui_dock_bottom
("cui_dock_top"): #cui_dock_top
("cui_floatable"): #cui_floatable
)
return TestDock
)
on TestDialog open do (
format "Open %\n" (dockstatus())
cui.RegisterDialogBar TestDialog maxsize:[-1,-1] style:#(#cui_dock_all, #cui_floatable, #cui_handles )
cui.DockDialogBar TestDialog (dockstatus())
)
on TestDialog moved pos do (
if TestDialog.dialogbar do (
TestDock = (cui.getDockState TestDialog)
setINISetting INIfile "Dialog" "Dock" TestDock forceUTF16:false
format "Move %\n" (dockstatus())
)
)
on btn pressed do (
cui.UnRegisterDialogBar TestDialog
destroyDialog TestDialog
)
on TestDialog close do (
format "Close %\n" (dockstatus())
)
)
createdialog TestDialog width:275 height:74 style:#()
</code>
Comments
edit
edit: reposted in correct reply thread
timo.ink
.
This works:
Tools and Scripts for Autodesk 3dsMax
i found similar problem in
i found similar problem in this closed thread:
http://forums.cgsociety.org/showthread.php?t=597419
http://forums.cgsociety.org/showthread.php?t=962428
it seems that there still isn't any solution for that
i think i might give up on docking rollout and let it be on float.
timo.ink
thanks for the response :)
thanks for the response :)
so i try it and It is working perfectly, it seems the problem was on dialog moved?
but if i run the script again while the one before is not closed yet using the button.
it create some uncloseable rollout instead
if possible i will remove that button on the final version of my script and using the standard close button
but again if you press the red close button it says error
-- Error occurred in TestDialog.close(); filename: ; position: 1208; line: 46
-- Frame:
>> MAXScript Rollout Handler Exception:
-- Unable to convert: undefined to type: String <<
position: 1208; line: 46 is >> setINISetting INIfile "Dialog" "Dock" theDockState forceUTF16:false
it seems that theDockState become undefined.
is the error just on mine?
is it posible to create dialogbar without those titlebar and close button on float?
timo.ink
.
You can use something like this:
Tools and Scripts for Autodesk 3dsMax
.
When I use the code bellow I have no error. Executing the code while the rollout is docked leads to creating the same rollout, docked at the same position.
Tools and Scripts for Autodesk 3dsMax
On mine Executing the code
On mine Executing the code while the rollout is docked leads to creating the same rollout docked at saved ini position.
Well at least it work Thank you very much :)
also it seems that max didn't really save the exact position of the dock, is there any work around for that?
timo.ink
.
IF you have several docked toolbars/rollouts 3dsMax do not saves their position. Wneh you undock one of those toolbars/rollouts and dock it again it will be docked to different position. I don't know a way to fix this using a script.
By the way you can add a RC Menu to allows the user to dock/undock the rollout. Please, watch this video:
https://www.youtube.com/watch?v=-UCXlXwitqs
Tools and Scripts for Autodesk 3dsMax
.
that surely is an interesting suggestion, thank you :)
timo.ink