Advertisement
Guest User

Preview Caption Script for Realflow

a guest
Nov 22nd, 2013
1,171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #Caption Script for Realflow by Mike Zugschwert
  2.  
  3. #Set which types you want to be displayed
  4. emitters = True
  5. daemons = True
  6. objects = True
  7.  
  8. #Round to this many digits after the decimal
  9. decimals = 4
  10.  
  11. #Write some notes about the scene
  12. notes = """
  13. Notes about the scene
  14. """
  15.  
  16. #Set which parameters you want to display
  17. #(if not found, will not be displayed)
  18. parameters = [
  19. "Speed",
  20. "Density",
  21. "Resolution",
  22. "Int Pressure",
  23. "Ext Pressure",
  24. "Viscocity",
  25. "Surface Tension",
  26. "Strength",
  27. "Particle friction",
  28. "Bounce",
  29. "Sticky",
  30. "Roughness",
  31. "Drag Strength",
  32. "H random",
  33. "V random"
  34. ]
  35.  
  36. def onSimulationBegin():
  37. pass
  38.  
  39. def onSimulationFrame():
  40. thingList = []
  41. if emitters:
  42. for emitter in scene.get_PB_Emitters():
  43. thingList.append(emitter)
  44. if daemons:
  45. for daemon in scene.getDaemons():
  46. thingList.append(daemon)
  47. if objects:
  48. for obj in scene.getObjects():
  49. thingList.append(obj)
  50.  
  51. paramList = []
  52. captionString = ""
  53. for thing in thingList:
  54. if thing.getParameter("Simulation") != "Inactive":
  55. paramList.append( "______" + thing.name + "______\n")
  56. for param in parameters:
  57. if thing.getParameter(param) != None:
  58. paramList.append(param+": ")
  59. paramList.append(thing.getParameter(param))
  60. paramList.append("\n ")
  61. paramList.append("\n")
  62.  
  63. for item in paramList:
  64. try:
  65. item = round(item, decimals)
  66. except:
  67. pass
  68. captionString = captionString + str(item)
  69.  
  70. scene.setPreviewCaption(captionString + "______Notes______\n" + notes)
  71.  
  72.  
  73. def onSimulationStep():
  74. pass
  75.  
  76. def onSimulationEnd():
  77. pass
  78.  
  79. def onChangeToFrame():
  80. pass
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement