Guest User

Untitled

a guest
Aug 13th, 2013
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import sys
  2. from pywmo import Wmo
  3.  
  4. wmo_name = input('Enter WMO Filename : ');
  5. building = Wmo(wmo_name);
  6.  
  7. nLight = building.num_lights;
  8.  
  9. print("There are " + str(nLight) + " lights in this WMO.");
  10.  
  11. while(1):
  12.     command = input("What do you want to do ?\n\"a\" - Add a light\n\"q\" - Exit\n");
  13.    
  14.     if(command == "q"):
  15.         print("Goodbye !");
  16.         sys.exit();
  17.     elif(command == "a"):
  18.         print("Light definition")
  19.        
  20.         light = { }
  21.        
  22.         flag1 = input("LightType : ");
  23.         flag2 = input("type : ");
  24.         flag3 = input("useAtten : ");
  25.         flag4 = input("pad : ");
  26.        
  27.         r = input("R : ");
  28.         g = input("G : ");
  29.         b = input("B : ");
  30.         a = input("A : ");
  31.        
  32.         x = input("X : ");
  33.         y = input("Y : ");
  34.         z = input("Z : ");
  35.        
  36.         intensity = input("intensity : ");
  37.         attenuation_start = input("attenuation_start : ");
  38.         attenuation_stop = input("attenuation_stop : ");
  39.        
  40.         unknown1 = input("Unknown 1 : ");
  41.         unknown2 = input("Unknown 1 : ");
  42.         unknown3 = input("Unknown 1 : ");
  43.         unknown4 = input("Unknown 1 : ");
  44.        
  45.         light["flag1"] = int(flag1);
  46.         light["flag2"] = int(flag2);
  47.         light["flag3"] = int(flag3);
  48.         light["flag4"] = int(flag4);
  49.        
  50.         light["color"] = (float(r), float(g), float(b), float(a));
  51.         light["position"] = (float(x), float(y), float(z));
  52.        
  53.         light["attenuation_start"] = float(attenuation_start);
  54.         light["attenuation_stop"] = float(attenuation_stop);
  55.        
  56.         light["unknown1"] = float(unknown1);
  57.         light["unknown2"] = float(unknown2);
  58.         light["unknown3"] = float(unknown3);
  59.         light["unknown4"] = float(unknown4);
  60.        
  61.         building.num_lights += 1;
  62.         building.lights.append(light);
  63.            
  64.         print("There are " + len(building.groups) + " groups");
  65.        
  66.         while(1)
  67.         {
  68.             group = input("In which group do you want to reference that light ( type \"s\" to return the main menu )? ");
  69.            
  70.             if(group == "s"):
  71.                 break;
  72.            
  73.             group = int(group);
  74.            
  75.             if(group >= 0 && group < len(building.groups)):
  76.            
  77.                 if(!(building.groups[group].flags & 0x200)):
  78.                     building.groups[group].flags &= 0x200;
  79.                    
  80.                 building.groups[group].light_refs.append(building.num_lights);
  81.             else:
  82.                 print("Bad group.");
  83.         }
  84.        
  85.        
  86.     else:
  87.         print("Unknown command");
Advertisement
Add Comment
Please, Sign In to add comment