<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:clearspace="http://www.jivesoftware.com/xmlns/jive/rss" version="2.0">
  <channel>
    <title>Adobe Community: Message List - SDK: getmetatable of SDK objects raises error</title>
    <link>https://forums.adobe.com/community/labs/archives/lightroom4?view=discussions</link>
    <description>Most recent forum messages</description>
    <language>en</language>
    <pubDate>Thu, 12 Jan 2012 03:00:08 GMT</pubDate>
    <generator>Jive Engage 7.0.0.1  (http://jivesoftware.com/products/)</generator>
    <dc:date>2012-01-12T03:00:08Z</dc:date>
    <dc:language>en</dc:language>
    <item>
      <title>Re: SDK: getmetatable of SDK objects raises error</title>
      <link>https://forums.adobe.com/message/4134452?tstart=0#4134452</link>
      <description>&lt;!-- [DocumentBodyStart:1e60e330-77e3-4f5c-b6ba-2eb75534a981] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;Most of the newer classes have a type() method that provides the information you are looking for. Unfortunately this hasn't been retrofitted to the existing classes so it looks like you will only be able to identify those older classes through more ugly means (e.g. testing for existence of a method name unique to that class).&amp;nbsp; As I said, ugly.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I'm not 100% surprised that the undocumented feature you were using went away - it does seem to present a risk even if only minor - but it would be nice to see an alternative mechanism be provided to get that same information.&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:1e60e330-77e3-4f5c-b6ba-2eb75534a981] --&gt;&lt;img src='/beacon?t=1415888232422' /&gt;</description>
      <pubDate>Thu, 12 Jan 2012 03:00:08 GMT</pubDate>
      <author>forums_noreply@adobe.com</author>
      <guid>https://forums.adobe.com/message/4134452?tstart=0#4134452</guid>
      <dc:date>2012-01-12T03:00:08Z</dc:date>
      <clearspace:dateToText>2 years 10 months ago</clearspace:dateToText>
      <clearspace:objectType>0</clearspace:objectType>
    </item>
    <item>
      <title>Re: SDK: getmetatable of SDK objects raises error</title>
      <link>https://forums.adobe.com/message/4134450?tstart=0#4134450</link>
      <description>&lt;!-- [DocumentBodyStart:ae9ded2d-6713-48dd-86c9-76b18fd0b1cf] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;Becky has previously indicated the SDK won't be available as part of the beta.&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:ae9ded2d-6713-48dd-86c9-76b18fd0b1cf] --&gt;</description>
      <pubDate>Thu, 12 Jan 2012 02:53:25 GMT</pubDate>
      <author>forums_noreply@adobe.com</author>
      <guid>https://forums.adobe.com/message/4134450?tstart=0#4134450</guid>
      <dc:date>2012-01-12T02:53:25Z</dc:date>
      <clearspace:dateToText>2 years 10 months ago</clearspace:dateToText>
      <clearspace:objectType>0</clearspace:objectType>
    </item>
    <item>
      <title>Re: SDK: getmetatable of SDK objects raises error</title>
      <link>https://forums.adobe.com/message/4133716?tstart=0#4133716</link>
      <description>&lt;!-- [DocumentBodyStart:119f4dde-706f-42c5-83e0-75f623b6b8ef] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;Got the same problem with my plugins. Any sign of LR4 SDK?&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:119f4dde-706f-42c5-83e0-75f623b6b8ef] --&gt;</description>
      <pubDate>Wed, 11 Jan 2012 21:01:31 GMT</pubDate>
      <author>forums_noreply@adobe.com</author>
      <guid>https://forums.adobe.com/message/4133716?tstart=0#4133716</guid>
      <dc:date>2012-01-11T21:01:31Z</dc:date>
      <clearspace:dateToText>2 years 10 months ago</clearspace:dateToText>
      <clearspace:replyCount>1</clearspace:replyCount>
      <clearspace:objectType>0</clearspace:objectType>
    </item>
    <item>
      <title>SDK: getmetatable of SDK objects raises error</title>
      <link>https://forums.adobe.com/message/4133651?tstart=0#4133651</link>
      <description>&lt;!-- [DocumentBodyStart:934d9d20-83f8-40d7-af9e-e8415d9c16e5] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;In LR 3, getmetable(o), where o is an SDK object (e.g. an LrFolder), would return a string naming the type of that object (e.g. "LrFolder").&amp;nbsp; In LR 4 beta it raises an error:&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="padding-left: 30px;"&gt;plug-ins can not access metatables for tables created by the Lirghtroom SDK&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;This causes a problem for debugging, since a general print function capable of printing any object (e.g. my Debugging Toolkit Debug.pp) needs a way to determine whether an object is an SDK object and of printing as much information about that object as possible.&amp;nbsp; Debug.pp is perhaps my single most productive development aid.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Is this restriction on getmetatable() really needed?&amp;nbsp; What bad behavior by plugin authors does it prevent?&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Is a workaround is to use this function?&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p style="padding-left: 30px;"&gt;function isSDKObject (value)&lt;/p&gt;&lt;p style="padding-left: 30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return pcall (getmetatable, value)&lt;/p&gt;&lt;p style="padding-left: 30px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Catching undocumented errors is always fraught with peril, and it is probably significantly slower than the LR 3 way.&amp;nbsp; (Speed of Debug.pp is important, since several plugins use it to save complex values persistently in files.).&amp;nbsp; Is there a better way to tell if a value is an SDK object?&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:934d9d20-83f8-40d7-af9e-e8415d9c16e5] --&gt;</description>
      <pubDate>Wed, 11 Jan 2012 20:55:21 GMT</pubDate>
      <author>forums_noreply@adobe.com</author>
      <guid>https://forums.adobe.com/message/4133651?tstart=0#4133651</guid>
      <dc:date>2012-01-11T20:55:21Z</dc:date>
      <clearspace:dateToText>2 years 10 months ago</clearspace:dateToText>
      <clearspace:replyCount>3</clearspace:replyCount>
      <clearspace:objectType>0</clearspace:objectType>
    </item>
  </channel>
</rss>

