macklebee Posted December 14, 2009 Share Posted December 14, 2009 Is there a way to relate a camerapick entity to a entity that is found by looping thru the worlds entities? when I do a getkey("name") for example for both, the camerapick returns U3D_MESH and the looped entity returns the user defined name of the model.. Also, if I do an entitypick, since the radius parameter doesn't work, how do i know what direction the raytrace is occurring? Quote 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 More sharing options...
TylerH Posted December 14, 2009 Share Posted December 14, 2009 The entity returned by the CameraPick is the actual mesh itself. You have to call GetMeshModel(pick.entity) to get the TModel that actually has the proper keys for it. Since picks occur only to meshes, and not models or physics, you have to get the Model parent of the picked mesh in order to utilize the key system, message system, etc. on a picked entity. Quote nVidia 530M Intel Core i7 - 2.3Ghz 8GB DDR3 RAM Windows 7 Ultimate (64x)----- Visual Studio 2010 Ultimate Google Chrome Creative Suite 5 FL Studio 10 Office 15 ----- Expert Professional Expert BMX Programmer ----- Link to comment Share on other sites More sharing options...
macklebee Posted December 14, 2009 Author Share Posted December 14, 2009 The entity returned by the CameraPick is the actual mesh itself. You have to call GetMeshModel(pick.entity) to get the TModel that actually has the proper keys for it. Since picks occur only to meshes, and not models or physics, you have to get the Model parent of the picked mesh in order to utilize the key system, message system, etc. on a picked entity. ah! makes sense... thanks! Quote 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 More sharing options...
macklebee Posted December 14, 2009 Author Share Posted December 14, 2009 EDIT---nevermind... it works. strange there is no mention of it in the wiki... Quote 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 More sharing options...
macklebee Posted December 14, 2009 Author Share Posted December 14, 2009 this doesn't exist for BMAX? so this is a lua only command? or is there a bmax version of this with a different name? Quote 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 More sharing options...
Josh Posted December 14, 2009 Share Posted December 14, 2009 GetMeshModel() is not an engine command. It just goes through parents until a model entity is found. Quote My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
macklebee Posted December 14, 2009 Author Share Posted December 14, 2009 so how would you do this in bmax? GetParent(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 Link to comment Share on other sites More sharing options...
macklebee Posted December 14, 2009 Author Share Posted December 14, 2009 ah... its ugly but it works name = GetEntityKey((GetParent(pick.entity)), "name") Quote 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 More sharing options...
TylerH Posted December 14, 2009 Share Posted December 14, 2009 GetMeshModel does a repeat until parent==nil loop to continuously get the parent until you get the highest level parent of the picked entity. It would be nice to have an engine command like GetMeshModel, or something generic and widely usable like GetRootParent. Quote nVidia 530M Intel Core i7 - 2.3Ghz 8GB DDR3 RAM Windows 7 Ultimate (64x)----- Visual Studio 2010 Ultimate Google Chrome Creative Suite 5 FL Studio 10 Office 15 ----- Expert Professional Expert BMX Programmer ----- Link to comment Share on other sites More sharing options...
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.