<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How would i make a small script from Mel that controls mesh is selectable or not, and i can i do a same thing in python? in Maya Programming Forum</title>
    <link>https://forums.autodesk.com/t5/maya-programming-forum/how-would-i-make-a-small-script-from-mel-that-controls-mesh-is/m-p/10899934#M3015</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I trying to make a script using Mel that uses setObjectPickMask so tried doing this code&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;It didnt work well i never wrote a Mel before. so basically i am trying to do is make a script that makes Mesh Selectable and non Selectable just like the button in the status line but in script form.&lt;/P&gt;&lt;P&gt;Please share your thoughts how can i achieve this and is this possible doing in python?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;if (ObjectPickMask "Surface" == true)
{
setObjectPickMask "Surface" false;
updateObjectSelectionMasks;
updateComponentSelectionMasks;
dR_selTypeChanged("");
    
}

else if (ObjectPickMask "Surface" == false)
{
setObjectPickMask "Surface" true;
updateObjectSelectionMasks;
updateComponentSelectionMasks;
dR_selTypeChanged("");
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 23 Jan 2022 20:35:36 GMT</pubDate>
    <dc:creator>abhinav.verma2607</dc:creator>
    <dc:date>2022-01-23T20:35:36Z</dc:date>
    <item>
      <title>How would i make a small script from Mel that controls mesh is selectable or not, and i can i do a same thing in python?</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/how-would-i-make-a-small-script-from-mel-that-controls-mesh-is/m-p/10899934#M3015</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I trying to make a script using Mel that uses setObjectPickMask so tried doing this code&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;It didnt work well i never wrote a Mel before. so basically i am trying to do is make a script that makes Mesh Selectable and non Selectable just like the button in the status line but in script form.&lt;/P&gt;&lt;P&gt;Please share your thoughts how can i achieve this and is this possible doing in python?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;if (ObjectPickMask "Surface" == true)
{
setObjectPickMask "Surface" false;
updateObjectSelectionMasks;
updateComponentSelectionMasks;
dR_selTypeChanged("");
    
}

else if (ObjectPickMask "Surface" == false)
{
setObjectPickMask "Surface" true;
updateObjectSelectionMasks;
updateComponentSelectionMasks;
dR_selTypeChanged("");
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Jan 2022 20:35:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/how-would-i-make-a-small-script-from-mel-that-controls-mesh-is/m-p/10899934#M3015</guid>
      <dc:creator>abhinav.verma2607</dc:creator>
      <dc:date>2022-01-23T20:35:36Z</dc:date>
    </item>
    <item>
      <title>Re: How would i make a small script from Mel that controls mesh is selectable or not, and i can i do a same thing in python?</title>
      <link>https://forums.autodesk.com/t5/maya-programming-forum/how-would-i-make-a-small-script-from-mel-that-controls-mesh-is/m-p/10901615#M3016</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What you are looking for is the selectType command, which is used to query/set the selectable objecttypes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MEL:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;int $selType =  `selectType -q -p`;
if ($selType == 0){
    selectType -p true;
   
}
else{
    selectType -p false;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Python:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;import maya.cmds as mc

if mc.selectType(q = True, p = True) == True:
    mc.selectType(p = False)
else:
    mc.selectType(p = True)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope this helps!&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jan 2022 14:47:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/maya-programming-forum/how-would-i-make-a-small-script-from-mel-that-controls-mesh-is/m-p/10901615#M3016</guid>
      <dc:creator>Kahylan</dc:creator>
      <dc:date>2022-01-24T14:47:58Z</dc:date>
    </item>
  </channel>
</rss>

