rsjaffe / MIDI2LR

An application and plugin to remotely control Lightroom with a MIDI controller
http://rsjaffe.github.io/MIDI2LR/
GNU General Public License v3.0
673 stars 83 forks source link

Error when profile assigned to masking #666

Closed rsjaffe closed 4 months ago

rsjaffe commented 2 years ago

Describe the bug I'm getting the same "an internal error has occurred: ?:0: attempt to perform arithmetic on field '?" (a nil value) everytime I go into the masking tool (M) and midi2lr tries to load the file for "masking." MIDI2LR.log

There is no error if I leave the filename out of that box and leave it blank. I get the same error if I put anything in the box, regardless if it is a valid file, or missing file name.

wunditta commented 10 months ago

I found the bug after many hours. It is in FullRefresh and doprofilechange for 'direct' parameters (i.e. local adjustments). The line lrvalue = LrDevelopController.getValue(param) causes the issue, as "getValue" cannot return a value if no mask is selected. So changing the line in both functions to if LrDevelopController.getSelectedMask() then lrvalue = LrDevelopController.getValue(param) end avoids the error.

This may be a good opportunity to mention my fork wunditta/MIDI2LR with some tweaks and new functions (e.g. new Lr functions added in recent updates). I did this unwillingly as I would prefer that only one distribution exists. But since the last update is some time ago, I do not know if and when this will be maintained.

I would greatly wish to be contacted to join my fork in this and could provide some resources for fixing bugs and smaller changes. I am not a professional programmer though. Therefore my possibilities are limited (as can be seen in my code).

153957 commented 10 months ago

Maybe create a Pull Request to merge your fork back into this project ( https://github.com/rsjaffe/MIDI2LR/pulls ). Who knows, perhaps it will be come active again, and it makes it easier for others to find your version and discuss the changes.

wunditta commented 10 months ago

Thanks for the hint. I am very new to github. Currently I am still actively developing and would like to reach a stable point for me before I will release my fork. Then I will create a pull request. However I have already documented all changes I did so far on the wiki page of my fork.

wunditta commented 9 months ago

There is a pre-release of my fork wunditta/MIDI2LR, so if someone is brave enough to test... ;-) This and more or less all other issues here should be fixed. I will create a pull request when it seems working and stable for some time.

rsjaffe commented 4 months ago

Fixed in https://github.com/rsjaffe/MIDI2LR/commit/d92e89addac1b8f0840dd39d44ecb9d592d9be67