hey everyone. i wrote a quick maxscript thats got some custom buttons for me, and i want to know how to be able to keep the rollout of the script docked as a toolbar if possible. here's a quick shot of what ive got.
![maxscript-help.jpg](http://dl.dropbox.com/u/13680846/maxscript-help.jpg)
the 4 icons outlined in green are their own floating rollout which can be docked to any toolbar, but once docked i can not undock it, and when i close max it is not there when i restart.
any help would be appreciated, here's my code for you to look through and see if im overlooking something.
macroscript PrimitiveMenu
category: "Oniram"
(
rollout PrimitiveMenu "Menu"
(
local UndoName = "Undo Create Custom"
button b_Box "Box" pos:[6,1] height:32 width:32 images:#("Standard_24i.bmp","Standard_24i.bmp",10,1,1,1,1)
button b_Cylinder "Cylinder" pos:[44,1] height:32 width:32 images:#("Standard_24i.bmp","Standard_24i.bmp",10,3,3,1,1)
button b_Plane "Plane" pos:[82,1] height:32 width:32 images:#("Standard_24i.bmp","Standard_24i.bmp",10,10,10,1,1)
button b_Sphere "Sphere" pos:[120,1] height:32 width:32 images:#("Standard_24i.bmp","Standard_24i.bmp",10,2,2,1,1)
on b_Box pressed do with undo label:(UndoName) on
(
NewBox = Box pos:[0,0,0]
NewBox.Height = 20
NewBox.Length = 20
NewBox.Width = 20
select NewBox
)
on b_Cylinder pressed do with undo label:(UndoName) on
(
NewCylinder = Cylinder pos:[0,0,0]
NewCylinder.Radius = 12
NewCylinder.Height = 32
NewCylinder.HeightSegs = 0
NewCylinder.Sides =12
if(viewport.getType() == #view_front) then
(
Rotate NewCylinder (eulerangles 90 0 0)
)
if(viewport.getType() == #view_left) then
(
Rotate NewCylinder (eulerangles -90 180 90)
)
if(viewport.getType() == #view_right) then
(
Rotate NewCylinder (eulerangles 90 0 90)
)
if(viewport.getType() == #view_back) then
(
Rotate NewCylinder (eulerangles 90 0 180)
)
select NewCylinder
)
on b_Plane pressed do with undo label:(UndoName) on
(
NewPlane = Plane pos:[0,0,0]
NewPlane.length = 20
NewPlane.width = 20
NewPlane.Widthsegs = 0
NewPlane.lengthsegs = 0
if(viewport.getType() == #view_front) then
(
Rotate NewPlane (eulerangles 90 0 0)
)
if(viewport.getType() == #view_left) then
(
Rotate NewPlane (eulerangles -90 180 90)
)
if(viewport.getType() == #view_right) then
(
Rotate NewPlane (eulerangles 90 0 90)
)
if(viewport.getType() == #view_back) then
(
Rotate NewPlane (eulerangles 90 0 180)
)
select NewPlane
)
on b_Sphere pressed do with undo label:(UndoName) on
(
NewSphere = Sphere pos:[0,0,0]
NewSphere.radius = 12
NewSphere.segs = 24
select NewSphere
)
)
CreateDialog PrimitiveMenu 256 34
cui.registerdialogbar PrimitiveMenu maxsize:[-1,-1]
)
Replies
If you want to do it with a rollout you need to use the 'cui.FloatDialogBar', there's a good example in this thread at the area, but even then I'm not sure you can get it where you want it since it will only attach to "top" and not a certain location.
Have you considering throwing it on a quad menu instead? Seems like that would be a bit more piratical.