Eric Posted August 28, 2011 Posted August 28, 2011 The Line pick can pick a mesh of a Model but how do you take that information and find the body of the picked Mesh? Thanks, Eric Quote
Josh Posted August 28, 2011 Posted August 28, 2011 Find the mesh's topmost parent, or the first parent that is a model. Quote My job is to make tools you love, with the features you want, and performance you can't live without.
Eric Posted August 28, 2011 Author Posted August 28, 2011 Josh, DO you have a small sample? Thanks, Eric Quote
macklebee Posted August 28, 2011 Posted August 28, 2011 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... Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel
Eric Posted August 28, 2011 Author Posted August 28, 2011 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 Quote
macklebee Posted August 28, 2011 Posted August 28, 2011 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 Quote Win7 64bit / Intel i7-2600 CPU @ 3.9 GHz / 16 GB DDR3 / NVIDIA GeForce GTX 590 LE / 3DWS / BMX / Hexagon macklebee's channel
Eric Posted August 28, 2011 Author Posted August 28, 2011 Macklebee, Perfect...Thanks for your help. Eric Quote
Recommended Posts
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.