__INIT__.PY 6.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. # ##### BEGIN GPL LICENSE BLOCK #####
  2. #
  3. # This program is free software; you can redistribute it and/or
  4. # modify it under the terms of the GNU General Public License
  5. # as published by the Free Software Foundation; either version 2
  6. # of the License, or (at your option) any later version.
  7. #
  8. # This program is distributed in the hope that it will be useful,
  9. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. # GNU General Public License for more details.
  12. #
  13. # You should have received a copy of the GNU General Public License
  14. # along with this program; if not, write to the Free Software Foundation,
  15. # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  16. #
  17. # ##### END GPL LICENSE BLOCK #####
  18. # --------------------------------- TISSUE ----------------------------------- #
  19. # ------------------------------- version 0.3 -------------------------------- #
  20. # #
  21. # Creates duplicates of selected mesh to active morphing the shape according #
  22. # to target faces. #
  23. # #
  24. # Alessandro Zomparelli #
  25. # (2017) #
  26. # #
  27. # http://www.co-de-it.com/ #
  28. # http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Mesh/Tissue #
  29. # #
  30. # ############################################################################ #
  31. bl_info = {
  32. "name": "Tissue",
  33. "author": "Alessandro Zomparelli (Co-de-iT)",
  34. "version": (0, 3, 34),
  35. "blender": (2, 80, 0),
  36. "location": "",
  37. "description": "Tools for Computational Design",
  38. "warning": "",
  39. "wiki_url": "https://github.com/alessandro-zomparelli/tissue/wiki",
  40. "tracker_url": "https://github.com/alessandro-zomparelli/tissue/issues",
  41. "category": "Mesh"}
  42. if "bpy" in locals():
  43. import importlib
  44. importlib.reload(tessellate_numpy)
  45. importlib.reload(colors_groups_exchanger)
  46. importlib.reload(dual_mesh)
  47. importlib.reload(lattice)
  48. importlib.reload(uv_to_mesh)
  49. importlib.reload(utils)
  50. importlib.reload(gcode_export)
  51. else:
  52. from . import tessellate_numpy
  53. from . import colors_groups_exchanger
  54. from . import dual_mesh
  55. from . import lattice
  56. from . import uv_to_mesh
  57. from . import utils
  58. from . import gcode_export
  59. import bpy
  60. from bpy.props import PointerProperty, CollectionProperty, BoolProperty
  61. classes = (
  62. tessellate_numpy.tissue_tessellate_prop,
  63. tessellate_numpy.tissue_tessellate,
  64. tessellate_numpy.tissue_update_tessellate,
  65. tessellate_numpy.tissue_refresh_tessellate,
  66. tessellate_numpy.TISSUE_PT_tessellate,
  67. tessellate_numpy.tissue_rotate_face_left,
  68. tessellate_numpy.tissue_rotate_face_right,
  69. tessellate_numpy.TISSUE_PT_tessellate_object,
  70. tessellate_numpy.TISSUE_PT_tessellate_frame,
  71. tessellate_numpy.TISSUE_PT_tessellate_thickness,
  72. tessellate_numpy.TISSUE_PT_tessellate_coordinates,
  73. tessellate_numpy.TISSUE_PT_tessellate_rotation,
  74. tessellate_numpy.TISSUE_PT_tessellate_options,
  75. tessellate_numpy.TISSUE_PT_tessellate_selective,
  76. tessellate_numpy.TISSUE_PT_tessellate_morphing,
  77. tessellate_numpy.TISSUE_PT_tessellate_iterations,
  78. colors_groups_exchanger.face_area_to_vertex_groups,
  79. colors_groups_exchanger.vertex_colors_to_vertex_groups,
  80. colors_groups_exchanger.vertex_group_to_vertex_colors,
  81. colors_groups_exchanger.TISSUE_PT_weight,
  82. colors_groups_exchanger.TISSUE_PT_color,
  83. colors_groups_exchanger.weight_contour_curves,
  84. colors_groups_exchanger.tissue_weight_contour_curves_pattern,
  85. colors_groups_exchanger.weight_contour_mask,
  86. colors_groups_exchanger.weight_contour_displace,
  87. colors_groups_exchanger.harmonic_weight,
  88. colors_groups_exchanger.edges_deformation,
  89. colors_groups_exchanger.edges_bending,
  90. colors_groups_exchanger.weight_laplacian,
  91. colors_groups_exchanger.reaction_diffusion,
  92. colors_groups_exchanger.start_reaction_diffusion,
  93. colors_groups_exchanger.TISSUE_PT_reaction_diffusion,
  94. colors_groups_exchanger.reset_reaction_diffusion_weight,
  95. colors_groups_exchanger.formula_prop,
  96. colors_groups_exchanger.reaction_diffusion_prop,
  97. colors_groups_exchanger.weight_formula,
  98. colors_groups_exchanger.curvature_to_vertex_groups,
  99. colors_groups_exchanger.weight_formula_wiki,
  100. colors_groups_exchanger.tissue_weight_distance,
  101. dual_mesh.dual_mesh,
  102. dual_mesh.dual_mesh_tessellated,
  103. lattice.lattice_along_surface,
  104. uv_to_mesh.uv_to_mesh,
  105. gcode_export.TISSUE_PT_gcode_exporter,
  106. gcode_export.tissue_gcode_prop,
  107. gcode_export.tissue_gcode_export
  108. )
  109. def register():
  110. from bpy.utils import register_class
  111. for cls in classes:
  112. bpy.utils.register_class(cls)
  113. #bpy.utils.register_module(__name__)
  114. bpy.types.Object.tissue_tessellate = PointerProperty(
  115. type=tessellate_numpy.tissue_tessellate_prop
  116. )
  117. bpy.types.Scene.tissue_gcode = PointerProperty(
  118. type=gcode_export.tissue_gcode_prop
  119. )
  120. bpy.types.Object.formula_settings = CollectionProperty(
  121. type=colors_groups_exchanger.formula_prop
  122. )
  123. bpy.types.Object.reaction_diffusion_settings = PointerProperty(
  124. type=colors_groups_exchanger.reaction_diffusion_prop
  125. )
  126. # colors_groups_exchanger
  127. bpy.app.handlers.frame_change_post.append(colors_groups_exchanger.reaction_diffusion_def)
  128. #bpy.app.handlers.frame_change_post.append(tessellate_numpy.anim_tessellate)
  129. def unregister():
  130. from bpy.utils import unregister_class
  131. for cls in classes:
  132. bpy.utils.unregister_class(cls)
  133. del bpy.types.Object.tissue_tessellate
  134. if __name__ == "__main__":
  135. register()