#title = TESTTTT
#info = Insert an object by clicking on the [Insert button]
#icon = insert.png

var()
{
 selected
 istance
 mediaName
 mediaField
 meshIstance
}

onButtonClick()
{
 mediaName = program.ask(media Name,CUBE)
 mediaField = program.ask(media Field,ENTITY.MESH)
 scene.deselectAll()
 selected = onButtonClick.getType()
 istance = scene.createIstance(selected,scene.root)
 meshIstance = scene.getField(istance,mediaField)
 scene.setMesh(meshIstance,mediaName)
 scene.selectIstance(istance)
}


