We have a laser that serval people can access and we are running into the issue that they are accidently changing the material library when they are trying to change the layer settings. Is there a way to lock the Library so no one change change it? Maybe lock it with a PIN?
I donât believe thereâs any way to do this within LightBurn.
However, you may be able to prevent writing changes to the file at the OS level.
Go to File Explorer in Windows and locate the material library. Right-click the file and go to Properties. Enable the âRead-onlyâ attribute for that file. That should prevent any changes to that file.
Iâve done a quick POC and it seems to work but not sure if there would be any side effects not seen immediately.
So I tried what you said it It is still changing the files however it shows an error saying âThe Library failed to saveâ but then it saves it. So is there anything else I can try?
Did you actually confirm that the file has changed? I donât think it does.
However, it seems the UI in LightBurn reflects the change so is out of sync with the file but the library contents are preserved.
LightBurn will then keep complaining about not being able to save. Restarting LightBurn restores the unmodified library.
I had exactly the same thought when I read the initial post. However, when I tried it LB totally ignored the fact that the file was read-only and overwrote the file with the new settings. It also disabled the read-only flag on the file. I keep my libraries and settings on a file share on my NAS but I wouldnât expect that to make any difference.
Interesting. I wasnât able to get the file to be overwritten at all. And I couldnât load a different library because it kept complaining of not being able to save the file. Restarting LightBurn put it back right and with no changes to the Library.
In any case, maybe not the best solution.
I used local storage so definitely a potential variable.
Very odd indeed.
I thought Iâd perform a test with a local library file. It still saved the changes but what it did was add a .old extension and save a new copy.
You can see that the Read-only attribute was retained for the renamed original file.
BTW, I donât get any errors such as @ACSlaser is experiencing.
I was writing a response asking about steps to reproduce. Then tried again to get you the error message that you werenât getting.
Somehow I was able to get the exact behavior as you. .old file created.
Tried it again and now can get the error message. Not sure exactly whatâs going on.
Hereâs the error message when the file isnât saved:
Yes, I can confirm that behaviour. The second change I make elicits the same error. I must admit I did wonder whether a second edit would do this. I expect itâs because LB canât delete the original file (now with the .old extension) because of the Read-only attribute. If I delete the .old file LB will now save the next change. I have also noticed that if I donât set the Read-only attribute then the .old file doesnât get created (well, it probably does but very briefly).
Anyway, itâs obviously not a solution to @ACSlaserâs issue.
Not certain but I donât think thatâs the primary issue since Iâm almost certain I got this error on my very first test.
Agreed. Not nearly predictable enough. Shelve this one.
Any other method do you have in mind?
This stupid 10 character minimum is a nuisance!
Canât really think of one. Maybe we can take a step back and rethink the problem.
What is your actual goal in doing this? If itâs only in preserving a pristine version of the library then perhaps you donât bother trying to prevent changes. Maybe you set something up that recovers a fresh version of a pristine copy on a regular interval. Perhaps daily, or every login, or at restart of LightBurn.
A workable answer will depend on the actual constraints and the scale of the problem youâre trying to solve for.
My thoughts exactly. It could be something as simple as a batch file that can be run manually or triggered by a specific event set up in Windows Task Scheduler.
So that is a start but how would we save new materials to the library? We want to be able to save new materials as well as keep the ones that are default.
I assume this would only be done by sanctioned âpower usersâ or administrator, correct? If so, those people can update directly to the pristine copy that will then get propagated to the working copy.
So nobody should be working directly in the pristine copy.
The LightBurn âMaterial Libraryâ has a little know option that might be helpful in this case.
Entry Thickness=â3.0000â Locked=â1â Desc=âLineâ
Adding the Locked=â1â property to any entry in the material library will lock it. You can continue to add new entries to the library, but not edit the locked entries.
Would this work for your requirements?
Very clever LightBurn teamâŚ
Just tested this and can confirm that it indeed prevents changes. Makes it a little difficult to see the current settings as basically it prevents the editor from coming up.
Doesnât prevent new adds which may or may not be desired.
Example. Note that the âlockedâ entry has a shaded background.
Was responding to this request.
Yes Adding Locked=â1â in front of each entry using notepad++ locks that material from being edited and still able to assign and use it. I am still able to make new material too. Thank you for the help