//
// Pre Shape User Interface (UI) Mel Script
//
global proc wyvillEdgesUI() 
{
string $selected[] = `ls -sl`;
int $i;
  
for($i = 0; $i < size($selected); $i++ ) {
    string $shp[] = `listRelatives -shapes $selected[$i]`;
  
    // To add the UI implemented by this proc to the "Geometric
    // Settings" panel use the following mel commands,
    //        select rmanSettings;
    //        pnt2lineUI;
    // where "rmanSettings" might be rmanSettings1, rmanSettings2 etc.
    if(`nodeType $selected[$i]` == "RenderMan")
        $shp[0] = $selected[$i];
  
    string $shapeName = $shp[0];
    string $attr = `rmanGetAttrName "preShapeScript"`;
  
    // "Connect" to the mel script that calls 
    // Pixar's custom Ri mel procedures.
    rmanAddAttr $shapeName $attr "wyvillEdgesRI";
        
    $attr = `rmanGetAttrName "wyvill_maxEdges"`;
    rmanAddAttr $shapeName $attr "1000";
  
    $attr = `rmanGetAttrName "wyvill_cacheName"`;
    rmanAddAttr $shapeName $attr "object_name";
  
    $attr = `rmanGetAttrName "wyvill_cacheMode"`;
    rmanAddAttr $shapeName $attr "0";
        
    $attr = `rmanGetAttrName "wyvill_renderMode"`;
    rmanAddAttr $shapeName $attr "0";
  
    $attr = `rmanGetAttrName "wyvill_thickness"`;
    rmanAddAttr $shapeName $attr "0.02";
    }
}