Page 1 of 1

Identify a layer as a master reference

Posted: Wed Sep 16, 2015 2:28 am
by mkelley
Because references aren't *quite* there yet (I have uncovered a bug that keeps a script I have from working properly in adjusting the master, and if I adjust both the child and the master the reference gets broken with no way to restore it -- it's a switch layer and you can't reestablish such switches) I need to be able to find the master layer for that reference so I can just skip the operation that the child doesn't reflect.

I can find whether a layer is a reference using IsReferencedLayer, but I can't see any way to know what the master layer is -- anyone have a clue?

Re: Identify a layer as a master reference

Posted: Wed Sep 16, 2015 3:11 am
by synthsin75
I haven't tried, but my guess is that you need:

GetLayerRefInfo(MohoLayerRef &refInfo)

I assume you would use it something like this:

local refInfo = MohoLayerRef:new_local()
moho.layer:GetLayerRefInfo(refInfo)
local masterLayer = refInfo.fLayerUUID

Just guessing, mind you.

Re: Identify a layer as a master reference

Posted: Wed Sep 16, 2015 10:14 am
by mkelley
Hmmm, that looks like a pretty good guess, Wes.

I may try it out but I was able to work around most of my issues by ignoring the references that were switch layers -- it's a kludge (and really only for my own workflow) but in my case the switches set width by using styles, so I can just adjust that (and that will adjust things properly on both master and reference).