Jump to content

Entity Pick


Eric
 Share

Recommended Posts

the lua script 'utilities.lua' shows how to get the parent/model of the mesh... or search for GetMeshModel in the forum search and you should find examples of getting the model/body from the picked mesh...

 

 

I work in BMax.. and I can't seem to get this to work.

 

Function GetMeshModel:TEntity(entity:TEntity)
While entity <> Null

	If GetEntityKey(entity, "class") = "Model"

		return entity
	End If
	entity=entity.parent
Wend
End Function

Link to comment
Share on other sites

as found in the LE2 bmax section of the forum when using GetMeshModel as the search word: http://www.leadwerks.com/werkspace/topic/1588-entitybody-conversion-problem/page__p__14732__hl__getmeshmodel__fromsearch__1#entry14732

 

Function GetMeshModel:TBody(entity:TEntity)
       While entity <> Null
               If GetEntityClass(entity) = ENTITY_BODY Or GetEntityClass(entity) = ENTITY_MODEL
                       Return TBody(entity)
               EndIf
               entity = entity.parent
       Wend
EndFunction

Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590

LE / 3DWS / BMX / Hexagon

macklebee's channel

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...