SHARE
TWEET

Anim8or ASL Script 01

neirao Apr 18th, 2018 151 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*  neirao
  2.     18/04/2018
  3. */
  4.  
  5. #command("object");
  6.  
  7. file $output;
  8. attribute $attrMargin;
  9. object $obj;
  10. shape $shape, $Shapes[0], $temp[0];
  11. int $i, $shape_count;
  12.  
  13. $obj=project.curObject;
  14. $shape_count = $obj.GetShapes($Shapes);
  15. /*project.curObject.GetShapes($Shapes); //original ok*/
  16. /*Begin our Console Output for debugging*/
  17.  
  18. $output.open("$console", "w");
  19.  
  20. for $i = 0 to $shape_count - 1 do{
  21.     $shape = $Shapes[$i];  
  22. }
  23.  
  24. $i = 0;
  25. while ($i < $Shapes.size) {
  26.   $output.print("\n\n $i: %8.4g", $i);
  27.   $output.print("\n\n total shapes:", $shape_count);  
  28.  
  29.   $shape = $Shapes[$i];    
  30.  
  31.    if($shape.Selected){  
  32.      if ($shape.GetKind() == SHAPE_KIND_SUBDIVISION) {    
  33.         $output.print("\n\n FOUND SHAPE_KIND_SUBDIVISION!");           
  34.        
  35.         /* Process attributes */
  36.         /* $attrMargin = project.curObject.LookupAttribute("Selection Margin");*/
  37.        
  38.         /*$attrMargin = project.curObject.LookupAttribute("Selection Margin");*/
  39.        
  40.         /*$attrMargin = $obj.LookupAttribute("Working");
  41.         $attrMargin = $obj.LookupAttribute("working");
  42.         $attrMargin = $obj.LookupAttribute("Work");
  43.         $attrMargin = $obj.LookupAttribute("work");*/
  44.        
  45.         /*$attrMargin =$shape.LookupAttribute("Working");*/
  46.        
  47.         /*$attrMargin =$shape.GetNumAttributes();*/
  48.        
  49.          /*$output.print("\n\n $Shapes[$i].GetNumAttributes(): ", project.curObject.GetNumAttributes());*/
  50.            
  51.         if($attrMargin != NULL){
  52.             $output.print("\n\n I HAVE THE ATTRIBUTE!!!!!");
  53.         }else{
  54.             $output.print("\n\n I DONT HAVE THE ATTRIBUTE!");
  55.         }  
  56.                
  57.         $Shapes[$i].GetShapes($temp);    
  58.        
  59.         while ($temp.size > 0) {       
  60.      
  61.         }
  62.    
  63.      }else{
  64.      /* Deselect if is NOT -  SHAPE_KIND_SUBDIVISION OK*/
  65.         $shape.Selected = 0;
  66.  
  67.      }  
  68.    }  
  69.  
  70.   $i = $i + 1;
  71. }
  72. $output.print("\n\n");
  73. $output.close();
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top