Notifications
Clear all
[Closed] attaching a custom dialog to the scene explorer
Jun 06, 2016 5:56 pm
What I am actually looking for is a better way of doing this. What I have feels like a bit of workaround right now.
Basically because of the lack of layer controls in new max 2016 I decided to make a custom dialog that would be attached to the scene explorer – layer explorer to enable such things as hide all layers/ unhide all/freeze/isolate/ etc. They way I was able to do it so far is to add a script to the redraw callback to get the position of the scene explorer. Seems to work fine in Nitrous as the redraw happens very frequently (every 0.5s) but any other display driver seems to only redraw after user input in the viewport so the dialog detaches until the viewport is clicked again.
My crappy code below:
global vp
global vp_prev
global LayManDia
global preHideArray
global explorerPos_prev
global explorerSize_prev
fn redrawviews_p =
(
explorerVisible = SceneExplorerManager.ExplorerIsOpen "Layer Explorer"
explorerFloating = SceneExplorerManager.IsExplorerInViewport "Layer Explorer"
explorerPos = SceneExplorerManager.GetExplorerPosition "Layer Explorer"
explorerSize = SceneExplorerManager.GetExplorerSize "Layer Explorer"
vp = explorerVisible
if vp_prev != vp and vp == true then
(
createdialog LayManDia style:#(#style_sysmenn) pos:[(explorerPos.x - dialogWidth) ,(explorerPos.y)]
)
else if vp_prev != vp and vp == false then (DestroyDialog LayManDia)
if (explorerVisible == true and (GetDialogSize LayManDia) != [0,0] and (explorerPos_prev != explorerPos or explorerSize_prev != explorerSize)) then
(
SetDialogPos LayManDia [(explorerPos.x - dialogWidth) ,(explorerPos.y)]
)
vp_prev = vp
explorerPos_prev = explorerPos
explorerSize_prev = explorerSize
)
registerRedrawViewsCallback redrawviews_p