Rename a layercomp through script (LM_String problem)

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

Moderators: Víctor Paredes, 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 »

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: 9968
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Rename a layercomp through script (LM_String problem)

Post by synthsin75 »

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 »

Thanks, that worked.
Post Reply