home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 90 / CD Actual 90.iso / Software3D / K-3D / k3d-0.4.2.1 / scripts / command_node_inspector.python < prev    next >
Encoding:
Text File  |  2004-07-23  |  1003 b   |  45 lines

  1. #python
  2.  
  3.  
  4. def ListProperties(Node, Level, Name):
  5.  
  6.     indent = ""
  7.  
  8.     for j in range(Level):
  9.         indent = indent + "\t"
  10.  
  11.     print "PROCESSING ", Name
  12.  
  13.     if Node.Children():
  14.         for i in Node.Children():
  15.             print indent, " child (", Name, ") : ", i
  16.             ListProperties(Node.GetNode(i), Level + 1, i)
  17.  
  18.     #for i in Node.Children():
  19.     #    print indent, " child : ", i
  20.     #    if i == "document":
  21.     #        print "OK!"
  22.     #        newnode = Node.GetNode(i)
  23.     #        for j in newnode.Children():
  24.     #            print indent, "\t schild : ", j
  25.     #        print indent, "properties: "
  26.     #        for k in newnode.ListProperties():
  27.     #            print indent, "\t prop : ", k.Name()
  28.  
  29.     #print "Properties : "
  30.     #print "Prop : ", Node.Name()
  31.     #if Node.ListProperties():
  32.     #    for i in Node.ListProperties():
  33.     #        print indent," property : ", i, " = ", Node.GetProperty(i)
  34.     #for i in Node.Properties():
  35.     #    print indent," property : ", i.Name()
  36.  
  37.  
  38.  
  39. # Main
  40. mainnode = Application.CommandNode("/application")
  41. ListProperties(mainnode, 0, "application")
  42.  
  43.  
  44.  
  45.