--
-- sample lua script
--

doc = mc.GetDocument()
count = mc.GetMeshObjectCount(doc)

local obj = mc.CreateMeshObject(doc,"CreatedByLua")
local sub = mc.CreateSubMesh(obj,"Sub")
 
mc.AddObjectToTree(doc,obj)

mc.BeginModify(obj)
local v1 = mc.AddVertex(obj, 0.0, 0.0, 0.0)
local v2 = mc.AddVertex(obj, 1.0, 1.0, 1.0)
mc.AddEdge(obj,v1,v2)

mc.AddPolygon( obj, nil,4,
  { v1,v2, mc.AddVertex(obj, 1,0,0), mc.AddVertex(obj,0,1,0)},
  {-1,-1,-1,-1}, 0)
mc.EndModify(obj,0)

