Jump to content

Access Surface + Vertex information from LUA


cocopino
 Share

Recommended Posts

I am trying to change the vertex information of a model in LUA, I'm trying this code on the model to try and find out which surface I need:

 

require("scripts/class")
local class=CreateClass(...)

function class:CreateObject(model)

       local object=self.super:CreateObject(model)

Print ("model")
Print (CountChildren(model))
Print (model:GetKey("name"))

Print ("ob1")
ob1 = GetChild(model, 1)
Print (CountChildren(ob1))
Print (CountSurfaces(ob1))
Print (ob1:GetKey("name"))

Print ("ob2")
ob2 = GetChild(ob1, 1)
Print (CountChildren(ob2))
Print (ob2:GetKey("name"))

function object:Update()
end

       function object:Free(model)
               self.super:Free()
       end

end

 

The first child is called "U3D_MESH" which sounds pretty promising. It doesn't have any surfaces though, while loading it with GetChild(LoadMesh("mesh.gmf"),1) in BlitzMax does work. When going deeper into the model it's returning bone names.

 

Any ideas? Thanks!

desktop: Quad core Q6600 + 4GB + ATI HD4890 + XP

laptop: Dual core T6400 + 4 GB + NVidia 9600M GT + Vista 32

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...