Fix incorrect red crosses in layer panel?
Moderators: Víctor Paredes, Belgarath, slowtiger
Fix incorrect red crosses in layer panel?
Does anyone know if there's a function or trick to get rid of incorrect red crosses in the layer panel?
I often have layers that contained something with a path to a file that was not found. Even after relocating the file manually or by script, the red crosses don't disappear in some cases. I would like to somehow clean that up, so I can see what files are actually still missing.
I often have layers that contained something with a path to a file that was not found. Even after relocating the file manually or by script, the red crosses don't disappear in some cases. I would like to somehow clean that up, so I can see what files are actually still missing.
- synthsin75
- Posts: 10043
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: Fix incorrect red crosses in layer panel?
Depends on the layer type. It could be a missing image or layerscript. I've never seen the X remain after correcting those. Do you have a file with an example of one of these problem layers?
- Wes
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Re: Fix incorrect red crosses in layer panel?
Well, after saving and re-opening the file the crosses are gone. Because the files were not actually missing. So it’s not really possible to share and see what’s wrong with the file. It’s just Moho not updating the layer panels. There’s nothing wrong with the files.
It happens after opening files and Moho can’t access the source files anymore and then relinking them via script. (Working from home forces me to replace paths for projects a lot, while keeping the folder structure intact). If I link sources manually the group layers that once contained missing stuff also stays with a red cross until I save and re-open.
For a missing image (that is no longer missing but still has the red cross), moving it with the layer transform tool removes the cross... But it’d be nice to somehow update the layer panel’s icons without having to touch everything or having to save and re-open (only to find out 1 of the 100 layers had a valid red cross)
I was hoping for a UpdateUI kind of thing, or maybe something I could do while iterating trough layers that updates the icon.
It happens after opening files and Moho can’t access the source files anymore and then relinking them via script. (Working from home forces me to replace paths for projects a lot, while keeping the folder structure intact). If I link sources manually the group layers that once contained missing stuff also stays with a red cross until I save and re-open.
For a missing image (that is no longer missing but still has the red cross), moving it with the layer transform tool removes the cross... But it’d be nice to somehow update the layer panel’s icons without having to touch everything or having to save and re-open (only to find out 1 of the 100 layers had a valid red cross)
I was hoping for a UpdateUI kind of thing, or maybe something I could do while iterating trough layers that updates the icon.
- hayasidist
- Posts: 3584
- Joined: Wed Feb 16, 2011 8:12 pm
- Location: Kent, England
Re: Fix incorrect red crosses in layer panel?
I suppose you've tried the obvious three:
MOHO.Redraw; MohoView:DrawMe; ScriptInterface:UpdateUI
A thought - not tried this, so I really am just brainstorming -- do you access a layer without making it the selected layer?
IOW might (e.g.):
ScriptInterface:SetSelLayer(ImageLayer)
ImageLayer:SetSourceImage(path)
ScriptInterface:UpdateUI()
do the trick??
MOHO.Redraw; MohoView:DrawMe; ScriptInterface:UpdateUI
A thought - not tried this, so I really am just brainstorming -- do you access a layer without making it the selected layer?
IOW might (e.g.):
ScriptInterface:SetSelLayer(ImageLayer)
ImageLayer:SetSourceImage(path)
ScriptInterface:UpdateUI()
do the trick??
Re: Fix incorrect red crosses in layer panel?
Thanks, I will try all of those tomorrow!
- synthsin75
- Posts: 10043
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: Fix incorrect red crosses in layer panel?
I'm not able to replicate this in v12.5 (Win). Every time I relink an asset, the X immediately goes away.
Maybe it has something to do with networked assets? If so, maybe that's what needs LM_SecureAccess (I've never known): http://mohoscripting.com/methods/607
Off-topic...Paul, do you know what "*5* notation will have been stripped off." means on this? >> http://mohoscripting.com/methods/607
Maybe it has something to do with networked assets? If so, maybe that's what needs LM_SecureAccess (I've never known): http://mohoscripting.com/methods/607
Off-topic...Paul, do you know what "*5* notation will have been stripped off." means on this? >> http://mohoscripting.com/methods/607
- Wes
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
- hayasidist
- Posts: 3584
- Joined: Wed Feb 16, 2011 8:12 pm
- Location: Kent, England
Re: Fix incorrect red crosses in layer panel?
I've not used that routine either - so intuitive deduction only: If it's a PSD file the *n* suffix to filename identifies which layer within the file -- if so, IMO, that method description would benefit from a tweak to clarify that it's the layer sequence number within the PSD (There are a few places -- which, ofc, I can't now quickly find -- where mohoscripting.com refers to the suffix)synthsin75 wrote: ↑Mon Mar 08, 2021 11:41 pm ...
Maybe it has something to do with networked assets? If so, maybe that's what needs LM_SecureAccess (I've never known): http://mohoscripting.com/methods/607
Off-topic...Paul, do you know what "*5* notation will have been stripped off." means on this? >> http://mohoscripting.com/methods/607
Re: Fix incorrect red crosses in layer panel?
Unfortunately, none of those functions worked.
The incorrect cross is reproducible like this:
The incorrect cross is reproducible like this:
- Create a new document
- Import an image
- Put the image in a group
- Save the document
- Rename the image
- Close and re-open the document
- Say NO to relocate the image
- Rename the image file back to its original filename
- In Moho the image is now visible again, but both the group and the image layer have a red cross
- Use the transform tool on the image layer, the red cross will disappear from the image layer
- Use the transform tool on the group layer, the red cross will disappear from the group layer
Re: Fix incorrect red crosses in layer panel?
Just discovered if I click the "Text" tool and press "Cancel" it actually fixes all the red crosses. No idea why and if it's even possible to somehow do what that tool does trough lua, but it's something.
Re: Fix incorrect red crosses in layer panel?
Okay, for images it fixes the issue if you unload the image before setting the new path!
The groups that contain those images are still showing the red crosses though.
Edit: Oh it doesn't always work. That's odd..
Code: Select all
ImageLayer:UnloadImage()
ImageLayer:SetSourceImage(path)
Edit: Oh it doesn't always work. That's odd..
- hayasidist
- Posts: 3584
- Joined: Wed Feb 16, 2011 8:12 pm
- Location: Kent, England
Re: Fix incorrect red crosses in layer panel?
[working on this whilst you added the last two posts ... so some redundant info here ...]
I had a look at the layer transform tool... the only thing in there that seems relevant to a UI refresh is a mouseEvent.view:DrawMe() -- so assuming we're in a button script, and the moho.view:DrawMe() didn't work then it's likely that it's a core product thing ..
[edit] and the insert text tool just calls a core product routine so that makes it pretty certain it's something in there and not do-able via the script interface ..
another way to lose the red X in the layers window for both image and group ---> select the image layer - right click - reference layer - ctrl-z
still less than ideal but ...
I had a look at the layer transform tool... the only thing in there that seems relevant to a UI refresh is a mouseEvent.view:DrawMe() -- so assuming we're in a button script, and the moho.view:DrawMe() didn't work then it's likely that it's a core product thing ..
[edit] and the insert text tool just calls a core product routine so that makes it pretty certain it's something in there and not do-able via the script interface ..
another way to lose the red X in the layers window for both image and group ---> select the image layer - right click - reference layer - ctrl-z
still less than ideal but ...
Re: Fix incorrect red crosses in layer panel?
Ah yes, the script that I am running is a button script. So I guess that's why I can't refresh the UI properly.
I run it automatically when opening a file (trough an IsEnabled function that makes sure it's only running once), which is really convenient because pretty much all the files I open have wrong paths, and when I save them I need other people back on the other end to be able to open them too and reverse the paths again. It works quite well, except for documents having hundreds of red crosses sometimes...
I run it automatically when opening a file (trough an IsEnabled function that makes sure it's only running once), which is really convenient because pretty much all the files I open have wrong paths, and when I save them I need other people back on the other end to be able to open them too and reverse the paths again. It works quite well, except for documents having hundreds of red crosses sometimes...
- hayasidist
- Posts: 3584
- Joined: Wed Feb 16, 2011 8:12 pm
- Location: Kent, England
Re: Fix incorrect red crosses in layer panel?
sounds like a trip to Jira is needed...
- synthsin75
- Posts: 10043
- Joined: Mon Jan 14, 2008 11:20 pm
- Location: Oklahoma
- Contact:
Re: Fix incorrect red crosses in layer panel?
Ah, thanks Paul. That makes perfect sense.hayasidist wrote: ↑Tue Mar 09, 2021 8:18 amI've not used that routine either - so intuitive deduction only: If it's a PSD file the *n* suffix to filename identifies which layer within the file -- if so, IMO, that method description would benefit from a tweak to clarify that it's the layer sequence number within the PSD (There are a few places -- which, ofc, I can't now quickly find -- where mohoscripting.com refers to the suffix)synthsin75 wrote: ↑Mon Mar 08, 2021 11:41 pm Off-topic...Paul, do you know what "*5* notation will have been stripped off." means on this? >> http://mohoscripting.com/methods/607
- Wes
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/
Donations: https://www.paypal.com/paypalme/synthsin75 (Thx, everyone.)
https://www.youtube.com/user/synthsin75
Scripting reference: https://mohoscripting.com/