     true
 
   loadPhyo: (x) =>
+    m = loadedModels[x.model]
     p = new BaseElements.Phyo(@ve.surface.baseRect,
                                x.position.x, x.position.y, x.position.z)
     @setProps(p, x)
     @ve.surface.elements.push(p)
-    m = loadedModels[p.props.model]
     m.instances.push(p)
     p.model = m
     p.loadArgValues()

      @args = []

    setIcon: (x=0, y=0, z=50) =>
      material = new THREE.SpriteMaterial({
        map: @tex,
        #alphaTest: 0.5,
        depthTest: false,
        depthWrite: false
      })
      @shp = new Shapes.Icon(@tex, x, y, z)
      @shp.obj3d.userData = this

    addArgs: () ->
      _args = @model.props.params


  doLoad: (m) =>
    @loadModels(m.models)
    #while(@latchup > @latchdown)
    #  console.log(@latchdown)
    @loadElements(m.elements)
    @loadSimSettings(m.simSettings)
    true
