MohoDocLayerByDepth-out of range

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

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
chucky
Posts: 4650
Joined: Sun Jan 28, 2007 4:24 am

MohoDocLayerByDepth-out of range

Post by chucky »

Anybody know what this means? MohoDocLayerByDepth-out of range
Why am I getting this ? :(
User avatar
hayasidist
Posts: 3492
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: MohoDocLayerByDepth-out of range

Post by hayasidist »

well -- there's not a script interface to MohoDoc:LayerByDepth - but there is a MohoDoc:DepthSort() (http://mohoscripting.com/index.php?show ... ort&id=773) as well as Group layer variants.

there is a script interface for GroupLayer:LayerByDepth(id) - and that'll be used by anything that's trying to do a depth sort (more here: http://mohoscripting.com/index.php?show ... yer&id=639)

and what that error message *probably* says is that something is calling GroupLayer:LayerByDepth(id) with a number that's more than the number of layers in a group (counting from 0) or is less than 0.

so two questions:
-- do you have "sort by depth" enabled on any group type layer(s)?
-- do you run any scripts that might be trying to do a similar job?


if the answers are "yes" and "no" in that order, then IMO it's a bug...
if the answers are "no" and "yes" in that order, then there's a script that's not working properly

otherwise - dunno! I'd start by looking at scripts that you're using (thinks bubble: pretty sure I don't use SortByDepth in any scripts that you might have had from me...)
chucky
Posts: 4650
Joined: Sun Jan 28, 2007 4:24 am

Re: MohoDocLayerByDepth-out of range

Post by chucky »

Thanks for that Paul.
So it's no and no, which is weird huh?

Oh btw when I looked at Mohoscripting.com I noticed there a relink styles 'command' or function or whatever it is. :oops:
Does that means it is possible to relink styles ( with the same name) using a script?
User avatar
hayasidist
Posts: 3492
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: MohoDocLayerByDepth-out of range

Post by hayasidist »

chucky wrote: Oh btw when I looked at Mohoscripting.com I noticed there a relink styles 'command' or function or whatever it is. :oops:
Does that means it is possible to relink styles ( with the same name) using a script?
I've been playing with that for a while - since this: viewtopic.php?f=2&t=31433 in fact .. but I've not yet managed to get to a situation where I've succeeded in creating the styles to relink. AddStyle falls over in the way we've been discussing http://www.kelleytown.com/forum/animato ... IC_ID=3546; importing layers (with or without relink checked) leaves you past the point it might be useful...
chucky wrote: Anybody know what this means? MohoDocLayerByDepth-out of range. Why am I getting this ?
Is it a frequent / reproducible event? I've had some "weird" one-off unexplained issuances from moho that I've put down to things running for "too long" - and, ofc, there's no substantive evidence left after the event to warrant a bug report. I've had similar situations whilst developing my own scripts that I've traced back (and fixed!!) to one or both of: wrong scope of lua variables (e.g. either no or too many declarations of "local"); not properly re-initialising on a second run without a reload (e.g. I've declared local j = 0; used j so now it's (say) 6; and then, without exiting, run the guts of the script again and j starts at 6 not 0 ... ka-boom) IOW runs perfectly every first time - but falls over on second use without, e.g., swapping to a different tool in between! So IMO there might be something like that going on in your case.
chucky
Posts: 4650
Joined: Sun Jan 28, 2007 4:24 am

Re: MohoDocLayerByDepth-out of range

Post by chucky »

Earlier today I actually reinstalled Moho after failed saves and other aberrations.
Things seem to be running much more smoothly, even ' that file' has started playing much nicer after a few saves in the new install. I don't know if that makes sense, but I can finally drag the timeline cursor around without locking up, who knows what's been going on.

That styles thing is a bit stinky, but I had a thought just now , not in regard to relinking but to the other style wizard thing we talked about.
Ahh forget it, lol, every advantage with styles has a disadvantage eh.?
User avatar
hayasidist
Posts: 3492
Joined: Wed Feb 16, 2011 8:12 pm
Location: Kent, England

Re: MohoDocLayerByDepth-out of range

Post by hayasidist »

yeah -- a reinstall does seem to be the cure-all -- Just another example: I am absolutely boggled by the problems this user had -- and I am still bewildered as to what there is in settings that could have caused these problems when scrubbing the timeline: viewtopic.php?f=2&t=31434

I'm hoping that the devs are watching - especially on styles - and will remove the blocks to making progress on that "other style wizard thing"..
chucky
Posts: 4650
Joined: Sun Jan 28, 2007 4:24 am

Re: MohoDocLayerByDepth-out of range

Post by chucky »

Yeah that was super weird, so was the double size documents that don't open that I was getting, saving to the library or gathering media ( I haven't checked that's working yet) but settings ? That's bizarre.
Well I hope the devs aren't burning out on other software that they take more seriously, leaving poor old Moho as an afterthought, that's my fear.
I miss our fearless leader and guru, dedicated and generous. It'll take some going to live up to Mike. :cry:
Post Reply