Rename a layercomp through script (LM_String problem)

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Fahim, Distinct Sun, Víctor Paredes, erey, Belgarath, slowtiger

Post Reply
JeroenKoffeman
Posts: 32
Joined: Tue Mar 24, 2015 3:04 pm

Rename a layercomp through script (LM_String problem)

Post by JeroenKoffeman » Tue May 12, 2015 11:58 am

Dear forum members,

I try to change a layercomp's name through lua. Is it possible?

Code: Select all

comp:SetName(LM.String:Set(name))

Comp refers to the layercomp, name refers to a string.
It doesn't work. What's the proper way to change an LM_String?

Thanks in advance
User avatar
synthsin75
Posts: 7103
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Rename a layercomp through script (LM_String problem)

Post by synthsin75 » Wed May 13, 2015 12:46 am

If I remember correctly, you'd do something like this:

local string = LM.String:new_local() --define LM.String object
string:Set(name) --set LM.String value
comp:SetName(string) --use LM.String
JeroenKoffeman
Posts: 32
Joined: Tue Mar 24, 2015 3:04 pm

Re: Rename a layercomp through script (LM_String problem)

Post by JeroenKoffeman » Sun Nov 08, 2015 2:10 pm

Thanks, that worked.
Post Reply