Page 1 of 1

LM_String

Posted: Mon Mar 28, 2005 11:43 am
by anigreator
Hey all!

I've been trying to modify the new shape select script posted by 7feet yesterday to display the shape order in a persistent popup window (think the bone contraints dialog). This is going well so far with one exception - the shape names are stored as a 'LM_String' userdata typed variable.

Is LM_String a C-style string - a pointer to a null terminated string? And does LM, or anyone else have a code snippet for turning these into useful Lua strings?

Any help would be greatly appreciated.

Cheers!

Chris

Posted: Mon Mar 28, 2005 5:04 pm
by Lost Marble
An LM_String is a C++ wrapper around a C string. Unfortunately, this class has not been exposed to Lua. Although a script can "see" that a shape has a name property, it is unable to actually read or modify it, since Lua scripts don't understand how to work with the LM_String class.

Sorry. As Moho advances, we'll get more and more of this stuff exposed through the scripting interface.

Posted: Mon Mar 28, 2005 7:00 pm
by anigreator
Oh bums! Oh well, at least now I'm familiar with the inner workings of Moho's Lua stuff, which will come in handy further down the line. I did start getting suspicious when the only reference to shape.fName I could find was the one I'd just put in the script... should have known :)

The show goes on...