title: a mel delete attributes in maya after import fbx form 3dmax
body: <p>20180509</p>
  
  <p>Thanks for your information.
  I'd finished mel like that.</p>
  
  <pre><code>select -all -hi;
  string $allObj[] =`ls -sl -fl `;
  for($i=0;$i&lt;`size$allObj`;$i++)
      {
      select -r $allObj[$i];
      int $attrExists = `attributeQuery -node $allObj[$i] -exists "mrFBXASC032displacementFBXASC032useFBXASC032globalFBXASC032settings"`;
  if ($attrExists) {
      deleteAttr -at "mrFBXASC032displacementFBXASC032useFBXASC032globalFBXASC032settings" $allObj[$i];
  }
      int $attrExists = `attributeQuery -node $allObj[$i] -exists "mrFBXASC032displacementFBXASC032viewFBXASC032dependent"`;
  if ($attrExists) {
      deleteAttr -at "mrFBXASC032displacementFBXASC032viewFBXASC032dependent" $allObj[$i];
  }
      int $attrExists = `attributeQuery -node $allObj[$i] -exists "mrFBXASC032displacementFBXASC032method"`;
  if ($attrExists) {
      deleteAttr -at "mrFBXASC032displacementFBXASC032method" $allObj[$i];
  }
      int $attrExists = `attributeQuery -node $allObj[$i] -exists "mrFBXASC032displacementFBXASC032smoothingFBXASC032on"`;
  if ($attrExists) {
      deleteAttr -at "mrFBXASC032displacementFBXASC032smoothingFBXASC032on" $allObj[$i];
  }
      int $attrExists = `attributeQuery -node $allObj[$i] -exists "mrFBXASC032displacementFBXASC032edgeFBXASC032length"`;
  if ($attrExists) {
      deleteAttr -at "mrFBXASC032displacementFBXASC032edgeFBXASC032length" $allObj[$i];
  }
      int $attrExists = `attributeQuery -node $allObj[$i] -exists "mrFBXASC032displacementFBXASC032maxFBXASC032displace"`;
  if ($attrExists) {
      deleteAttr -at "mrFBXASC032displacementFBXASC032maxFBXASC032displace" $allObj[$i];
  }
      int $attrExists = `attributeQuery -node $allObj[$i] -exists "mrFBXASC032displacementFBXASC032parametricFBXASC032subdivisionFBXASC032level"`;
  if ($attrExists) {
      deleteAttr -at "mrFBXASC032displacementFBXASC032parametricFBXASC032subdivisionFBXASC032level" $allObj[$i];
  }
      int $attrExists = `attributeQuery -node $allObj[$i] -exists "UDP3DSMAX"`;
  if ($attrExists) {
      deleteAttr -at "UDP3DSMAX" $allObj[$i];
  }
      int $attrExists = `attributeQuery -node $allObj[$i] -exists "MaxHandle"`;
  if ($attrExists) {
      deleteAttr -at "MaxHandle" $allObj[$i];
  }
      int $attrExists = `attributeQuery -node $allObj[$i] -exists "MaxVisibility"`;
  if ($attrExists) {
      deleteAttr -at "MaxVisibility" $allObj[$i];
  }
      int $attrExists = `attributeQuery -node $allObj[$i] -exists "currentUVSet"`;
  if ($attrExists) {
      deleteAttr -at "currentUVSet" $allObj[$i];
  }
  }
  </code></pre>
  
  <p>Show another error
  <code>Cannot delete static attribute 'currentUVSet' from node 'ObjectName'</code></p>
  
  <p>Does children of a compound attribute cannot be deleted?</p>
  
  <p>Or is it not nesserary to delete attribute 'currentUVSet'?</p>
  
  <hr>
  
  <p>20180508</p>
  
  <p>After I import fbx file to maya from 3dmax. 
  Those objects have some attributes that I don't need.</p>
  
  <pre><code>"mrFBXASC032displacementFBXASC032useFBXASC032globalFBXASC032settings"
  "mrFBXASC032displacementFBXASC032viewFBXASC032dependent"
  "mrFBXASC032displacementFBXASC032method"
  "mrFBXASC032displacementFBXASC032smoothingFBXASC032on"
  "mrFBXASC032displacementFBXASC032edgeFBXASC032length"
  "mrFBXASC032displacementFBXASC032maxFBXASC032displace"
  "mrFBXASC032displacementFBXASC032parametricFBXASC032subdivisionFBXASC032level"
  "UDP3DSMAX"
  "MaxHandle"
  "currentUVSet"
  </code></pre>
  
  <p>I try to have a mel delete them.</p>
  
  <pre><code>string $allObj[] =`ls -sl -fl `;
  for($i=0;$i&lt;`size$allObj`;$i++)
      {
      select -r $allObj[$i];
      deleteAttr -at "mrFBXASC032displacementFBXASC032useFBXASC032globalFBXASC032settings";
      deleteAttr -at "mrFBXASC032displacementFBXASC032viewFBXASC032dependent";
      deleteAttr -at "mrFBXASC032displacementFBXASC032method";
      deleteAttr -at "mrFBXASC032displacementFBXASC032smoothingFBXASC032on";
      deleteAttr -at "mrFBXASC032displacementFBXASC032edgeFBXASC032length";
      deleteAttr -at "mrFBXASC032displacementFBXASC032maxFBXASC032displace";
      deleteAttr -at "mrFBXASC032displacementFBXASC032parametricFBXASC032subdivisionFBXASC032level";
      deleteAttr -at "UDP3DSMAX";
      deleteAttr -at "MaxHandle";
      deleteAttr -at "currentUVSet";
      }
  }
  </code></pre>
  
  <p>If I select all objects. mel will show error message like :
  <code>does not have attribute 'UDP3DSMAX'</code></p>
  
  <p>Because those objects don't have the same nodes.
  How to delete all attributes at correct way?</p>