<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div dir="ltr"></div><div dir="ltr">It makes sense that selection and visibility are not Object properties, but that’s an implementation detail that I don’t believe should to be visible in the Python API. What I’m asking is that the appropriate getter and setter functions be called through the standard python property access methods. I’m not an expert on the Python C API, but shouldn’t it be possible to use `PyGetSetDef` to redirect property access to call the new getter and setter methods, without having to expose this change to Python code? For example: <a href="https://llllllllll.github.io/c-extension-tutorial/member-vs-getset.html">https://llllllllll.github.io/c-extension-tutorial/member-vs-getset.html</a></div><div dir="ltr"><br>On Nov 5, 2018, at 12:15 PM, Bastien Montagne <<a href="mailto:montagne29@wanadoo.fr">montagne29@wanadoo.fr</a>> wrote:<br><br></div><blockquote type="cite"><div dir="ltr">
  
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  
  
    <p>Hi Benjamin,<br>
    </p>
    <p>TL;DR: We did that in 2.7x, it’s not possible anymore in 2.8x
      (not without **huge** changes in a large part of RNA, and adding
      significant complication to the API).</p>
    <p>Technical explanation:<br>
    </p>
    This decision was taken because selection status **is not an Object
    data**, not at all. It is stored in the object 'instantiation' data
    (called Base, and not exposed to Python) used to 'link' an object to
    a ViewLayer. Hence it is context-dependent info, which cannot be
    retrieved through our RNA property system.<br>
    <p>Ideally, there should be no access at all to that status in RNA,
      at least no setter, it should be something let to operators, or
      alternatively, we’d have to expose the whole Base concept to
      python. But that would add some noise and confusion to something
      already rather complicated (whole viewlayer/collection/object
      system).</p>
    <p>We have other similar accessors in Object API, like
      `visible_get()`, which follow the same principle (and do not have
      any setter).<br>
    </p>
    <p>Note that pure-python things like @property are totally
      irrelevant here, this is using the semi-auto-generated binding to
      C code/data (through RNA), which has its own rules and limitations
      on top of python C API.</p>
    <p>Bastien<br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 05/11/2018 18:37, Benjamin Humpherys
      wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:E86EB962-69FB-4147-9295-E1B6FB013C42@gmail.com">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8" class="">
      <div style="word-wrap: break-word; -webkit-nbsp-mode: space;
        line-break: after-white-space;" class="">I saw on the recent
        changes page on the wiki that the object selection API (<a href="https://wiki.blender.org/wiki/Reference/Release_Notes/2.80/Python_API/Scene_and_Object_API#Object_Selection_and_Hiding" class="" moz-do-not-send="true">https://wiki.blender.org/wiki/Reference/Release_Notes/2.80/Python_API/Scene_and_Object_API#Object_Selection_and_Hiding</a>)
        has changed from a simple `obj.select` property to
        `select_get()` and `select_set(’SELECT’)`. I strongly urge this
        decision to be reconsidered because it is not idiomatic Python
        to use getter and setter functions, let alone setting a boolean
        property with a string argument!
        <div class=""><br class="">
        </div>
        <div class="">Instead of getters and setters please consider
          making `select` a @property, or utilizing `PyGetSetDef`(<a href="https://docs.python.org/3/c-api/structures.html#c.PyGetSetDef" class="" moz-do-not-send="true">https://docs.python.org/3/c-api/structures.html#c.PyGetSetDef</a>)
          to hide any new getter/setter logic instead of putting it in
          the user-facing API.</div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Bf-python mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Bf-python@blender.org">Bf-python@blender.org</a>
<a class="moz-txt-link-freetext" href="https://lists.blender.org/mailman/listinfo/bf-python">https://lists.blender.org/mailman/listinfo/bf-python</a>
</pre>
    </blockquote>
    <br>
  

</div></blockquote><blockquote type="cite"><div dir="ltr"><span>_______________________________________________</span><br><span>Bf-python mailing list</span><br><span><a href="mailto:Bf-python@blender.org">Bf-python@blender.org</a></span><br><span><a href="https://lists.blender.org/mailman/listinfo/bf-python">https://lists.blender.org/mailman/listinfo/bf-python</a></span><br></div></blockquote></body></html>