--///////////////////////////VARIABLES/////////////////////////////////////// --controls attributes btnState_createObject=true btnState_removeObject=false --dynamic rollout display displayDynaRollout=false --floater settings defaultRolloutHeight=125 defaultRolloutWidth=350 rolloutHeight=defaultRolloutHeight rolloutWidth=defaultRolloutWidth defaultRolloutPosX=50 defaultRolloutPosY=120 mainFloater=newRolloutFloater "Dynamic rollouts" defaultRolloutWidth defaultRolloutHeight defaultRolloutPosX defaultRolloutPosY --Rollouts display update--------------------------------------------------------------------------- function majRollouts = ( --initalize size for floater rolloutHeight=defaultRolloutHeight rolloutWidth=defaultRolloutWidth --destroy all the rollouts for roll in mainFloater.rollouts do removeRollout roll mainFloater --rebuild all the rollouts addrollout rolloutHead mainFloater --ERROR FIRST LAUNCH:removeRollout requires RolloutClass, got:undefined" if displayDynaRollout then ( addRollout rolloutA mainFloater rolloutHeight+=60 ) addrollout rolloutFoot mainFloater --adjust the size mainFloater.size=[rolloutWidth,rolloutHeight] ) --Controls display update------------------------------------------------------------------------ --This is not really necessary there but need it for my bigger project function majControls = ( rolloutHead.btn_createObject.enabled=btnState_createObject rolloutHead.btn_removeObject.enabled=btnState_removeObject ) --Create an object-------------------------------------------------------------------- function createObject = ( global gizmoObject=sphere name:"object" radius:100 segs:20 hemisphere:0.5 --Rollouts displayDynaRollout=true --controls btnState_createObject=false btnState_removeObject=true ) --Destroy the Object -------------------------------------------------------- function destroyObject = ( delete gizmoObject --Rollouts displayDynaRollout=false --Controls btnState_createObject=true btnState_removeObject=false ) --/////////////////////////USER INTERFACE///////////////////////////////////////////////////////////////////////////////////////// rollout rolloutHead "Steady head rollout" ( button btn_createObject "Create object" height:18 width:150 offset:[-80,5] enabled:btnState_createObject button btn_removeObject "Remove object" height:18 width:150 offset:[80,-23] enabled:btnState_removeObject --SKY CREATION ok on btn_createObject pressed do ( createObject() majRollouts() majControls() ) --SKY DESTRUCTION ok on btn_removeObject pressed do ( destroyObject() majRollouts() majControls() ) ) rollout rolloutA "Dynamic rollout" ( colorpicker col_ObjectColor "color" color:[137,204,255] ) rollout rolloutFoot "Steady foot rollout" ( button btn_close "Close floater" height:18 width:150 ) addRollout rolloutHead mainFloater addRollout rolloutFoot mainFloater