less copy protection, more size visualization
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 

138 строки
3.7 KiB

  1. import bpy
  2. scene_props = {}
  3. collection_props = {}
  4. scene_props["mv_name"] = bpy.props.StringProperty(
  5. name = "Name",
  6. description = "The name of the thing",
  7. default = ""
  8. )
  9. scene_props["mv_kind"] = bpy.props.StringProperty(
  10. name = "Kind",
  11. description = "What category the entity belongs to",
  12. default = "objects"
  13. )
  14. scene_props["mv_trace_mode"] = bpy.props.FloatProperty(
  15. name = "Trace Alpha",
  16. description = "0 for polygonal; 1 for normal",
  17. min = 0,
  18. max = 2,
  19. soft_min = 0,
  20. soft_max = 1,
  21. default = 1
  22. )
  23. class MVView(bpy.types.PropertyGroup):
  24. view: bpy.props.EnumProperty(
  25. name = "View",
  26. description = "The angle to view from",
  27. items = (
  28. ("FRONT", "Front", ""),
  29. ("ANGLED", "Angled", ""),
  30. ("CORNER", "Corner", ""),
  31. ("SIDE", "Side", ""),
  32. ("BACK_CORNER", "Back Corner", ""),
  33. ("BACK", "Back", ""),
  34. ("TOP", "Top", ""),
  35. ("BOTTOM", "Bottom", "")
  36. )
  37. )
  38. name: bpy.props.StringProperty(name = "Name", description="What to call this view")
  39. class MVScientificNumber(bpy.types.PropertyGroup):
  40. base: bpy.props.FloatProperty(
  41. name = "Base",
  42. description = "The base of the number",
  43. default = 0,
  44. precision = 7
  45. )
  46. power: bpy.props.IntProperty(
  47. name = "Power",
  48. description = "The power of ten to multiply the base by",
  49. default = 0
  50. )
  51. scene_props["mv_views"] = bpy.props.CollectionProperty(
  52. name = "Views",
  53. description = "The views to view the object from",
  54. type = MVView
  55. )
  56. scene_props["mv_views_index"] = bpy.props.IntProperty(
  57. name = "Views index",
  58. description = "View list index"
  59. )
  60. scene_props["mv_scale_factor"] = bpy.props.IntProperty(
  61. name = "Scale Factor",
  62. description = "Scale lengths by 10^x",
  63. min = -20,
  64. max = 20,
  65. soft_min = -20,
  66. soft_max = 20,
  67. default = 0
  68. )
  69. scene_props["mv_material_mode"] = bpy.props.EnumProperty(
  70. name = "Material Mode",
  71. description = "How to decide what to replace each material with",
  72. items = (
  73. ('RANDOM', "Random", 'Randomly assign materials'),
  74. ('NAMES', "Names", 'Turn the specified names medium or light; the rest become dark'),
  75. ('FACE_MAPS', "Face Maps", "Assign a material for each face map")
  76. ),
  77. )
  78. scene_props["mv_material_names_light"] = bpy.props.StringProperty(
  79. name = "Light Colors",
  80. description = "Materials containing these words will become light",
  81. default = ""
  82. )
  83. scene_props["mv_material_names_medium"] = bpy.props.StringProperty(
  84. name = "Medium Colors",
  85. description = "Materials containing these words will become medium",
  86. default = ""
  87. )
  88. scene_props["mv_entity_mass_mode"] = bpy.props.EnumProperty(
  89. name = "Mass",
  90. description = "How to compute the mass of entities",
  91. items = (
  92. ("OFF", "Off", "Do not include mass",),
  93. ("MANUAL", "Manual", "Use manually-specified mass",),
  94. ("DENSITY", "Density", "Use volume and manually-specified density")
  95. ),
  96. default = "OFF"
  97. )
  98. scene_props["mv_entity_volume_mode"] = bpy.props.EnumProperty(
  99. name = "Volume",
  100. description = "How to compute the volume of entities",
  101. items = (
  102. ("OFF", "Off", "Do not include volume",),
  103. ("MANUAL", "Manual", "Use manually-specified volume",),
  104. ("AUTO", "Auto", "Use auto-computed volume")
  105. ),
  106. default = "OFF"
  107. )
  108. collection_props["mv_entity_volume"] = bpy.props.PointerProperty(
  109. type = MVScientificNumber,
  110. )
  111. collection_props["mv_entity_mass"] = bpy.props.PointerProperty(
  112. type = MVScientificNumber,
  113. )
  114. collection_props["mv_entity_density"] = bpy.props.PointerProperty(
  115. type = MVScientificNumber,
  116. )
  117. clses = [
  118. MVView,
  119. MVScientificNumber
  120. ]