Rick Posted January 6, 2010 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
Niosop Posted January 6, 2010 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
Rick Posted January 6, 2010 Author Posted January 6, 2010 I'll give that a go when I get home. I guess I could just send messages too. Quote
Niosop Posted January 6, 2010 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
Josh Posted January 6, 2010 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.
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.