title: Invalid flag "testVisibility" in Autodesk Maya 2016
body: <p>I'm trying to determine if a set of mesh nodes is currently visible or not. Using pymel and <a href="http://download.autodesk.com/global/docs/maya2012/en_us/PyMel/generated/classes/pymel.core.nodetypes/pymel.core.nodetypes.DagNode.html?highlight=isvisible#pymel.core.nodetypes.DagNode.isVisible" rel="nofollow noreferrer">isVisible()</a> works, but it's a huge performance hit.
  Looking through the documentation, I found something that would (hopefully) solve my problem, the flag <code>testVisibility</code> on the Command <a href="http://help.autodesk.com/cloudhelp/2016/ENU/Maya-Tech-Docs/CommandsPython/hide.html" rel="nofollow noreferrer">hide</a>.</p>
  
  <p>According to the documentation the flag command will return a value that tells me if the specified nodes are visible or not.</p>
  
  <p>The problem is, that flag doesn't exist.</p>
  
  <pre><code>import maya.cmds as cmds
  
  cmds.sphere(name='testsphere')
  cmds.hide('testsphere', testVisibility = True)
  </code></pre>
  
  <p>Gives an error</p>
  
  <pre><code># Error: Invalid flag 'testVisibility'
  # Traceback (most recent call last):
  #   File "&lt;maya console&gt;", line 4, in &lt;module&gt;
  # TypeError: Invalid flag 'testVisibility' # 
  </code></pre>
  
  <p>Same thing with the shortname of the flag "tv", as well as doing the whole thing in MEL: <code>hide -testVisibility;</code>.</p>
  
  <p>The documentation includes this flag since Maya 2016. This is also the Maya version that I am using currently (more specifically, Maya 2016 SP5). Using the built-in link to the python documentation I arrive at the same documentation as I posted above. Looking through the changelog of SP6 doesn't mention anything of it either, so I assume it won't solve my problem.</p>
  
  <p>I tried the same command on Maya 2017 and it works. That won't help me much though because that's not the Maya version that our team uses currently.</p>
  
  <p>I can't contact Autodesk support because I'm not a subscriber (thanks autodesk, great help).</p>
  
  <p>So my questions are:</p>
  
  <ul>
  <li><p>is there something that I'm missing/that I overlooked? Are these flags only implemented in some kind of super duper developer plugin? Do Maya versions only use the API of the previous versions or something?</p>
  
  <ul>
  <li>is there a way to check if a command has a flag, without try-catching it?</li>
  <li>any workarounds that are not as performance draining as the pymel route I mentioned above?</li>
  </ul></li>
  </ul>