Rick Posted January 6, 2010 Share Posted January 6, 2010 I assume the target we set is the model in the editor. Is there a way to get the lua object of that model so I can call object methods from it? For example from one script that has a target: GetLuaObject(GetTarget(0)):MyFunction() Where MyFunction() was defined in the lua class around that target? Quote Link to comment Share on other sites More sharing options...
Niosop Posted January 6, 2010 Share Posted January 6, 2010 I think that's addressed in the Getting_Started_With_Lua.pdf tutorial. You should be able to do: objecttable[GetTarget(0)]:MyFunction() I haven't tested it though, so may not work. Quote Windows 7 x64 - Q6700 @ 2.66GHz - 4GB RAM - 8800 GTX ZBrush - Blender Link to comment Share on other sites More sharing options...
Rick Posted January 6, 2010 Author Share Posted January 6, 2010 I'll give that a go when I get home. I guess I could just send messages too. Quote Link to comment Share on other sites More sharing options...
Niosop Posted January 6, 2010 Share Posted January 6, 2010 Actually just tested it in the create function. A: if object == objecttable[object.model] then Notify("Match") end in the create function results in a match notification. Quote Windows 7 x64 - Q6700 @ 2.66GHz - 4GB RAM - 8800 GTX ZBrush - Blender Link to comment Share on other sites More sharing options...
Josh Posted January 6, 2010 Share Posted January 6, 2010 Add a check to make sure the target isn't nil. 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...
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.