     obj.rotateZ(Math.PI/4)
     obj
 
+  clearPropsGUI: ->
+    if @ve.datgui?
+      @ve.datgui.destroy()
+      @ve.datgui = null
+
+  showPropsGUI: (s) ->
+    @ve.datgui = new dat.GUI()
+
+    addElem = (d, k, v) ->
+      if !d[k]?
+        d[k] = [v]
+      else
+        d[k].push(v)
+
+    dict = new Array()
+    addElem(dict, x.constructor.name, x) for x in s
+
+    addGuiElems = (typ, xs) =>
+      f = @ve.datgui.addFolder(typ)
+      x.showProps(f) for x in xs
+      f.open()
+
+    #@ve.datgui.addFolder(k) for k,v of dict
+
+    addGuiElems(k, v) for k,v of dict
+
+
   selectObj: (obj) ->
     
     @clearSelection()
+    @showPropsGUI([obj])
 
     if not obj.glowBubble?
       console.log "! select"

    true

  moveSelection: -> #TODO

  
  glowMaterial: () ->
    cam = @.ve.camera

  g.ve = new VisualEnvironment(document.getElementById("surface"))
  g.ve.ebox = new ElementBox(g.ve)
  g.ve.surface = new Surface(g.ve)
  g.ve.datgui = null
  g.ve.render(g.ve)

#Global event handlers
