Sync referenced layer's channels to original in Lua?

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

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
User avatar
Lukas
Posts: 1295
Joined: Fri Apr 09, 2010 9:00 am
Location: Netherlands
Contact:

Sync referenced layer's channels to original in Lua?

Post by Lukas »

I've got referenced layers breaking all the time (not sure why, it might be importing/copying rigs from scene to scene), and I'm looking for a way to "Sync all Channels to Original" for all of them. Doing it by hand takes a lot of time.

But I can't find a way to do it in Lua.

Code: Select all

local i
for i = 1, #layers do
	layer = layers[i]
	if (layer:IsReferencedLayer()) then
		--layer:SyncAllChannelsToOriginalLayer()
	end
end
layer:SyncAllChannelsToOriginalLayer() is not a real Method, but does one exist?

If it doesn't exist, are there other things I could try?

I've tried layer:UpdateReferencedLayer(syncOptions), but it only syncs the layer's content, not the channels.
User avatar
synthsin75
Posts: 9935
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Sync referenced layer's channels to original in Lua?

Post by synthsin75 »

No, sadly there is no scripting access to resyncing channels. You can save a little time by consolidating channels, so you can sync all the channels on a layer at once, and if you show all the layers on the timeline, you can go down the list syncing.
User avatar
Lukas
Posts: 1295
Joined: Fri Apr 09, 2010 9:00 am
Location: Netherlands
Contact:

Re: Sync referenced layer's channels to original in Lua?

Post by Lukas »

That's what I was afraid of... Thanks Wes!

Luckily all my referenced layers have 'reference' in the layername, so I can quickly filter by name and right click and sync all...
User avatar
Lukas
Posts: 1295
Joined: Fri Apr 09, 2010 9:00 am
Location: Netherlands
Contact:

Re: Sync referenced layer's channels to original in Lua?

Post by Lukas »

Google brought me to my own thread :(

Looks like this is still not possible, right?
User avatar
synthsin75
Posts: 9935
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Sync referenced layer's channels to original in Lua?

Post by synthsin75 »

Lukas wrote: Tue Aug 17, 2021 3:56 pm Looks like this is still not possible, right?
Yeah. :cry:
User avatar
Lukas
Posts: 1295
Joined: Fri Apr 09, 2010 9:00 am
Location: Netherlands
Contact:

Re: Sync referenced layer's channels to original in Lua?

Post by Lukas »

I filed a request 🤞
Post Reply