Lightroom SDK: Documentation error - bind_to_object must be property table object, not string name

  • 2
  • Problem
  • Updated 6 years ago
Lightroom SDK: Documentation error - bind_to_object must be property table object, not string name.

See LrView.bind in the API doc.
Photo of Rob Cole

Rob Cole

  • 4831 Posts
  • 382 Reply Likes

Posted 6 years ago

  • 2
Photo of Rob Cole

Rob Cole

  • 4831 Posts
  • 382 Reply Likes
Also, I've been able to pass an indexed property (sub)table as bind_to_object, and it works just fine - i.e. desired preference change happens, in ram, except it "corrupts" the preferences: "Table nested too deep". I'd really like to see the change whereby one can listen for changes to leaf nodes in tree-structured pref objects, but until then, I suggest a check for top-level pref object to avoid the aforementioned problem. Or if I'm missing something, please advise...

e.g.
local prefs = LrPrefs.prefsForPlugin()
prefs["mytableofprefs"] = { ['mysubtable']={myvalue="hiworld"} }
bind_to_object = prefs.mytableofprefs.mysubtable
value = LrView.bind 'myvalue'

works (can change myvalue "leaf" pref from hiworld, to byeworld, as example). - but causes excessive table nesting / corrupt preferences.

Perhaps "bind_to_object = prefs.mytableofprefs.mysubtable" should be disallowed until it will works properly.