├── .gitignore ├── LICENSE ├── README.md ├── blender ├── addons │ ├── 2.7 │ │ ├── io_simple_3dcoat │ │ │ ├── __init__.py │ │ │ └── simple_coat.py │ │ ├── mifth_tools │ │ │ ├── __init__.py │ │ │ ├── mifth_tools.py │ │ │ ├── mifth_tools_cloning.py │ │ │ └── mifth_vertex_paint.py │ │ ├── mira_tools │ │ │ ├── __init__.py │ │ │ ├── add_mesh_capsule.py │ │ │ ├── mi_color_manager.py │ │ │ ├── mi_curve_guide.py │ │ │ ├── mi_curve_main.py │ │ │ ├── mi_curve_stretch.py │ │ │ ├── mi_curve_surfaces.py │ │ │ ├── mi_curve_test.py │ │ │ ├── mi_deform.py │ │ │ ├── mi_draw_extrude.py │ │ │ ├── mi_gui.py │ │ │ ├── mi_inputs.py │ │ │ ├── mi_linear_deformer.py │ │ │ ├── mi_looptools.py │ │ │ ├── mi_make_arc.py │ │ │ ├── mi_noise.py │ │ │ ├── mi_poly_loop.py │ │ │ ├── mi_primitives.py │ │ │ ├── mi_settings.py │ │ │ ├── mi_simple_extrude.py │ │ │ ├── mi_utils_base.py │ │ │ ├── mi_widget_curve.py │ │ │ ├── mi_widget_linear_deform.py │ │ │ ├── mi_widget_select.py │ │ │ └── mi_wrap_master.py │ │ ├── paint_clones │ │ │ ├── README.md │ │ │ └── tools_painclones.py │ │ ├── quick_pipe │ │ │ └── quick_pipe.py │ │ └── super_grouper │ │ │ ├── __init__.py │ │ │ └── grouper_main.py │ └── 2.8 │ │ ├── df_tools │ │ ├── __init__.py │ │ └── df_objects.py │ │ ├── io_simple_3dcoat │ │ ├── __init__.py │ │ └── simple_coat.py │ │ ├── mifth_tools │ │ ├── __init__.py │ │ ├── mifth_tools_base.py │ │ ├── mifth_tools_cloning.py │ │ ├── mifth_tools_ui.py │ │ └── mifth_vertex_paint.py │ │ ├── mira_tools │ │ ├── __init__.py │ │ ├── add_mesh_capsule.py │ │ ├── auto_load.py │ │ ├── mi_color_manager.py │ │ ├── mi_curve_guide.py │ │ ├── mi_curve_main.py │ │ ├── mi_curve_stretch.py │ │ ├── mi_curve_surfaces.py │ │ ├── mi_deform.py │ │ ├── mi_draw_extrude.py │ │ ├── mi_gui.py │ │ ├── mi_inputs.py │ │ ├── mi_linear_deformer.py │ │ ├── mi_linear_deformer_curve.py │ │ ├── mi_linear_widget.py │ │ ├── mi_looptools.py │ │ ├── mi_make_arc.py │ │ ├── mi_noise.py │ │ ├── mi_poly_loop.py │ │ ├── mi_primitives.py │ │ ├── mi_retopo_loops.py │ │ ├── mi_settings.py │ │ ├── mi_simple_extrude.py │ │ ├── mi_simple_modeling.py │ │ ├── mi_snap_points.py │ │ ├── mi_unbevel.py │ │ ├── mi_utils_base.py │ │ ├── mi_widget_curve.py │ │ ├── mi_widget_linear_deform.py │ │ ├── mi_widget_select.py │ │ └── mi_wrap_master.py │ │ └── quick_pipe │ │ └── quick_pipe.py ├── animation_nodes │ └── modeling │ │ ├── clone_curve.blend │ │ └── simple_array.blend └── keyconfig │ ├── 2.7 │ └── mifth.py │ └── 2.8 │ └── mifth.py ├── houdini ├── Houdini.keymap.overrides ├── otls │ ├── animation │ │ └── mifth_capture_symmetry.otllc │ ├── modeling │ │ ├── mifth_attrib_copy_topology.otllc │ │ ├── mifth_attrib_ramp.otllc │ │ ├── mifth_bend_plus.otllc │ │ ├── mifth_capsule.otllc │ │ ├── mifth_copy_curve.otllc │ │ ├── mifth_copy_meshes.otllc │ │ ├── mifth_curve_length.otllc │ │ ├── mifth_curve_surface.otllc │ │ ├── mifth_destructive_extrude.otllc │ │ ├── mifth_divide_edges.otllc │ │ ├── mifth_edge_collapse_plus.otllc │ │ ├── mifth_edgeflipflow.otllc │ │ ├── mifth_edgestoface.otllc │ │ ├── mifth_edit_linear_falloff.otllc │ │ ├── mifth_edit_radial_falloff.otllc │ │ ├── mifth_extract_edges.otllc │ │ ├── mifth_extract_edges_2.otllc │ │ ├── mifth_extrude_point.otllc │ │ ├── mifth_insert_mesh.otllc │ │ ├── mifth_knife_plus.otllc │ │ ├── mifth_lod_helper.otllc │ │ ├── mifth_make_arc.otllc │ │ ├── mifth_make_circle.otllc │ │ ├── mifth_merge_verts.otllc │ │ ├── mifth_move_flow.otllc │ │ ├── mifth_pipe.otllc │ │ ├── mifth_point_to_circle.otllc │ │ ├── mifth_round_edge_bevel.otllc │ │ ├── mifth_round_edges_vdb.otllc │ │ ├── mifth_scale_edges.otllc │ │ ├── mifth_seams_cheater.otllc │ │ ├── mifth_simple_gear.hdalc │ │ ├── mifth_simple_pipe.otllc │ │ ├── mifth_soft_push.otllc │ │ ├── mifth_spread_edges.otllc │ │ ├── mifth_strap.otllc │ │ ├── mifth_subdive_plus.otllc │ │ ├── mifth_symmetrize.otllc │ │ ├── mifth_symmetry_extrude_v1.otllc │ │ ├── mifth_symmetry_extrude_v2.otllc │ │ ├── mifth_transform_primitives.otllc │ │ ├── mifth_unbevel.otllc │ │ ├── mifth_unbevel_v2.otllc │ │ ├── mifth_uv_center.otllc │ │ ├── mifth_uv_grid.otllc │ │ ├── mifth_uv_layout_plus.otllc │ │ ├── mifth_uv_pixel_offset.otllc │ │ ├── mifth_uv_wrap.otllc │ │ ├── mira_tree.otllc │ │ └── mirror_attribute_good.otllc │ ├── other │ │ ├── checker2.hdalc │ │ ├── checker2_sop.hdalc │ │ ├── group_inverted_uvs.otllc │ │ ├── mifth_3dcoat_applinker.otllc │ │ ├── mifth_extract_objects.otllc │ │ ├── mifth_simple_goz.otllc │ │ ├── mifth_texel_density.otllc │ │ ├── simple_reguide.otllc │ │ └── wireframe.otllc │ └── render │ │ └── mifth_extract_bake.otllc ├── pk │ ├── otls │ │ └── pk_image_plane.hdalc │ └── pk_shelf │ │ └── pk.shelf ├── radialmenu │ └── MfModel.radialmenu └── toolbar │ ├── HardGun │ ├── hard_gun_obj.shelf │ └── hard_gun_sop.shelf │ ├── mf_anim.shelf │ ├── mf_mod.shelf │ └── mf_obj.shelf ├── nuke └── gizmos │ └── checker_view.gizmo └── other └── exchangers ├── blender ├── 2.7 │ └── blender_exchanger │ │ ├── __init__.py │ │ └── blender_exchanger.py └── 2.8 │ └── blender_exchanger │ ├── __init__.py │ └── blender_exchanger.py ├── houdini ├── exchanger.py └── exchanger.shelf ├── max └── test.ms └── modo ├── ex_code ├── ex_export.py └── ex_import.py └── exchanger_config.CFG /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | pip-wheel-metadata/ 24 | share/python-wheels/ 25 | *.egg-info/ 26 | .installed.cfg 27 | *.egg 28 | MANIFEST 29 | 30 | # PyInstaller 31 | # Usually these files are written by a python script from a template 32 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 33 | *.manifest 34 | *.spec 35 | 36 | # Installer logs 37 | pip-log.txt 38 | pip-delete-this-directory.txt 39 | 40 | # Unit test / coverage reports 41 | htmlcov/ 42 | .tox/ 43 | .nox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | *.py,cover 51 | .hypothesis/ 52 | .pytest_cache/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | target/ 76 | 77 | # Jupyter Notebook 78 | .ipynb_checkpoints 79 | 80 | # IPython 81 | profile_default/ 82 | ipython_config.py 83 | 84 | # pyenv 85 | .python-version 86 | 87 | # pipenv 88 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 89 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 90 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 91 | # install all needed dependencies. 92 | #Pipfile.lock 93 | 94 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow 95 | __pypackages__/ 96 | 97 | # Celery stuff 98 | celerybeat-schedule 99 | celerybeat.pid 100 | 101 | # SageMath parsed files 102 | *.sage.py 103 | 104 | # Environments 105 | .env 106 | .venv 107 | env/ 108 | venv/ 109 | ENV/ 110 | env.bak/ 111 | venv.bak/ 112 | 113 | # Spyder project settings 114 | .spyderproject 115 | .spyproject 116 | 117 | # Rope project settings 118 | .ropeproject 119 | 120 | # mkdocs documentation 121 | /site 122 | 123 | # mypy 124 | .mypy_cache/ 125 | .dmypy.json 126 | dmypy.json 127 | 128 | # Pyre type checker 129 | .pyre/ 130 | 131 | #kdevelop 132 | .kdev4 133 | *.kdev4 134 | 135 | #Eclipse Pydev 136 | .project 137 | .pydevproject 138 | .settings 139 | 140 | #Blender 141 | *.blend1 142 | 143 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014, mifth 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | * Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | * Neither the name of mifthtools nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 22 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 24 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 25 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 26 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | 29 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Mifth Tools 2 | 3 | ## Blender 4 | 5 | MiraTools: 6 | http://blenderartists.org/forum/showthread.php?366107-MiraTools 7 | https://github.com/mifth/mifthtools/wiki/Mira-Tools 8 | 9 | MifthTools: 10 | http://blenderartists.org/forum/showthread.php?346588-MifthTools-Addon 11 | 12 | Simple3DCoat Applink: 13 | http://3d-coat.com/forum/index.php?showtopic=15481 14 | 15 | ## Exchangers 16 | http://blenderartists.org/forum/showthread.php?378946-Modo-Blender-Exchanger 17 | http://community.thefoundry.co.uk/discussion/topic.aspx?f=119&t=114220 18 | -------------------------------------------------------------------------------- /blender/addons/2.7/io_simple_3dcoat/__init__.py: -------------------------------------------------------------------------------- 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 | 19 | bl_info = { 20 | "name": "Simple 3D-Coat Applink", 21 | "author": "Kalle-Samuli Riihikoski (haikalle), Paul Geraskin", 22 | "version": (0, 3, 2), 23 | "blender": (2, 69, 0), 24 | "location": "Scene > Simple 3D-Coat Applink", 25 | "description": "Transfer data between 3D-Coat/Blender", 26 | "warning": "", 27 | "wiki_url": "http://wiki.blender.org/index.php/Extensions:2.6/Py/" 28 | "Scripts/Import-Export/3dcoat_applink", 29 | "tracker_url": "https://projects.blender.org/tracker/?" 30 | "func=detail&aid=24446", 31 | "category": "Import-Export"} 32 | 33 | 34 | if "bpy" in locals(): 35 | import imp 36 | imp.reload(simple_coat) 37 | else: 38 | from . import simple_coat 39 | 40 | 41 | import bpy 42 | from bpy.props import * 43 | 44 | 45 | def register(): 46 | 47 | class SimpleSceneCoat3D(bpy.types.PropertyGroup): 48 | 49 | exportModelType = EnumProperty( 50 | name = "Export Type", 51 | items = (('OBJ', 'OBJ', ''), 52 | ('FBX', 'FBX', ''), 53 | ('DAE', 'DAE', ''), 54 | ), 55 | default = 'OBJ' 56 | ) 57 | 58 | doApplyModifiers = BoolProperty( 59 | name="Apply Modifiers", 60 | description="Apply Modifiers...", 61 | default=True 62 | ) 63 | 64 | exportMaterials = BoolProperty( 65 | name="Export Materials", 66 | description="Export Materials...", 67 | default=True 68 | ) 69 | 70 | copyTexturesPath = StringProperty( 71 | name="Copy Textures Path", 72 | subtype="DIR_PATH", 73 | default="", 74 | ) 75 | 76 | type = EnumProperty(name="Export Type", 77 | description="Different Export Types", 78 | items=(("ppp", "Per-Pixel Painting", ""), 79 | ("mv", "Microvertex Painting", ""), 80 | ("ptex", "Ptex Painting", ""), 81 | ("uv", "UV-Mapping", ""), 82 | ("ref", "Reference Mesh", ""), 83 | ("retopo", "Retopo mesh as new layer", ""), 84 | ("vox", "Mesh As Voxel Object", ""), 85 | ("voxcombine", "Mesh As single Voxel Object", ""), 86 | ("alpha", "Mesh As New Pen Alpha", ""), 87 | ("prim", "Mesh As Voxel Primitive", ""), 88 | ("curv", "Mesh As a Curve Profile", ""), 89 | ("autopo", "Mesh For Auto-retopology", ""), 90 | ), 91 | default= "ppp" 92 | ) 93 | 94 | bpy.utils.register_module(__name__) 95 | 96 | bpy.types.Scene.simple3Dcoat = PointerProperty( 97 | name="Applink Variables", 98 | type=SimpleSceneCoat3D, 99 | description="Applink variables" 100 | ) 101 | 102 | 103 | def unregister(): 104 | import bpy 105 | 106 | del bpy.types.Scene.simple3Dcoat 107 | bpy.utils.unregister_module(__name__) 108 | 109 | 110 | if __name__ == "__main__": 111 | register() 112 | -------------------------------------------------------------------------------- /blender/addons/2.7/mifth_tools/__init__.py: -------------------------------------------------------------------------------- 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 | 19 | bl_info = { 20 | "name": "Mifth Tools", 21 | "author": "Paul Geraskin", 22 | "version": (0, 1, 0), 23 | "blender": (2, 78, 0), 24 | "location": "3D Viewport", 25 | "description": "Mifth Tools", 26 | "warning": "", 27 | "wiki_url": "", 28 | "tracker_url": "", 29 | "category": "Tools"} 30 | 31 | 32 | if "bpy" in locals(): 33 | import imp 34 | imp.reload(mifth_tools_cloning) 35 | imp.reload(mifth_vertex_paint) 36 | imp.reload(mifth_tools) 37 | else: 38 | from . import mifth_tools_cloning 39 | from . import mifth_vertex_paint 40 | from . import mifth_tools 41 | 42 | 43 | import bpy 44 | from bpy.props import * 45 | 46 | 47 | # registration 48 | def menu_vertex_paint_func(self, context): 49 | self.layout.separator() 50 | self.layout.menu(mifth_vertex_paint.MFTVertexPaintMenu.bl_idname) 51 | 52 | 53 | def register(): 54 | bpy.types.VIEW3D_MT_paint_vertex.append(menu_vertex_paint_func) 55 | 56 | class MFTProperties(bpy.types.PropertyGroup): 57 | 58 | # Output Settings 59 | outputFolder = StringProperty( 60 | name="outputFolder", 61 | subtype="NONE", 62 | default="seq" 63 | ) 64 | 65 | outputSubFolder = StringProperty( 66 | name="outputSubFolder", 67 | subtype="NONE", 68 | default="ren" 69 | ) 70 | 71 | outputSequence = StringProperty( 72 | name="outputSequence", 73 | subtype="NONE", 74 | default="render" 75 | ) 76 | 77 | outputSequenceSize = IntProperty( 78 | default=8, 79 | min=1, 80 | max=60 81 | ) 82 | 83 | doOutputSubFolder = BoolProperty( 84 | name="do Output SubFolder", 85 | description="do Output SubFolder...", 86 | default=False 87 | ) 88 | 89 | # Curve Animator Settings 90 | doUseSceneFrames = BoolProperty( 91 | name="do use scene frames", 92 | description="do use scene frames...", 93 | default=False 94 | ) 95 | 96 | curveAniStartFrame = IntProperty( 97 | default=1, 98 | min=1, 99 | max=10000 100 | ) 101 | 102 | curveAniEndFrame = IntProperty( 103 | default=100, 104 | min=1, 105 | max=10000 106 | ) 107 | 108 | curveAniStepFrame = IntProperty( 109 | default=10, 110 | min=1, 111 | max=10000 112 | ) 113 | 114 | curveAniInterpolation = FloatProperty( 115 | default=0.3, 116 | min=0.0, 117 | max=1.0 118 | ) 119 | 120 | # MorfCreator settings 121 | morfCreatorNames = StringProperty( 122 | name="MorfNames", 123 | subtype="NONE", 124 | default="" 125 | ) 126 | 127 | morfUseWorldMatrix = BoolProperty( 128 | name="use world matrix", 129 | description="use world matrix...", 130 | default=False 131 | ) 132 | 133 | morfApplyModifiers = BoolProperty( 134 | name="apply modifiers to morf", 135 | description="apply modifiers to morf...", 136 | default=False 137 | ) 138 | 139 | bpy.utils.register_module(__name__) 140 | 141 | bpy.types.Scene.mifthTools = PointerProperty( 142 | name="Mifth Tools Variables", 143 | type=MFTProperties, 144 | description="Mifth Tools Properties" 145 | ) 146 | 147 | bpy.types.Scene.mifthCloneTools = PointerProperty( 148 | name="Mifth Cloning Variables", 149 | type=mifth_tools_cloning.MFTCloneProperties, 150 | description="Mifth Cloning Properties" 151 | ) 152 | 153 | 154 | def unregister(): 155 | import bpy 156 | 157 | bpy.types.VIEW3D_MT_object_specials.remove(menu_vertex_paint_func) 158 | 159 | del bpy.types.Scene.mifthTools 160 | del bpy.types.Scene.mifthCloneTools 161 | # del bpy.mifthTools 162 | # del bpy.mifthCloneTools 163 | bpy.utils.unregister_module(__name__) 164 | 165 | 166 | if __name__ == "__main__": 167 | register() 168 | -------------------------------------------------------------------------------- /blender/addons/2.7/mifth_tools/mifth_vertex_paint.py: -------------------------------------------------------------------------------- 1 | import bpy 2 | 3 | from bpy.props import * 4 | from bpy.types import Operator, AddonPreferences 5 | from bpy.types import Menu, Panel, UIList, PropertyGroup 6 | from bpy.props import StringProperty, BoolProperty, IntProperty, CollectionProperty, BoolVectorProperty, PointerProperty 7 | 8 | 9 | class MFTVertexPaintMenu(bpy.types.Menu): 10 | bl_idname = "mftv.vertex_paint_menu" 11 | bl_label = "Mifth VertexPaint" 12 | bl_description = "Mifth Vertex Paint Menu" 13 | 14 | def draw(self, context): 15 | layout = self.layout 16 | 17 | #layout.separator() 18 | layout.operator(MFTSetColorToSelected.bl_idname) 19 | layout.operator(MFTInvertColors.bl_idname) 20 | 21 | 22 | class MFTSetColorToSelected(bpy.types.Operator): 23 | bl_idname = "mftv.set_colors_to_selected" 24 | bl_label = "Set Colors to Selected" 25 | bl_description = "Set Colors to Selected" 26 | bl_options = {'REGISTER', 'UNDO'} 27 | 28 | strength = FloatVectorProperty( 29 | name="Color", 30 | subtype='COLOR', 31 | default=(0.5, 0.5, 0.5), 32 | min=0.0, max=1.0, 33 | description="wire color of the group" 34 | ) 35 | 36 | selected_faces_only = BoolProperty( 37 | name="Selected Faces Only", default=False) 38 | 39 | ch_col = False 40 | 41 | def execute(self, context): 42 | 43 | obj = context.scene.objects.active 44 | color_layer = obj.data.vertex_colors.active 45 | 46 | if self.ch_col is False: 47 | if context.scene.tool_settings.unified_paint_settings.use_unified_color is True: 48 | self.strength = context.scene.tool_settings.unified_paint_settings.color 49 | else: 50 | self.strength = context.tool_settings.vertex_paint.brush.color 51 | self.ch_col = True 52 | 53 | 54 | i = 0 55 | for poly in obj.data.polygons: 56 | for vert_idx in poly.vertices: 57 | if obj.data.vertices[vert_idx].select is True: 58 | 59 | if self.selected_faces_only is False: 60 | color_layer.data[i].color = (self.strength[0], self.strength[1], self.strength[2], 1.0) 61 | else: 62 | if poly.select is True: 63 | color_layer.data[i].color = (self.strength[0], self.strength[1], self.strength[2], 1.0) 64 | 65 | i += 1 66 | 67 | obj.data.update() 68 | 69 | return {'FINISHED'} 70 | 71 | 72 | class MFTInvertColors(bpy.types.Operator): 73 | bl_idname = "mftv.invert_colors" 74 | bl_label = "Invert Colors" 75 | bl_description = "Invert Colors" 76 | bl_options = {'REGISTER', 'UNDO'} 77 | 78 | selected_faces_only = BoolProperty( 79 | name="Selected Vertices Only", default=True) 80 | split_points = BoolProperty(name="Split Points", default=False) 81 | 82 | def execute(self, context): 83 | 84 | obj = context.scene.objects.active 85 | color_layer = obj.data.vertex_colors.active 86 | 87 | i = 0 88 | for poly in obj.data.polygons: 89 | for vert_idx in poly.vertices: 90 | if self.selected_faces_only is False: 91 | color_layer.data[i].color[ 92 | 0] = 1.0 - color_layer.data[i].color[0] 93 | color_layer.data[i].color[ 94 | 1] = 1.0 - color_layer.data[i].color[1] 95 | color_layer.data[i].color[ 96 | 2] = 1.0 - color_layer.data[i].color[2] 97 | else: 98 | if obj.data.vertices[vert_idx].select is True: 99 | if self.split_points is True: 100 | if poly.select is True: 101 | color_layer.data[i].color[ 102 | 0] = 1.0 - color_layer.data[i].color[0] 103 | color_layer.data[i].color[ 104 | 1] = 1.0 - color_layer.data[i].color[1] 105 | color_layer.data[i].color[ 106 | 2] = 1.0 - color_layer.data[i].color[2] 107 | else: 108 | color_layer.data[i].color[ 109 | 0] = 1.0 - color_layer.data[i].color[0] 110 | color_layer.data[i].color[ 111 | 1] = 1.0 - color_layer.data[i].color[1] 112 | color_layer.data[i].color[ 113 | 2] = 1.0 - color_layer.data[i].color[2] 114 | i += 1 115 | 116 | obj.data.update() 117 | 118 | return {'FINISHED'} 119 | -------------------------------------------------------------------------------- /blender/addons/2.7/mira_tools/__init__.py: -------------------------------------------------------------------------------- 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 | 19 | bl_info = { 20 | "name": "Mira Tools", 21 | "author": "Pavel Geraskin, Marvin K. Breuer, Graham Held", 22 | "version": (2, 1, 0), 23 | "blender": (2, 78, 0), 24 | "location": "3D Viewport", 25 | "description": "Mira Tools", 26 | "warning": "", 27 | "wiki_url": "https://github.com/mifth/mifthtools/wiki/Mira-Tools", 28 | "tracker_url": "https://github.com/mifth/mifthtools/issues", 29 | "category": "Tools"} 30 | 31 | 32 | if "bpy" in locals(): 33 | import imp 34 | imp.reload(mi_curve_test) 35 | imp.reload(mi_curve_stretch) 36 | imp.reload(mi_curve_surfaces) 37 | imp.reload(mi_settings) 38 | imp.reload(mi_gui) 39 | imp.reload(mi_noise) 40 | imp.reload(mi_deform) 41 | imp.reload(mi_linear_deformer) 42 | imp.reload(mi_curve_guide) 43 | imp.reload(mi_draw_extrude) 44 | imp.reload(mi_poly_loop) 45 | imp.reload(mi_make_arc) 46 | imp.reload(mi_wrap_master) 47 | imp.reload(mi_primitives) 48 | imp.reload(mi_simple_extrude) 49 | else: 50 | from . import mi_curve_test 51 | from . import mi_curve_stretch 52 | from . import mi_curve_surfaces 53 | from . import mi_settings 54 | from . import mi_linear_deformer 55 | from . import mi_curve_guide 56 | from . import mi_deform 57 | from . import mi_gui 58 | from . import mi_noise 59 | from . import mi_draw_extrude 60 | from . import mi_poly_loop 61 | from . import mi_make_arc 62 | from . import mi_wrap_master 63 | from . import mi_primitives 64 | from . import mi_simple_extrude 65 | 66 | 67 | import bpy 68 | from bpy.props import * 69 | 70 | 71 | def register(): 72 | 73 | bpy.utils.register_module(__name__) 74 | 75 | bpy.types.Scene.mi_settings = PointerProperty( 76 | name="Global Settings", 77 | type=mi_settings.MI_Settings, 78 | description="Global Settings." 79 | ) 80 | 81 | bpy.types.Scene.mi_cur_stretch_settings = PointerProperty( 82 | name="Curve Stretch Settings", 83 | type=mi_curve_stretch.MI_CurveStretchSettings, 84 | description="Curve Stretch Settings." 85 | ) 86 | 87 | bpy.types.Scene.mi_cur_surfs_settings = PointerProperty( 88 | name="Curve Surfaces Settings", 89 | type=mi_curve_surfaces.MI_CurveSurfacesSettings, 90 | description="Curve Surfaces Settings." 91 | ) 92 | 93 | bpy.types.Scene.mi_extrude_settings = PointerProperty( 94 | name="Extrude Variables", 95 | type=mi_draw_extrude.MI_ExtrudeSettings, 96 | description="Extrude Settings" 97 | ) 98 | 99 | bpy.types.Scene.mi_ldeformer_settings = PointerProperty( 100 | name="Linear Deformer Variables", 101 | type=mi_linear_deformer.MI_LDeformer_Settings, 102 | description="Linear Deformer Settings" 103 | ) 104 | 105 | bpy.types.Scene.mi_curguide_settings = PointerProperty( 106 | name="Curve Guide Variables", 107 | type=mi_curve_guide.MI_CurGuide_Settings, 108 | description="Curve Guide Settings" 109 | ) 110 | 111 | bpy.types.Scene.mi_makearc_settings = PointerProperty( 112 | name="Make Arc Variables", 113 | type=mi_make_arc.MI_MakeArc_Settings, 114 | description="Make Arc Settings" 115 | ) 116 | 117 | # alternative gui 118 | bpy.types.WindowManager.mirawindow = bpy.props.PointerProperty(type = mi_gui.DropdownMiraToolProps) 119 | bpy.types.INFO_MT_mesh_add.prepend(mi_gui.mifth_prim_menu) 120 | 121 | 122 | def unregister(): 123 | import bpy 124 | 125 | #del bpy.types.Scene.miraTool 126 | #del bpy.types.Object.mi_curves # need to investigate if i need to delete it 127 | del bpy.types.Scene.mi_settings 128 | del bpy.types.Scene.mi_cur_stretch_settings 129 | del bpy.types.Scene.mi_cur_surfs_settings 130 | del bpy.types.Scene.mi_extrude_settings 131 | del bpy.types.Scene.mi_ldeformer_settings 132 | del bpy.types.Scene.mi_curguide_settings 133 | del bpy.types.Scene.mi_makearc_settings 134 | 135 | del bpy.types.WindowManager.mirawindow 136 | bpy.types.INFO_MT_mesh_add.remove(mi_gui.mifth_prim_menu) 137 | 138 | bpy.utils.unregister_module(__name__) 139 | 140 | 141 | if __name__ == "__main__": 142 | register() 143 | -------------------------------------------------------------------------------- /blender/addons/2.7/mira_tools/add_mesh_capsule.py: -------------------------------------------------------------------------------- 1 | import bpy 2 | from bpy.types import Operator 3 | from bpy.props import FloatProperty 4 | from bpy.props import IntProperty 5 | from bpy_extras.object_utils import object_data_add 6 | from mathutils import Vector 7 | from math import cos 8 | from math import degrees 9 | from math import radians 10 | from math import sin 11 | 12 | # "The author is David Ludwig. The code was taken from here https://www.youtube.com/watch?v=O-Yhxhjx_VY " 13 | 14 | def add_capsule(length, radius, rings, segments, context): 15 | 16 | topRings = [] 17 | bottomRings = [] 18 | topCap = [] 19 | bottomCap = [] 20 | 21 | vertId = 0 22 | 23 | for j in range(0, rings + 1): 24 | 25 | if j == rings: 26 | 27 | topVertex = Vector((0, 0, ((length / 2) + radius))) 28 | bottomVertex = Vector((0, 0, -((length / 2) + radius))) 29 | 30 | topCap.append(topVertex) 31 | bottomCap.append(bottomVertex) 32 | else: 33 | 34 | heightAngle = radians((90 / rings) * (j + 1)) 35 | 36 | topRing = [] 37 | bottomRing = [] 38 | 39 | for i in range(0, segments): 40 | 41 | zAngle = radians((360 / segments) * i) 42 | 43 | x = radius * cos(zAngle) * sin(heightAngle) 44 | y = radius * sin(zAngle) * sin(heightAngle) 45 | z = radius * cos(heightAngle) 46 | 47 | topVertex = Vector((x, y, z + (length / 2))) 48 | bottomVertex = Vector((x, y, -(z + (length / 2)))) 49 | 50 | topRing.append(vertId) 51 | bottomRing.append(vertId + ((rings * segments) + 1)) 52 | topCap.append(topVertex) 53 | bottomCap.append(bottomVertex) 54 | 55 | vertId += 1 56 | 57 | topRings.append(topRing) 58 | bottomRings.append(bottomRing) 59 | 60 | verts = topCap + bottomCap 61 | 62 | faces = [] 63 | 64 | ringIndex = len(topRings) - 1 65 | while ringIndex > 0: 66 | 67 | topRing = topRings[ringIndex] 68 | topNextRing = topRings[ringIndex - 1] 69 | 70 | bottomRing = bottomRings[ringIndex] 71 | bottomNextRing = bottomRings[ringIndex - 1] 72 | 73 | for i in range(0, segments): 74 | 75 | index1 = i 76 | index2 = 0 if i + 1 == segments else i + 1 77 | 78 | topCapFace = [topRing[index1], topRing[index2], topNextRing[index2], topNextRing[index1]] 79 | bottomCapFace = [bottomRing[index2], bottomRing[index1], bottomNextRing[index1], bottomNextRing[index2]] 80 | faces.append(topCapFace) 81 | faces.append(bottomCapFace) 82 | 83 | ringIndex -= 1 84 | 85 | topRing = topRings[rings - 1] 86 | bottomRing = bottomRings[rings - 1] 87 | 88 | topCapRing = topRings[0] 89 | bottomCapRing = bottomRings[0] 90 | 91 | topCapFaces = [] 92 | bottomCapFaces = [] 93 | 94 | for i in range(0, segments): 95 | 96 | index1 = i 97 | index2 = 0 if i + 1 == segments else i + 1 98 | 99 | bodyFace = [topRing[index2], topRing[index1], bottomRing[index1], bottomRing[index2]] 100 | topCapFace = [topCapRing[index1], topCapRing[index2], rings * segments] 101 | bottomCapFace = [bottomCapRing[index2], bottomCapRing[index1], ((rings * segments) * 2) + 1] 102 | 103 | faces.append(bodyFace) 104 | topCapFaces.append(topCapFace) 105 | bottomCapFaces.append(bottomCapFace) 106 | 107 | faces += topCapFaces + bottomCapFaces 108 | 109 | mesh = bpy.data.meshes.new(name="Capsule") 110 | mesh.from_pydata(verts, [], faces) 111 | mesh.update() 112 | 113 | return object_data_add(context, mesh, operator=None) 114 | -------------------------------------------------------------------------------- /blender/addons/2.7/mira_tools/mi_color_manager.py: -------------------------------------------------------------------------------- 1 | # ***** BEGIN GPL LICENSE BLOCK ***** 2 | # 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software Foundation, 16 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | # 18 | # ***** END GPL LICENCE BLOCK ***** 19 | 20 | import bpy 21 | import bgl 22 | import blf 23 | 24 | from bpy.props import * 25 | import math 26 | import mathutils as mathu 27 | import random 28 | from mathutils import Vector 29 | 30 | 31 | # Curve Colors 32 | cur_point_base = (0.5, 0.8, 1.0, 1.0) 33 | cur_point_selected = (0.9, 0.5, 0.1, 1.0) 34 | cur_point_active = (0.9, 0.7, 0.3, 1.0) 35 | 36 | cur_point_closed_start = (0.7, 0.4, 0.9, 1.0) 37 | cur_point_closed_end = (0.3, 0.4, 0.9, 1.0) 38 | 39 | cur_line_base = (0.5, 0.8, 0.9, 1.0) 40 | 41 | cur_handle_1_base = (0.0, 0.5, 1.0, 1.0) 42 | cur_handle_2_base = (1.0, 0.5, 0.0, 1.0) 43 | 44 | 45 | # Draw Extrude Colors 46 | dre_point_base = (0.5, 0.8, 1.0, 1.0) 47 | 48 | # PolyLoop colors 49 | pl_point_col = (0.95, 0.7, 1.0, 1.0) -------------------------------------------------------------------------------- /blender/addons/2.7/mira_tools/mi_inputs.py: -------------------------------------------------------------------------------- 1 | 2 | # ***** BEGIN GPL LICENSE BLOCK ***** 3 | # 4 | # 5 | # This program is free software; you can redistribute it and/or 6 | # modify it under the terms of the GNU General Public License 7 | # as published by the Free Software Foundation; either version 2 8 | # of the License, or (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not, write to the Free Software Foundation, 17 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | # 19 | # ***** END GPL LICENCE BLOCK ***** 20 | 21 | import bpy 22 | 23 | 24 | pass_keys = ['NUMPAD_0', 'NUMPAD_1', 'NUMPAD_3', 'NUMPAD_4', 25 | 'NUMPAD_5', 'NUMPAD_6', 'NUMPAD_7', 'NUMPAD_8', 26 | 'NUMPAD_9', 'MIDDLEMOUSE', 'WHEELUPMOUSE', 'WHEELDOWNMOUSE', 27 | 'MOUSEMOVE'] 28 | 29 | 30 | def get_input_pass(pass_keys, key_inputs, event): 31 | if event.type in pass_keys: 32 | return True 33 | 34 | if key_inputs == 'Maya': 35 | if event.type in {'RIGHTMOUSE', 'LEFTMOUSE'} and event.alt and not event.shift and not event.ctrl: 36 | return True 37 | 38 | return False 39 | -------------------------------------------------------------------------------- /blender/addons/2.7/mira_tools/mi_looptools.py: -------------------------------------------------------------------------------- 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 | 19 | import bmesh 20 | import bpy 21 | import collections 22 | import mathutils 23 | import math 24 | from bpy_extras import view3d_utils 25 | 26 | # THIS CODE IS TAKEN FROM BLENDER LOOPTOOLS ADDON. Thanks a lot to Bart Crouch. 27 | 28 | ########################################## 29 | ####### General functions ################ 30 | ########################################## 31 | 32 | 33 | # check loops and only return valid ones 34 | # method is modified 35 | def check_loops(loops, bm_mod): 36 | valid_loops = [] 37 | for loop, circular in loops: 38 | # loop needs to have at least 3 vertices 39 | if len(loop) < 3: 40 | continue 41 | ## loop needs at least 1 vertex in the original, non-mirrored mesh 42 | #if mapping: 43 | #all_virtual = True 44 | #for vert in loop: 45 | #if mapping[vert] > -1: 46 | #all_virtual = False 47 | #break 48 | #if all_virtual: 49 | #continue 50 | # vertices can not all be at the same location 51 | stacked = True 52 | for i in range(len(loop) - 1): 53 | if (bm_mod.verts[loop[i]].co - \ 54 | bm_mod.verts[loop[i+1]].co).length > 1e-6: 55 | stacked = False 56 | break 57 | if stacked: 58 | continue 59 | # passed all tests, loop is valid 60 | valid_loops.append([loop, circular]) 61 | 62 | return(valid_loops) 63 | 64 | 65 | # input: bmesh, output: dict with the edge-key as key and face-index as value 66 | def dict_edge_faces(bm): 67 | edge_faces = dict([[edgekey(edge), []] for edge in bm.edges if \ 68 | not edge.hide]) 69 | for face in bm.faces: 70 | if face.hide: 71 | continue 72 | for key in face_edgekeys(face): 73 | edge_faces[key].append(face.index) 74 | 75 | return(edge_faces) 76 | 77 | 78 | # input: bmesh (edge-faces optional), output: dict with face-face connections 79 | def dict_face_faces(bm, edge_faces=False): 80 | if not edge_faces: 81 | edge_faces = dict_edge_faces(bm) 82 | 83 | connected_faces = dict([[face.index, []] for face in bm.faces if \ 84 | not face.hide]) 85 | for face in bm.faces: 86 | if face.hide: 87 | continue 88 | for edge_key in face_edgekeys(face): 89 | for connected_face in edge_faces[edge_key]: 90 | if connected_face == face.index: 91 | continue 92 | connected_faces[face.index].append(connected_face) 93 | 94 | return(connected_faces) 95 | 96 | 97 | # input: bmesh, output: dict with the vert index as key and edge-keys as value 98 | def dict_vert_edges(bm): 99 | vert_edges = dict([[v.index, []] for v in bm.verts if not v.hide]) 100 | for edge in bm.edges: 101 | if edge.hide: 102 | continue 103 | ek = edgekey(edge) 104 | for vert in ek: 105 | vert_edges[vert].append(ek) 106 | 107 | return(vert_edges) 108 | 109 | 110 | # input: bmesh, output: dict with the vert index as key and face index as value 111 | def dict_vert_faces(bm): 112 | vert_faces = dict([[v.index, []] for v in bm.verts if not v.hide]) 113 | for face in bm.faces: 114 | if not face.hide: 115 | for vert in face.verts: 116 | vert_faces[vert.index].append(face.index) 117 | 118 | return(vert_faces) 119 | 120 | 121 | # input: list of edge-keys, output: dictionary with vertex-vertex connections 122 | def dict_vert_verts(edge_keys): 123 | # create connection data 124 | vert_verts = {} 125 | for ek in edge_keys: 126 | for i in range(2): 127 | if ek[i] in vert_verts: 128 | vert_verts[ek[i]].append(ek[1-i]) 129 | else: 130 | vert_verts[ek[i]] = [ek[1-i]] 131 | 132 | return(vert_verts) 133 | 134 | 135 | # return the edgekey ([v1.index, v2.index]) of a bmesh edge 136 | def edgekey(edge): 137 | return(tuple(sorted([edge.verts[0].index, edge.verts[1].index]))) 138 | 139 | 140 | # returns the edgekeys of a bmesh face 141 | def face_edgekeys(face): 142 | return([tuple(sorted([edge.verts[0].index, edge.verts[1].index])) for \ 143 | edge in face.edges]) 144 | 145 | 146 | # calculate input loops 147 | # method is modified 148 | def get_connected_input(bm): 149 | # calculate selected loops 150 | edge_keys = [edgekey(edge) for edge in bm.edges if \ 151 | edge.select and not edge.hide] 152 | loops = get_connected_selections(edge_keys) 153 | 154 | return(loops) 155 | 156 | 157 | # sorts all edge-keys into a list of loops 158 | def get_connected_selections(edge_keys): 159 | # create connection data 160 | vert_verts = dict_vert_verts(edge_keys) 161 | 162 | # find loops consisting of connected selected edges 163 | loops = [] 164 | while len(vert_verts) > 0: 165 | loop = [iter(vert_verts.keys()).__next__()] 166 | growing = True 167 | flipped = False 168 | 169 | # extend loop 170 | while growing: 171 | # no more connection data for current vertex 172 | if loop[-1] not in vert_verts: 173 | if not flipped: 174 | loop.reverse() 175 | flipped = True 176 | else: 177 | growing = False 178 | else: 179 | extended = False 180 | for i, next_vert in enumerate(vert_verts[loop[-1]]): 181 | if next_vert not in loop: 182 | vert_verts[loop[-1]].pop(i) 183 | if len(vert_verts[loop[-1]]) == 0: 184 | del vert_verts[loop[-1]] 185 | # remove connection both ways 186 | if next_vert in vert_verts: 187 | if len(vert_verts[next_vert]) == 1: 188 | del vert_verts[next_vert] 189 | else: 190 | vert_verts[next_vert].remove(loop[-1]) 191 | loop.append(next_vert) 192 | extended = True 193 | break 194 | if not extended: 195 | # found one end of the loop, continue with next 196 | if not flipped: 197 | loop.reverse() 198 | flipped = True 199 | # found both ends of the loop, stop growing 200 | else: 201 | growing = False 202 | 203 | # check if loop is circular 204 | if loop[0] in vert_verts: 205 | if loop[-1] in vert_verts[loop[0]]: 206 | # is circular 207 | if len(vert_verts[loop[0]]) == 1: 208 | del vert_verts[loop[0]] 209 | else: 210 | vert_verts[loop[0]].remove(loop[-1]) 211 | if len(vert_verts[loop[-1]]) == 1: 212 | del vert_verts[loop[-1]] 213 | else: 214 | vert_verts[loop[-1]].remove(loop[0]) 215 | loop = [loop, True] 216 | else: 217 | # not circular 218 | loop = [loop, False] 219 | else: 220 | # not circular 221 | loop = [loop, False] 222 | 223 | loops.append(loop) 224 | 225 | return(loops) 226 | 227 | -------------------------------------------------------------------------------- /blender/addons/2.7/mira_tools/mi_noise.py: -------------------------------------------------------------------------------- 1 | # ***** BEGIN GPL LICENSE BLOCK ***** 2 | # 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software Foundation, 16 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | # 18 | # ***** END GPL LICENCE BLOCK ***** 19 | 20 | import bpy 21 | import bgl 22 | import blf 23 | import string 24 | import bmesh 25 | 26 | from bpy.props import * 27 | from bpy.types import Operator, AddonPreferences 28 | 29 | from bpy_extras import view3d_utils 30 | 31 | import math 32 | import mathutils as mathu 33 | import random 34 | from mathutils import Vector 35 | 36 | from . import mi_utils_base as ut_base 37 | 38 | 39 | class MI_Noise(bpy.types.Operator): 40 | bl_idname = "mira.noise" 41 | bl_label = "Noise" 42 | bl_description = "Noise" 43 | bl_options = {'REGISTER', 'UNDO'} 44 | 45 | noise_type = EnumProperty( 46 | items=(('Turbulence', 'Turbulence', ''), 47 | ('Fractal', 'Fractal', ''), 48 | ('HeteroTerrain', 'HeteroTerrain', ''), 49 | ), 50 | default = 'Turbulence' 51 | ) 52 | 53 | frequency = FloatProperty(default=1.0) 54 | intensity = FloatProperty(default=1.0) 55 | offset_x = FloatProperty(default=0.0) 56 | offset_y = FloatProperty(default=0.0) 57 | offset_z = FloatProperty(default=0.0) 58 | octaves = IntProperty(default=2) 59 | amplitude_scale = FloatProperty(default=0.5) 60 | frequency_scale = FloatProperty(default=2.0) 61 | hard = BoolProperty(default=True) 62 | 63 | 64 | def execute(self, context): 65 | 66 | obj = context.scene.objects.active 67 | noise_obj(obj, context, self) 68 | 69 | return {'FINISHED'} 70 | 71 | def invoke(self, context, event): 72 | # if context.area.type == 'VIEW_3D': 73 | # change startup 74 | # self.select_mouse_mode = context.user_preferences.inputs.select_mouse 75 | # context.user_preferences.inputs.select_mouse = 'RIGHT' 76 | 77 | return self.execute(context) 78 | # else: 79 | # self.report({'WARNING'}, "View3D not found, cannot run operator") 80 | # return {'CANCELLED'} 81 | 82 | 83 | def noise_obj(obj, context, self): 84 | bm = bmesh.from_edit_mesh(obj.data) 85 | verts = [v for v in bm.verts if v.select] 86 | if not verts: 87 | verts = [v for v in bm.verts if v.hide is False] 88 | 89 | for vert in verts: 90 | noise_pos = self.frequency * vert.co.copy() 91 | noise_pos.x += self.offset_x 92 | noise_pos.z += self.offset_y 93 | noise_pos.z += self.offset_z 94 | 95 | noise_val = None 96 | if self.noise_type == 'Turbulence': 97 | noise_val = mathu.noise.turbulence(noise_pos, self.octaves, self.hard, mathu.noise.types.STDPERLIN, self.amplitude_scale, self.frequency_scale) 98 | elif self.noise_type == 'Fractal': 99 | noise_val = mathu.noise.fractal(noise_pos, self.amplitude_scale, self.frequency_scale, self.octaves, mathu.noise.types.STDPERLIN) 100 | else: 101 | noise_val = mathu.noise.hetero_terrain(noise_pos, self.amplitude_scale, self.frequency_scale, self.octaves, 0, mathu.noise.types.STDPERLIN) 102 | 103 | vert_offset = vert.normal.copy().normalized() * noise_val 104 | vert.co += vert_offset * self.intensity 105 | 106 | bm.normal_update() 107 | bmesh.update_edit_mesh(obj.data) 108 | -------------------------------------------------------------------------------- /blender/addons/2.7/mira_tools/mi_settings.py: -------------------------------------------------------------------------------- 1 | # ***** BEGIN GPL LICENSE BLOCK ***** 2 | # 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software Foundation, 16 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | # 18 | # ***** END GPL LICENCE BLOCK ***** 19 | 20 | import bpy 21 | 22 | from bpy.props import * 23 | from bpy.types import Operator, AddonPreferences, PropertyGroup 24 | 25 | 26 | class MI_Addon_Settings(AddonPreferences): 27 | bl_idname = __package__ 28 | 29 | key_inputs = EnumProperty( 30 | name = "Key Inputs Style", 31 | items = (('Blender', 'Blender', ''), 32 | ('Maya', 'Maya', '') 33 | ), 34 | default = 'Blender' 35 | ) 36 | 37 | def draw(self, context): 38 | layout = self.layout 39 | #row = layout.row() 40 | #row.prop(self, "sg_icons_style") 41 | layout.prop(self, "key_inputs") 42 | 43 | 44 | class MI_Settings(PropertyGroup): 45 | # For all tools 46 | surface_snap = BoolProperty(default=False) 47 | snap_objects = EnumProperty( 48 | name = "Objects To Snap", 49 | items = (('Selected', 'Selected', ''), 50 | ('Visible', 'Visible', '') 51 | ), 52 | default = 'Visible' 53 | ) 54 | convert_instances = BoolProperty(default=False) # This feat converts off duplis and group instances into meshes 55 | 56 | # Curve Settings 57 | curve_resolution = IntProperty(default=13, min=1, max=128) 58 | draw_handlers = BoolProperty(default=False) 59 | 60 | spread_mode = EnumProperty( 61 | name = "Spread Mode", 62 | items = (('Original', 'Original', ''), 63 | ('Uniform', 'Uniform', '') 64 | ), 65 | default = 'Original' 66 | ) -------------------------------------------------------------------------------- /blender/addons/2.7/mira_tools/mi_widget_curve.py: -------------------------------------------------------------------------------- 1 | # ***** BEGIN GPL LICENSE BLOCK ***** 2 | # 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software Foundation, 16 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | # 18 | # ***** END GPL LICENCE BLOCK ***** 19 | 20 | import bpy 21 | import bgl 22 | import blf 23 | import string 24 | 25 | from bpy.props import * 26 | from bpy.types import Operator, AddonPreferences 27 | 28 | from bpy_extras import view3d_utils 29 | 30 | import math 31 | import mathutils as mathu 32 | import random 33 | from mathutils import Vector 34 | 35 | from . import mi_utils_base as ut_base 36 | 37 | 38 | def draw_2d_point(point_x, point_y, p_size=4, p_col=(1.0,1.0,1.0,1.0)): 39 | bgl.glEnable(bgl.GL_BLEND) 40 | #bgl.glColor4f(1.0, 1.0, 1.0, 0.5) 41 | #bgl.glLineWidth(2) 42 | 43 | bgl.glPointSize(p_size) 44 | # bgl.glBegin(bgl.GL_LINE_LOOP) 45 | bgl.glBegin(bgl.GL_POINTS) 46 | # bgl.glBegin(bgl.GL_POLYGON) 47 | bgl.glColor4f(p_col[0], p_col[1], p_col[2], p_col[3]) 48 | bgl.glVertex2f(point_x, point_y) 49 | bgl.glEnd() 50 | 51 | # restore opengl defaults 52 | bgl.glLineWidth(1) 53 | bgl.glDisable(bgl.GL_BLEND) 54 | bgl.glColor4f(0.0, 0.0, 0.0, 1.0) 55 | 56 | 57 | def draw_3d_polyline(points, p_size, p_col, x_ray): 58 | bgl.glEnable(bgl.GL_BLEND) 59 | bgl.glLineWidth(1) 60 | 61 | if x_ray is True: 62 | bgl.glDisable(bgl.GL_DEPTH_TEST) 63 | 64 | bgl.glPointSize(p_size) 65 | # bgl.glBegin(bgl.GL_LINE_LOOP) 66 | bgl.glBegin(bgl.GL_LINE_STRIP) 67 | bgl.glColor4f(p_col[0], p_col[1], p_col[2], p_col[3]) 68 | # bgl.glBegin(bgl.GL_POLYGON) 69 | 70 | for point in points: 71 | bgl.glVertex3f(point[0], point[1], point[2]) 72 | 73 | if x_ray is True: 74 | bgl.glEnable(bgl.GL_DEPTH_TEST) 75 | 76 | bgl.glEnd() 77 | 78 | # restore opengl defaults 79 | bgl.glLineWidth(1) 80 | bgl.glDisable(bgl.GL_BLEND) 81 | bgl.glColor4f(0.0, 0.0, 0.0, 1.0) -------------------------------------------------------------------------------- /blender/addons/2.7/mira_tools/mi_widget_linear_deform.py: -------------------------------------------------------------------------------- 1 | # ***** BEGIN GPL LICENSE BLOCK ***** 2 | # 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software Foundation, 16 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | # 18 | # ***** END GPL LICENCE BLOCK ***** 19 | 20 | import bpy 21 | import bgl 22 | import blf 23 | import string 24 | 25 | from bpy.props import * 26 | from bpy.types import Operator, AddonPreferences 27 | 28 | from bpy_extras import view3d_utils 29 | 30 | import math 31 | import mathutils as mathu 32 | import random 33 | from mathutils import Vector 34 | 35 | from . import mi_utils_base as ut_base 36 | 37 | 38 | class MI_LW_Point(): 39 | 40 | # class constructor 41 | def __init__(self, position): 42 | self.position = position 43 | 44 | 45 | class MI_Linear_Widget(): 46 | 47 | # class constructor 48 | def __init__(self): 49 | self.start_point = None 50 | self.middle_point = None 51 | self.end_point = None 52 | 53 | 54 | def update_middle_point(lw_tool): 55 | lw_dir = (lw_tool.end_point.position - lw_tool.start_point.position) 56 | lw_len = (lw_dir).length 57 | lw_dir = lw_dir.normalized() 58 | 59 | lw_tool.middle_point.position = lw_tool.start_point.position + (lw_dir * (lw_len / 2.0)) 60 | 61 | 62 | def get_tool_verts(lw_tool, verts_ids, bm, obj, do_clamp, local_coords): 63 | apply_tool_verts = [] 64 | final_dir = ( lw_tool.end_point.position - lw_tool.start_point.position ) 65 | max_dist = final_dir.length 66 | for vert_id in verts_ids: 67 | v_pos = obj.matrix_world * bm.verts[vert_id].co 68 | value = mathu.geometry.distance_point_to_plane(v_pos, lw_tool.start_point.position, final_dir) 69 | if value > 0: 70 | if value > max_dist and do_clamp: 71 | value = 1.0 72 | else: 73 | value /= max_dist 74 | 75 | pos_final = v_pos 76 | if local_coords is True: 77 | pos_final = bm.verts[vert_id].co.copy() 78 | 79 | apply_tool_verts.append( (vert_id, value, pos_final) ) 80 | 81 | return apply_tool_verts 82 | 83 | 84 | def draw_lw(context, lw, cross_up_dir, draw_faloff): 85 | region = context.region 86 | rv3d = context.region_data 87 | 88 | start_2d = view3d_utils.location_3d_to_region_2d(region, rv3d, lw.start_point.position) 89 | end_2d = view3d_utils.location_3d_to_region_2d(region, rv3d, lw.end_point.position) 90 | middle_2d = view3d_utils.location_3d_to_region_2d(region, rv3d, lw.middle_point.position) 91 | 92 | dist_ends = ((lw.start_point.position - lw.end_point.position).length * 0.1) * cross_up_dir 93 | end_p1 = view3d_utils.location_3d_to_region_2d(region, rv3d, lw.end_point.position + dist_ends) 94 | end_p2 = view3d_utils.location_3d_to_region_2d(region, rv3d, lw.end_point.position - dist_ends) 95 | 96 | if start_2d and end_2d and end_p1 and end_p2: 97 | bgl.glEnable(bgl.GL_BLEND) 98 | bgl.glLineWidth(1) 99 | bgl.glPointSize(6) 100 | 101 | bgl.glBegin(bgl.GL_LINE_STRIP) 102 | bgl.glColor4f(0.99, 0.5, 0.99, 1.0) 103 | bgl.glVertex2f(start_2d[0], start_2d[1]) 104 | bgl.glVertex2f(end_2d[0], end_2d[1]) 105 | bgl.glEnd() 106 | 107 | if draw_faloff: 108 | bgl.glBegin(bgl.GL_LINE_LOOP) 109 | bgl.glColor4f(0.99, 0.5, 0.99, 1.0) 110 | bgl.glVertex2f(start_2d[0], start_2d[1]) 111 | bgl.glVertex2f(end_p1[0], end_p1[1]) 112 | bgl.glVertex2f(end_p2[0], end_p2[1]) 113 | bgl.glEnd() 114 | 115 | bgl.glBegin(bgl.GL_POINTS) 116 | # bgl.glBegin(bgl.GL_POLYGON) 117 | bgl.glColor4f(0.99, 0.8, 0.5, 1.0) 118 | bgl.glVertex2f(start_2d[0], start_2d[1]) 119 | bgl.glVertex2f(middle_2d[0], middle_2d[1]) 120 | bgl.glVertex2f(end_2d[0], end_2d[1]) 121 | bgl.glEnd() 122 | 123 | # restore opengl defaults 124 | bgl.glLineWidth(1) 125 | bgl.glDisable(bgl.GL_BLEND) 126 | bgl.glColor4f(0.0, 0.0, 0.0, 1.0) 127 | 128 | 129 | def pick_lw_point(context, m_coords, lw): 130 | region = context.region 131 | rv3d = context.region_data 132 | 133 | return_point = None 134 | good_distance = None 135 | 136 | mouse_coords = Vector(m_coords) 137 | 138 | lw_points = [lw.start_point, lw.middle_point, lw.end_point] 139 | for lw_point in lw_points: 140 | vec_2d = view3d_utils.location_3d_to_region_2d(region, rv3d, lw_point.position) 141 | dist = (vec_2d - mouse_coords).length 142 | if dist <= 9.0: 143 | if not return_point: 144 | return_point = lw_point 145 | good_distance = dist 146 | elif good_distance > dist: 147 | return_point = lw_point 148 | 149 | return return_point 150 | 151 | 152 | def setup_lw_tool(rv3d, lw_tool, active_obj, verts, center_type, scale_size): 153 | # Types 154 | # 'Auto', 'X', 'X_Left', 'X_Right', 'Z', 'Z_Top', 'Z_Bottom' 155 | 156 | # get verts bounds 157 | cam_x = (rv3d.view_rotation * Vector((1.0, 0.0, 0.0))).normalized() 158 | cam_y = (rv3d.view_rotation * Vector((0.0, 1.0, 0.0))).normalized() 159 | #cam_z = (rv3d.view_rotation * Vector((0.0, 0.0, -1.0))).normalized() # Camera Direction 160 | bounds = ut_base.get_verts_bounds(verts, active_obj, cam_x, cam_y, None, False) 161 | 162 | # set middle_point 163 | middle_p = None 164 | if center_type in {'Auto', 'X', 'Z'}: 165 | middle_p = bounds[3] 166 | elif center_type == 'X_Left': 167 | middle_p = bounds[3] + (cam_y * (bounds[1] / 2.0)) 168 | elif center_type == 'X_Right': 169 | middle_p = bounds[3] - (cam_y * (bounds[1] / 2.0)) 170 | elif center_type == 'Z_Top': 171 | middle_p = bounds[3] - (cam_x * (bounds[0] / 2.0)) 172 | elif center_type == 'Z_Bottom': 173 | middle_p = bounds[3] + (cam_x * (bounds[0] / 2.0)) 174 | 175 | # set lw_tool points 176 | start_p = None 177 | end_p = None 178 | if center_type == 'Auto': 179 | if bounds[0] > bounds[1]: 180 | # scale_size is additive value so that to get points on the top and on the left 181 | start_p = middle_p - (cam_x * (bounds[0] / 2.0) * scale_size) 182 | end_p = middle_p + (cam_x * (bounds[0] / 2.0) * scale_size) 183 | else: 184 | start_p = middle_p - (cam_y * (bounds[1] / 2.0) * scale_size) 185 | end_p = middle_p + (cam_y * (bounds[1] / 2.0) * scale_size) 186 | elif center_type in {'X', 'X_Left', 'X_Right'}: 187 | # scale_size is additive value so that to get points on the top and on the left 188 | start_p = middle_p - (cam_x * (bounds[0] / 2.0) * scale_size) 189 | end_p = middle_p + (cam_x * (bounds[0] / 2.0) * scale_size) 190 | elif center_type in {'Z', 'Z_Top', 'Z_Bottom'}: 191 | # scale_size is additive value so that to get points on the top and on the left 192 | start_p = middle_p - (cam_y * (bounds[1] / 2.0) * scale_size) 193 | end_p = middle_p + (cam_y * (bounds[1] / 2.0) * scale_size) 194 | 195 | lw_tool.start_point = MI_LW_Point(start_p) 196 | lw_tool.middle_point = MI_LW_Point(middle_p) 197 | lw_tool.end_point = MI_LW_Point(end_p) -------------------------------------------------------------------------------- /blender/addons/2.7/mira_tools/mi_widget_select.py: -------------------------------------------------------------------------------- 1 | # ***** BEGIN GPL LICENSE BLOCK ***** 2 | # 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software Foundation, 16 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | # 18 | # ***** END GPL LICENCE BLOCK ***** 19 | 20 | import bpy 21 | import bgl 22 | import blf 23 | import string 24 | 25 | from bpy.props import * 26 | from bpy.types import Operator, AddonPreferences 27 | 28 | from bpy_extras import view3d_utils 29 | 30 | import math 31 | import mathutils as mathu 32 | import random 33 | from mathutils import Vector 34 | 35 | from . import mi_utils_base as ut_base 36 | 37 | 38 | def draw_circle_select(m_coords, radius = 16, p_col = (0.7,0.8,1.0,0.6), enabled = False, sub = False): 39 | if(enabled): 40 | f_col = p_col 41 | if sub: 42 | f_col = (1.0, 0.5, 0.4, 0.6) 43 | bgl.glEnable(bgl.GL_BLEND) 44 | bgl.glBegin(bgl.GL_POLYGON) 45 | bgl.glColor4f(f_col[0], f_col[1], f_col[2], f_col[3]/3) 46 | 47 | point_x = m_coords[0] 48 | point_y = m_coords[1] 49 | 50 | radius = int(radius) 51 | 52 | for x in range(0, radius*2): 53 | bgl.glVertex2f(point_x + radius * math.cos(x * (360/(radius*2)) / 180 * 3.14159), point_y + radius * math.sin(x * (360/(radius*2)) / 180 * 3.14159)) 54 | bgl.glEnd() 55 | 56 | bgl.glBegin(bgl.GL_LINES) 57 | bgl.glColor4f(f_col[0], f_col[1], f_col[2], f_col[3]) 58 | for x in range(0, radius*2): 59 | bgl.glVertex2f(point_x + radius * math.cos(x * (360 / (radius * 2)) / 180 * 3.14159), 60 | point_y + radius * math.sin(x * (360 / (radius * 2)) / 180 * 3.14159)) 61 | 62 | bgl.glEnd() 63 | # restore opengl defaults 64 | bgl.glLineWidth(1) 65 | bgl.glDisable(bgl.GL_BLEND) 66 | bgl.glColor4f(0.0, 0.0, 0.0, 1.0) 67 | 68 | 69 | def draw_box_select(anchor, m_coords, region, p_col = (0.7,0.8,1.0,0.6), enabled = False, dragging = False, sub = False): 70 | 71 | if enabled: 72 | f_col = p_col 73 | if sub: 74 | f_col = (1.0, 0.5, 0.4, 0.6) 75 | bgl.glEnable(bgl.GL_BLEND) 76 | bgl.glLineStipple(1, 0xCCCC) 77 | bgl.glEnable(bgl.GL_LINE_STIPPLE) 78 | 79 | bgl.glBegin(bgl.GL_LINES) 80 | bgl.glColor4f(f_col[0], f_col[1], f_col[2], f_col[3]) 81 | 82 | point_x = m_coords[0] 83 | point_y = m_coords[1] 84 | 85 | bgl.glVertex2f(point_x,0) 86 | bgl.glVertex2f(point_x, region.height) 87 | 88 | bgl.glVertex2f(0, point_y) 89 | bgl.glVertex2f(region.width, point_y) 90 | 91 | bgl.glEnd() 92 | bgl.glDisable(bgl.GL_LINE_STIPPLE) 93 | bgl.glDisable(bgl.GL_BLEND) 94 | 95 | if dragging: 96 | bgl.glEnable(bgl.GL_BLEND) 97 | bgl.glBegin(bgl.GL_QUADS) 98 | bgl.glColor4f(f_col[0], f_col[1], f_col[2], f_col[3] / 3) 99 | point_x = m_coords[0] 100 | point_y = m_coords[1] 101 | 102 | anc_x = anchor[0] 103 | anc_y = anchor[1] 104 | 105 | bgl.glVertex2f(anc_x, anc_y) 106 | bgl.glVertex2f(point_x, anc_y) 107 | bgl.glVertex2f(point_x,point_y) 108 | bgl.glVertex2f(anc_x,point_y) 109 | bgl.glEnd() 110 | 111 | bgl.glLineStipple(1, 0xCCCC) 112 | bgl.glEnable(bgl.GL_LINE_STIPPLE) 113 | bgl.glBegin(bgl.GL_LINE_LOOP) 114 | 115 | bgl.glColor4f(f_col[0], f_col[1], f_col[2], f_col[3]) 116 | bgl.glVertex2f(anc_x, anc_y) 117 | bgl.glVertex2f(point_x, anc_y) 118 | bgl.glVertex2f(point_x, point_y) 119 | bgl.glVertex2f(anc_x, point_y) 120 | 121 | bgl.glEnd() 122 | # restore opengl defaults 123 | bgl.glLineWidth(1) 124 | bgl.glDisable(bgl.GL_LINE_STIPPLE) 125 | bgl.glDisable(bgl.GL_BLEND) 126 | bgl.glColor4f(0.0, 0.0, 0.0, 1.0) -------------------------------------------------------------------------------- /blender/addons/2.7/paint_clones/README.md: -------------------------------------------------------------------------------- 1 | # Blender Paintclones 2 | 3 | *A tool to paint many clones over selected object(s).* 4 | 5 | ## Usage 6 | - In 3d view, find and unfold Paint Clones panel in the Tools panel (bottom) 7 | - Select object(s) to clone 8 | - Push "Pick source(s)" 9 | - Select target object(s) 10 | - Push "Paint Clones" 11 | - Draw your clones on target object(s) with left mouse button pressed 12 | - Right click (or esc) to stop painting 13 | 14 | When many objects are selected as sources for clones, the tool randomly clone objects from this list 15 | 16 | 17 | ## Options 18 | 19 | ### Optimize 20 | 21 | link clones data to source 22 | 23 | 24 | ### Align modes 25 | 26 | *align your clones main axis to follow this direction* 27 | 28 | - Target normal (perpendicular to surface). 29 | - Fixed axis (x y or z). 30 | - Follow stroke direction. 31 | 32 | 33 | ### Axis 34 | 35 | The main source axis for align direction 36 | 37 | 38 | ### Up Axis 39 | 40 | The axis of your source for secondary direction (up) 41 | 42 | - target normal when align is in Follow stroke mode 43 | - stroke direction otherwhise 44 | 45 | 46 | ### Randomize 47 | 48 | Randomize rotation and scale (scale down only) 49 | 50 | 51 | ### Spacing 52 | 53 | How many space is left between two clones 54 | 55 | 56 | ### Scatter 57 | 58 | Scatter clones arround stroke 59 | 60 | ### Grouping 61 | 62 | *you may want to group clones* 63 | 64 | - Use source group 65 | - Add to group (pick the group to add clones) 66 | - Create group (give the name of your new group) 67 | 68 | 69 | ### Pressure 70 | 71 | Options to change params according input device pressure 72 | -------------------------------------------------------------------------------- /blender/addons/2.7/quick_pipe/quick_pipe.py: -------------------------------------------------------------------------------- 1 | import bpy 2 | import bmesh 3 | import math 4 | import mathutils as mathu 5 | 6 | from bpy.props import IntProperty, FloatProperty 7 | 8 | bl_info = { 9 | "name": "Quick Pipe", 10 | "author": "floatvoid (Jeremy Mitchell), Pavel Geraskin", 11 | "version": (1, 0), 12 | "blender": (2, 79, 0), 13 | "location": "View3D > Edit Mode", 14 | "description": "Quickly converts an edge selection to an extruded curve.", 15 | "warning": "", 16 | "wiki_url": "", 17 | "category": "View3D"} 18 | 19 | 20 | class jmPipeTool(bpy.types.Operator): 21 | bl_idname = "object.quickpipe" 22 | bl_label = "Quick Pipe" 23 | bl_options = {'REGISTER', 'UNDO'} 24 | 25 | first_mouse_x = IntProperty() 26 | first_value = FloatProperty() 27 | 28 | def modal(self, context, event): 29 | if event.type in {'RIGHTMOUSE', 'ESC', 'LEFTMOUSE'}: 30 | return {'FINISHED'} 31 | 32 | if event.type == 'MOUSEMOVE': 33 | delta = (self.first_mouse_x - event.mouse_x) 34 | 35 | if event.ctrl: 36 | delta *= 0.1 37 | 38 | if event.shift: 39 | delta *= 0.1 40 | 41 | context.object.data.bevel_depth = abs( (self.first_value + delta) * 0.01 ) 42 | elif event.type == 'WHEELUPMOUSE': 43 | bpy.context.object.data.bevel_resolution += 1 44 | elif event.type == 'WHEELDOWNMOUSE': 45 | if bpy.context.object.data.bevel_resolution > 0: 46 | bpy.context.object.data.bevel_resolution -= 1 47 | 48 | return {'RUNNING_MODAL'} 49 | 50 | def invoke(self, context, event): 51 | if context.object: 52 | 53 | if( context.object.type == 'MESH' ): 54 | self.first_mouse_x = event.mouse_x 55 | 56 | bpy.ops.mesh.duplicate_move() 57 | bpy.ops.mesh.separate(type='SELECTED') 58 | bpy.ops.object.editmode_toggle() 59 | bpy.ops.object.select_all(action='DESELECT') 60 | 61 | pipe = bpy.context.scene.objects[0] 62 | pipe.select = True 63 | bpy.context.scene.objects.active = pipe 64 | bpy.ops.object.convert(target='CURVE') 65 | 66 | pipe.data.fill_mode = 'FULL' 67 | #pipe.data.splines[0].use_smooth = True 68 | pipe.data.bevel_resolution = 1 69 | pipe.data.bevel_depth = 0.1 70 | 71 | elif( context.object.type == 'CURVE' ): 72 | self.report({'WARNING'}, "Need Edit Mode!") 73 | return {'CANCELLED'} 74 | 75 | self.first_value = pipe.data.bevel_depth 76 | 77 | context.window_manager.modal_handler_add(self) 78 | return {'RUNNING_MODAL'} 79 | else: 80 | self.report({'WARNING'}, "No active object, could not finish") 81 | return {'CANCELLED'} 82 | 83 | 84 | class VIEW3D_PT_tools_jmPipeTool(bpy.types.Panel): 85 | 86 | bl_label = "Quick Pipe" 87 | bl_space_type = 'VIEW_3D' 88 | bl_region_type = 'TOOLS' 89 | bl_category = 'Tools' 90 | bl_context = "mesh_edit" 91 | bl_options = {'DEFAULT_CLOSED'} 92 | 93 | def draw(self, context): 94 | layout = self.layout 95 | 96 | row = layout.row() 97 | row.operator("object.quickpipe") 98 | 99 | 100 | def register(): 101 | bpy.utils.register_module(__name__) 102 | 103 | 104 | def unregister(): 105 | bpy.utils.unregister_module(__name__) 106 | 107 | if __name__ == "__main__": 108 | register() 109 | -------------------------------------------------------------------------------- /blender/addons/2.7/super_grouper/__init__.py: -------------------------------------------------------------------------------- 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 | 19 | bl_info = { 20 | "name": "Super Grouper", 21 | "author": "Paul Geraskin, Aleksey Juravlev, BA Community", 22 | "version": (0, 1, 0), 23 | "blender": (2, 73, 0), 24 | "location": "Toolshelf > Relations Tab", 25 | "warning": "", 26 | "description": "Super Grouper", 27 | "wiki_url": "", 28 | "category": "3D View"} 29 | 30 | if "bpy" in locals(): 31 | import imp 32 | imp.reload(grouper_main) 33 | else: 34 | from . import grouper_main 35 | 36 | 37 | import bpy 38 | from bpy.props import * 39 | 40 | 41 | # registration 42 | def menu_func(self, context): 43 | self.layout.separator() 44 | self.layout.menu(grouper_main.SG_Specials_Main_Menu.bl_idname) 45 | 46 | 47 | def register(): 48 | bpy.utils.register_module(__name__) 49 | 50 | bpy.types.Scene.super_groups = CollectionProperty( 51 | type=grouper_main.SG_Group) 52 | bpy.types.Object.sg_belong_id = CollectionProperty( 53 | type=grouper_main.SG_Object_Id) 54 | bpy.types.Scene.sg_settings = PointerProperty( 55 | type=grouper_main.SG_Other_Settings) 56 | 57 | # Unused, but this is needed for the TemplateList to work... 58 | bpy.types.Scene.super_groups_index = IntProperty(default=-1) 59 | 60 | bpy.types.VIEW3D_MT_object_specials.append(menu_func) 61 | 62 | 63 | def unregister(): 64 | import bpy 65 | 66 | # del bpy.types.Scene.super_grouper 67 | # del bpy.miraTool 68 | del bpy.types.Scene.super_groups 69 | del bpy.types.Object.sg_belong_id 70 | del bpy.types.Scene.sg_settings 71 | 72 | del bpy.types.Scene.super_groups_index 73 | 74 | bpy.types.VIEW3D_MT_object_specials.remove(menu_func) 75 | 76 | bpy.utils.unregister_module(__name__) 77 | 78 | 79 | if __name__ == "__main__": 80 | register() 81 | -------------------------------------------------------------------------------- /blender/addons/2.8/df_tools/__init__.py: -------------------------------------------------------------------------------- 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 | 19 | # 20 | 21 | bl_info = { 22 | "name": "DF Tools", 23 | "author": "DF Tools", 24 | "version": (1, 0, 0), 25 | "blender": (2, 80, 0), 26 | "location": "3D Vieport", 27 | "description": "DF Tools", 28 | "warning": "", 29 | "wiki_url": "", 30 | "category": "Mesh"} 31 | 32 | 33 | if "bpy" in locals(): 34 | importlib.reload(df_objects) 35 | 36 | else: 37 | from . import df_objects 38 | 39 | import bpy 40 | from bpy.props import ( 41 | BoolProperty, 42 | FloatProperty, 43 | StringProperty, 44 | EnumProperty, 45 | ) 46 | 47 | 48 | 49 | classes = ( 50 | df_objects.DFCopyOBJ, 51 | ) 52 | 53 | 54 | def register(): 55 | for cls in classes: 56 | bpy.utils.register_class(cls) 57 | 58 | 59 | 60 | def unregister(): 61 | for cls in classes: 62 | bpy.utils.unregister_class(cls) 63 | 64 | 65 | if __name__ == "__main__": 66 | register() 67 | -------------------------------------------------------------------------------- /blender/addons/2.8/df_tools/df_objects.py: -------------------------------------------------------------------------------- 1 | import bpy 2 | import bmesh 3 | 4 | from bpy.props import * 5 | from bpy.types import Operator 6 | 7 | import math 8 | import mathutils as mathu 9 | from mathutils import Vector, Matrix 10 | 11 | class DFCopyOBJ(bpy.types.Operator): 12 | bl_idname = "df.copy_obj" 13 | bl_label = "Clone Objects to Verts" 14 | bl_description = "Clone Objects to Verts" 15 | bl_options = {'REGISTER', 'UNDO'} 16 | 17 | 18 | def execute(self, context): 19 | 20 | get_obj = context.active_object 21 | if context.selected_objects[0] is get_obj: 22 | copy_obj = context.selected_objects[1] 23 | else: 24 | copy_obj = context.selected_objects[0] 25 | 26 | bm = bmesh.from_edit_mesh(get_obj.data) 27 | bm.verts.ensure_lookup_table() 28 | 29 | v_indexes = [] 30 | if isinstance(bm.select_history[0], bmesh.types.BMVert): 31 | for element in bm.select_history: 32 | v_indexes.append(element.index) 33 | 34 | bpy.ops.object.editmode_toggle() 35 | bpy.ops.object.select_all(action='DESELECT') 36 | 37 | for idx in range(int(len(v_indexes) / 3)): 38 | 39 | true_idx = idx * 3 40 | 41 | v1 = get_obj.matrix_world @ get_obj.data.vertices[v_indexes[true_idx]].co.copy() 42 | v2 = get_obj.matrix_world @ get_obj.data.vertices[v_indexes[true_idx + 1]].co.copy() 43 | v3 = get_obj.matrix_world @ get_obj.data.vertices[v_indexes[true_idx + 2]].co.copy() 44 | 45 | dir1 = (v1 - v2).normalized() 46 | dir2 = dir1.cross(((v3 - v2).normalized())).normalized() 47 | dir2.negate() 48 | dir3 = dir1.cross(dir2).normalized() 49 | 50 | # clone obj 51 | copy_obj.select_set(True) 52 | bpy.ops.object.duplicate(linked=True) 53 | new_obj = context.selected_objects[0] 54 | 55 | new_mat = mathu.Matrix().to_3x3() 56 | new_mat[0][0], new_mat[1][0], new_mat[2][0] = dir1[0], dir1[1], dir1[2] 57 | new_mat[0][1], new_mat[1][1], new_mat[2][1] = dir2[0], dir2[1], dir2[2] 58 | new_mat[0][2], new_mat[1][2], new_mat[2][2] = dir3[0], dir3[1], dir3[2] 59 | #new_mat = new_mat.normalized() 60 | 61 | new_obj.matrix_world = new_mat.to_4x4() 62 | new_obj.location = v2.copy() 63 | new_obj.scale = copy_obj.scale.copy() 64 | 65 | bpy.ops.object.select_all(action='DESELECT') 66 | 67 | return {'FINISHED'} 68 | -------------------------------------------------------------------------------- /blender/addons/2.8/io_simple_3dcoat/__init__.py: -------------------------------------------------------------------------------- 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 | 19 | bl_info = { 20 | "name": "Simple 3D-Coat Applink", 21 | "author": "Kalle-Samuli Riihikoski (haikalle), Mifth", 22 | "version": (0, 4, 0), 23 | "blender": (2, 93, 0), 24 | "location": "3D Viewport", 25 | "description": "Transfer data between 3D-Coat/Blender", 26 | "warning": "", 27 | "wiki_url": "https://3dcoat.com/forum/index.php?/topic/15481-blender-28-applink-simple3dcoat-fork-of-the-official/", 28 | "tracker_url": "", 29 | "category": "Import-Export"} 30 | 31 | from . import simple_coat 32 | 33 | import bpy 34 | from bpy.props import * 35 | 36 | classes = ( 37 | simple_coat, 38 | ) 39 | 40 | 41 | def register(): 42 | 43 | for cls in classes: 44 | cls.register() 45 | 46 | 47 | def unregister(): 48 | for cls in classes: 49 | cls.unregister() 50 | 51 | 52 | if __name__ == "__main__": 53 | register() 54 | -------------------------------------------------------------------------------- /blender/addons/2.8/mifth_tools/__init__.py: -------------------------------------------------------------------------------- 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 | 19 | bl_info = { 20 | "name": "Mifth Tools", 21 | "author": "mifth", 22 | "version": (0, 1, 0), 23 | "blender": (2, 80, 0), 24 | "location": "3D Viewport", 25 | "description": "Mifth Tools", 26 | "warning": "", 27 | "wiki_url": "", 28 | "tracker_url": "", 29 | "category": "Tools"} 30 | 31 | # if "bpy" in locals(): 32 | # import imp 33 | # imp.reload(mifth_tools_cloning) 34 | # imp.reload(mifth_vertex_paint) 35 | # imp.reload(mifth_tools_base) 36 | # imp.reload(mifth_tools_ui) 37 | # else: 38 | # from . import mifth_tools_cloning 39 | # from . import mifth_vertex_paint 40 | # from . import mifth_tools_base 41 | # from . import mifth_tools_ui 42 | 43 | import bpy 44 | from bpy.props import * 45 | 46 | from . import mifth_tools_cloning 47 | from . import mifth_vertex_paint 48 | from . import mifth_tools_base 49 | from . import mifth_tools_ui 50 | 51 | # registration 52 | #def menu_vertex_paint_func(self, context): 53 | #self.layout.separator() 54 | #self.layout.menu(mifth_vertex_paint.MFTVertexPaintMenu.bl_idname) 55 | 56 | 57 | class MFTProperties(bpy.types.PropertyGroup): 58 | 59 | # Output Settings 60 | outputFolder : StringProperty( 61 | name="outputFolder", 62 | subtype="NONE", 63 | default="seq" 64 | ) 65 | 66 | outputSubFolder : StringProperty( 67 | name="outputSubFolder", 68 | subtype="NONE", 69 | default="ren" 70 | ) 71 | 72 | outputSequence : StringProperty( 73 | name="outputSequence", 74 | subtype="NONE", 75 | default="render" 76 | ) 77 | 78 | outputSequenceSize : IntProperty( 79 | default=8, 80 | min=1, 81 | max=60 82 | ) 83 | 84 | doOutputSubFolder : BoolProperty( 85 | name="do Output SubFolder", 86 | description="do Output SubFolder...", 87 | default=False 88 | ) 89 | 90 | # Curve Animator Settings 91 | doUseSceneFrames : BoolProperty( 92 | name="do use scene frames", 93 | description="do use scene frames...", 94 | default=False 95 | ) 96 | 97 | curveAniStartFrame : IntProperty( 98 | default=1, 99 | min=1, 100 | max=10000 101 | ) 102 | 103 | curveAniEndFrame : IntProperty( 104 | default=100, 105 | min=1, 106 | max=10000 107 | ) 108 | 109 | curveAniStepFrame : IntProperty( 110 | default=10, 111 | min=1, 112 | max=10000 113 | ) 114 | 115 | curveAniInterpolation : FloatProperty( 116 | default=0.3, 117 | min=0.0, 118 | max=1.0 119 | ) 120 | 121 | # MorfCreator settings 122 | morfCreatorNames : StringProperty( 123 | name="MorfNames", 124 | subtype="NONE", 125 | default="" 126 | ) 127 | 128 | morfUseWorldMatrix : BoolProperty( 129 | name="use world matrix", 130 | description="use world matrix...", 131 | default=False 132 | ) 133 | 134 | morfApplyModifiers : BoolProperty( 135 | name="apply modifiers to morf", 136 | description="apply modifiers to morf...", 137 | default=False 138 | ) 139 | 140 | 141 | classes = ( 142 | mifth_tools_ui.MFT_PT_PanelPose, 143 | mifth_tools_ui.MFT_PT_PanelAnimation, 144 | mifth_tools_ui.MFT_PT_PanelPlaykot, 145 | mifth_tools_ui.MFT_PT_PanelDrawClones, 146 | mifth_tools_ui.MFT_PT_PanelOtherTools, 147 | mifth_tools_ui.MFT_PT_PanelVertexPaint, 148 | mifth_tools_base.MFTOutputCreator, 149 | mifth_tools_base.MFTSceneRender2X, 150 | mifth_tools_base.MFTCropNodeRegion, 151 | mifth_tools_base.MFTCurveAnimator, 152 | mifth_tools_base.MFTMorfCreator, 153 | mifth_tools_base.MFTCopyBonesTransform, 154 | mifth_tools_cloning.MFTCloneProperties, 155 | mifth_tools_cloning.MFTDrawClones, 156 | mifth_tools_cloning.MFTPickObjToDrawClone, 157 | mifth_tools_cloning.MFTCloneToSelected, 158 | mifth_tools_cloning.MFTRadialClone, 159 | mifth_tools_cloning.MFTGroupInstance, 160 | mifth_tools_cloning.MFTGroupToMesh, 161 | mifth_vertex_paint.MFTSetColorToSelected, 162 | mifth_vertex_paint.MFTInvertColors, 163 | MFTProperties, 164 | ) 165 | 166 | 167 | # Register 168 | def register(): 169 | for cls in classes: 170 | bpy.utils.register_class(cls) 171 | #update_panel(None, bpy.context) 172 | 173 | bpy.types.Scene.mifthTools = PointerProperty( 174 | name="Mifth Tools Variables", 175 | type=MFTProperties, 176 | description="Mifth Tools Properties" 177 | ) 178 | 179 | bpy.types.Scene.mifthCloneTools = PointerProperty( 180 | name="Mifth Cloning Variables", 181 | type=mifth_tools_cloning.MFTCloneProperties, 182 | description="Mifth Cloning Properties" 183 | ) 184 | 185 | def unregister(): 186 | for cls in classes: 187 | bpy.utils.unregister_class(cls) 188 | 189 | 190 | if __name__ == "__main__": 191 | register() 192 | -------------------------------------------------------------------------------- /blender/addons/2.8/mifth_tools/mifth_tools_ui.py: -------------------------------------------------------------------------------- 1 | import bpy 2 | from bpy.props import * 3 | from bpy.types import Operator, AddonPreferences 4 | 5 | 6 | class MFT_PT_PanelPose(bpy.types.Panel): 7 | bl_label = "Bones" 8 | bl_space_type = 'VIEW_3D' 9 | bl_region_type = 'UI' 10 | bl_context = "posemode" 11 | bl_category = 'Mifth' 12 | bl_options = {'DEFAULT_CLOSED'} 13 | 14 | def draw(self, context): 15 | layout = self.layout 16 | mifthTools = context.scene.mifthTools 17 | 18 | op = layout.operator("mft.copy_bones_transform", text="CopyBonesTransform") 19 | op.mode = 'Copy' 20 | op = layout.operator("mft.copy_bones_transform", text="PasteBonesTransform") 21 | op.mode = 'Paste' 22 | 23 | 24 | class MFT_PT_PanelAnimation(bpy.types.Panel): 25 | bl_label = "Animations" 26 | bl_space_type = 'VIEW_3D' 27 | bl_region_type = 'UI' 28 | bl_context = "objectmode" 29 | bl_category = 'Mifth' 30 | bl_options = {'DEFAULT_CLOSED'} 31 | 32 | def draw(self, context): 33 | layout = self.layout 34 | mifthTools = context.scene.mifthTools 35 | 36 | layout.operator("mft.curveanimator", text="Curve Animator") 37 | layout.prop(mifthTools, "doUseSceneFrames", text='UseSceneFrames') 38 | row = layout.row() 39 | row.prop(mifthTools, "curveAniStartFrame", text='Start') 40 | row.prop(mifthTools, "curveAniEndFrame", text='End') 41 | row = layout.row() 42 | row.prop(mifthTools, "curveAniStepFrame", text='Steps') 43 | row.prop(mifthTools, "curveAniInterpolation", text='Interpolation') 44 | 45 | layout.separator() 46 | layout.separator() 47 | layout.operator("mft.morfcreator", text="Morfer") 48 | layout.prop(mifthTools, "morfCreatorNames") 49 | layout.prop(mifthTools, "morfUseWorldMatrix", text='useWorldMatrix') 50 | layout.prop(mifthTools, "morfApplyModifiers", text='applyModifiers') 51 | 52 | 53 | class MFT_PT_PanelPlaykot(bpy.types.Panel): 54 | bl_label = "PlaykotTools" 55 | bl_space_type = 'NODE_EDITOR' 56 | bl_region_type = 'UI' 57 | bl_context = "objectmode" 58 | bl_category = 'Mifth' 59 | bl_options = {'DEFAULT_CLOSED'} 60 | 61 | def draw(self, context): 62 | layout = self.layout 63 | mifthTools = context.scene.mifthTools 64 | 65 | layout.operator("mft.render_scene_2x", text="ScaleCrop") 66 | layout.operator("mft.cropnoderegion", text="CropNodeRegion") 67 | layout.operator("mft.crop_to_viewport", text="CropToViewport") 68 | 69 | layout.separator() 70 | layout.operator("mft.outputcreator", text="Create Output") 71 | layout.prop(mifthTools, "outputFolder") 72 | row = layout.row() 73 | row.prop(mifthTools, "outputSubFolder") 74 | row.prop(mifthTools, "doOutputSubFolder", text='') 75 | layout.prop(mifthTools, "outputSequence") 76 | layout.prop(mifthTools, "outputSequenceSize") 77 | 78 | 79 | class MFT_PT_PanelDrawClones(bpy.types.Panel): 80 | bl_label = "Draw Clones" 81 | bl_space_type = 'VIEW_3D' 82 | bl_region_type = 'UI' 83 | bl_context = "objectmode" 84 | bl_category = 'Mifth' 85 | bl_options = {'DEFAULT_CLOSED'} 86 | 87 | def draw(self, context): 88 | layout = self.layout 89 | mifthTools = bpy.context.scene.mifthTools 90 | mifthCloneTools = bpy.context.scene.mifthCloneTools 91 | 92 | layout.label(text="Draw Clones:") 93 | layout.operator("mft.draw_clones", text="DrawClones") 94 | layout.operator("mft.pick_obj_to_clone_draw", text="PickObjects") 95 | layout.separator() 96 | 97 | layout.prop(mifthCloneTools, "drawClonesDirectionRotate", text='DirectionRotate') 98 | layout.prop(mifthCloneTools, "drawClonesRadialRotate", text='RadialRotate') 99 | layout.prop(mifthCloneTools, "drawClonesNormalRotate", text='NormalRotate') 100 | layout.separator() 101 | 102 | layout.prop(mifthCloneTools, "drawClonesOffsetNomalBefore", text='OffsetNormal') 103 | layout.prop(mifthCloneTools, "drawClonesRotateNomalAfter", text='RotateNormal') 104 | layout.separator() 105 | 106 | layout.prop(mifthCloneTools, "drawStrokeLength", text='Stroke') 107 | layout.prop(mifthCloneTools, "drawRandomStrokeScatter", text='Scatter') 108 | layout.separator() 109 | 110 | layout.prop(mifthCloneTools, "randNormalRotateClone", text='RandNormal') 111 | layout.prop(mifthCloneTools, "randDirectionRotateClone", text='RandDirection') 112 | layout.prop(mifthCloneTools, "randScaleClone", text='RandScale') 113 | layout.separator() 114 | 115 | layout.prop(mifthCloneTools, "drawPressure", text='DrawPressure') 116 | row = layout.row() 117 | row.prop(mifthCloneTools, "drawPressureRelativeStroke", text='S') 118 | row.prop(mifthCloneTools, "drawPressureScale", text='S') 119 | row.prop(mifthCloneTools, "drawPressureScatter", text='S') 120 | layout.separator() 121 | 122 | layout.prop(mifthCloneTools, "drawClonesAxis", text='Axis') 123 | 124 | 125 | class MFT_PT_PanelOtherTools(bpy.types.Panel): 126 | bl_label = "Other Tools" 127 | bl_space_type = 'VIEW_3D' 128 | bl_region_type = 'UI' 129 | bl_context = "objectmode" 130 | bl_category = 'Mifth' 131 | bl_options = {'DEFAULT_CLOSED'} 132 | 133 | def draw(self, context): 134 | layout = self.layout 135 | mifthTools = bpy.context.scene.mifthTools 136 | mifthCloneTools = bpy.context.scene.mifthCloneTools 137 | 138 | layout.label(text="Clone Selected:") 139 | layout.operator("mft.clonetoselected", text="CloneToSelected") 140 | layout.separator() 141 | 142 | layout.label(text="Radial Clone:") 143 | layout.operator("mft.radialclone", text="Radial Clone") 144 | # layout.prop(mifthTools, "radialClonesNumber", text='') 145 | row = layout.row() 146 | row.prop(mifthCloneTools, "radialClonesAxis", text='') 147 | row.prop(mifthCloneTools, "radialClonesAxisType", text='') 148 | layout.separator() 149 | 150 | layout.label(text="Position Group:") 151 | layout.operator("mft.group_instance_to_cursor", text="Position Group") 152 | layout.prop(mifthCloneTools, "getGroupsLst", text='') 153 | layout.separator() 154 | 155 | layout.operator("mft.group_to_mesh", text="Groups To Mesh") 156 | 157 | 158 | class MFT_PT_PanelVertexPaint(bpy.types.Panel): 159 | bl_label = "Vertex Paint" 160 | bl_space_type = 'VIEW_3D' 161 | bl_region_type = 'UI' 162 | bl_context = "vertexpaint" 163 | bl_category = 'Mifth' 164 | bl_options = {'DEFAULT_CLOSED'} 165 | 166 | def draw(self, context): 167 | layout = self.layout 168 | mifthTools = bpy.context.scene.mifthTools 169 | 170 | layout.operator("mftv.set_colors_to_selected", text="Set Colors") 171 | layout.operator("mftv.invert_colors", text="Invert Colors") 172 | -------------------------------------------------------------------------------- /blender/addons/2.8/mifth_tools/mifth_vertex_paint.py: -------------------------------------------------------------------------------- 1 | import bpy 2 | 3 | from bpy.props import * 4 | from bpy.types import Operator, AddonPreferences 5 | from bpy.types import Menu, Panel, UIList, PropertyGroup 6 | from bpy.props import StringProperty, BoolProperty, IntProperty, CollectionProperty, BoolVectorProperty, PointerProperty 7 | 8 | 9 | #class MFTVertexPaintMenu(bpy.types.Menu): 10 | #bl_idname = "mftv.vertex_paint_menu" 11 | #bl_label = "Mifth VertexPaint" 12 | #bl_description = "Mifth Vertex Paint Menu" 13 | 14 | #def draw(self, context): 15 | #layout = self.layout 16 | 17 | ##layout.separator() 18 | #layout.operator(MFTSetColorToSelected.bl_idname) 19 | #layout.operator(MFTInvertColors.bl_idname) 20 | 21 | 22 | class MFTSetColorToSelected(bpy.types.Operator): 23 | bl_idname = "mftv.set_colors_to_selected" 24 | bl_label = "Set Colors to Selected" 25 | bl_description = "Set Colors to Selected" 26 | bl_options = {'REGISTER', 'UNDO'} 27 | 28 | strength : FloatVectorProperty( 29 | name="Color", 30 | subtype='COLOR', 31 | default=(0.5, 0.5, 0.5), 32 | min=0.0, max=1.0, 33 | description="wire color of the group" 34 | ) 35 | 36 | selected_faces_only : BoolProperty(name="Selected Faces Only", default=False) 37 | 38 | ch_col = False 39 | 40 | def execute(self, context): 41 | 42 | obj = context.view_layer.objects.active 43 | color_layer = obj.data.vertex_colors.active 44 | 45 | if self.ch_col is False: 46 | if context.scene.tool_settings.unified_paint_settings.use_unified_color is True: 47 | self.strength = context.scene.tool_settings.unified_paint_settings.color 48 | else: 49 | self.strength = context.tool_settings.vertex_paint.brush.color 50 | self.ch_col = True 51 | 52 | 53 | i = 0 54 | for poly in obj.data.polygons: 55 | for vert_idx in poly.vertices: 56 | if obj.data.vertices[vert_idx].select is True: 57 | 58 | if self.selected_faces_only is False: 59 | color_layer.data[i].color = (self.strength[0], self.strength[1], self.strength[2], 1.0) 60 | else: 61 | if poly.select is True: 62 | color_layer.data[i].color = (self.strength[0], self.strength[1], self.strength[2], 1.0) 63 | 64 | i += 1 65 | 66 | obj.data.update() 67 | 68 | return {'FINISHED'} 69 | 70 | 71 | class MFTInvertColors(bpy.types.Operator): 72 | bl_idname = "mftv.invert_colors" 73 | bl_label = "Invert Colors" 74 | bl_description = "Invert Colors" 75 | bl_options = {'REGISTER', 'UNDO'} 76 | 77 | selected_faces_only : BoolProperty(name="Selected Vertices Only", default=True) 78 | split_points : BoolProperty(name="Split Points", default=False) 79 | 80 | def execute(self, context): 81 | 82 | obj = context.view_layer.objects.active 83 | color_layer = obj.data.vertex_colors.active 84 | 85 | i = 0 86 | for poly in obj.data.polygons: 87 | for vert_idx in poly.vertices: 88 | if self.selected_faces_only is False: 89 | color_layer.data[i].color[ 90 | 0] = 1.0 - color_layer.data[i].color[0] 91 | color_layer.data[i].color[ 92 | 1] = 1.0 - color_layer.data[i].color[1] 93 | color_layer.data[i].color[ 94 | 2] = 1.0 - color_layer.data[i].color[2] 95 | else: 96 | if obj.data.vertices[vert_idx].select is True: 97 | if self.split_points is True: 98 | if poly.select is True: 99 | color_layer.data[i].color[ 100 | 0] = 1.0 - color_layer.data[i].color[0] 101 | color_layer.data[i].color[ 102 | 1] = 1.0 - color_layer.data[i].color[1] 103 | color_layer.data[i].color[ 104 | 2] = 1.0 - color_layer.data[i].color[2] 105 | else: 106 | color_layer.data[i].color[ 107 | 0] = 1.0 - color_layer.data[i].color[0] 108 | color_layer.data[i].color[ 109 | 1] = 1.0 - color_layer.data[i].color[1] 110 | color_layer.data[i].color[ 111 | 2] = 1.0 - color_layer.data[i].color[2] 112 | i += 1 113 | 114 | obj.data.update() 115 | 116 | return {'FINISHED'} 117 | -------------------------------------------------------------------------------- /blender/addons/2.8/mira_tools/__init__.py: -------------------------------------------------------------------------------- 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 | 19 | 20 | bl_info = { 21 | "name": "Mira Tools", 22 | "author": "Pavel Geraskin, Marvin K. Breuer, Graham Held, JoseConseco", 23 | "version": (3, 0, 2), 24 | "blender": (2, 90, 0), 25 | "location": "3D Viewport", 26 | "description": "Mira Tools", 27 | "warning": "", 28 | "wiki_url": "https://github.com/mifth/mifthtools/wiki/Mira-Tools", 29 | "tracker_url": "https://github.com/mifth/mifthtools/issues", 30 | "category": "Tools"} 31 | 32 | 33 | if "bpy" in locals(): 34 | import imp 35 | imp.reload(mi_curve_stretch) 36 | imp.reload(mi_curve_surfaces) 37 | imp.reload(mi_settings) 38 | imp.reload(mi_gui) 39 | imp.reload(mi_noise) 40 | imp.reload(mi_deform) 41 | imp.reload(mi_linear_deformer) 42 | imp.reload(mi_linear_deformer_curve) 43 | imp.reload(mi_curve_guide) 44 | imp.reload(mi_draw_extrude) 45 | imp.reload(mi_poly_loop) 46 | imp.reload(mi_make_arc) 47 | imp.reload(mi_wrap_master) 48 | imp.reload(mi_primitives) 49 | imp.reload(mi_simple_extrude) 50 | imp.reload(mi_unbevel) 51 | imp.reload(mi_retopo_loops) 52 | imp.reload(mi_snap_points) 53 | imp.reload(mi_simple_modeling) 54 | 55 | else: 56 | from . import mi_curve_stretch 57 | from . import mi_curve_surfaces 58 | from . import mi_settings 59 | from . import mi_linear_deformer 60 | from . import mi_linear_deformer_curve 61 | from . import mi_curve_guide 62 | from . import mi_deform 63 | from . import mi_gui 64 | from . import mi_noise 65 | from . import mi_draw_extrude 66 | from . import mi_poly_loop 67 | from . import mi_make_arc 68 | from . import mi_wrap_master 69 | from . import mi_primitives 70 | from . import mi_simple_extrude 71 | from . import mi_unbevel 72 | from . import mi_retopo_loops 73 | from . import mi_snap_points 74 | from . import mi_simple_modeling 75 | 76 | 77 | import bpy 78 | from bpy.props import * 79 | 80 | from . import auto_load 81 | auto_load.init() 82 | 83 | import traceback 84 | 85 | def register(): 86 | try: 87 | auto_load.register() 88 | except: 89 | traceback.print_exc() 90 | 91 | # bpy.types.Scene.mira_curve_points: PointerProperty( name="Mira Tool Variables", type=mi_curve_test.MR_CurvePoint, description="Mira Curve" ) 92 | # bpy.types.Object.mi_curves = CollectionProperty( name="Mira Tool Variables", type=mi_curve_test.MI_CurveObject, description="Mira Curve" ) 93 | bpy.types.Scene.mi_settings = PointerProperty( name="Global Settings", type=mi_settings.MI_Settings, description="Global Settings." ) 94 | bpy.types.Scene.mi_cur_stretch_settings = PointerProperty( name="Curve Stretch Settings", type=mi_curve_stretch.MI_CurveStretchSettings, description="Curve Stretch Settings." ) 95 | bpy.types.Scene.mi_cur_surfs_settings = PointerProperty( name="Curve Surfaces Settings", type=mi_curve_surfaces.MI_CurveSurfacesSettings, description="Curve Surfaces Settings." ) 96 | bpy.types.Scene.mi_extrude_settings = PointerProperty( name="Extrude Variables", type=mi_draw_extrude.MI_ExtrudeSettings, description="Extrude Settings" ) 97 | bpy.types.Scene.mi_ldeformer_settings = PointerProperty( name="Linear Deformer Variables", type=mi_linear_deformer.MI_LDeformer_Settings, description="Linear Deformer Settings" ) 98 | bpy.types.Scene.mi_curguide_settings = PointerProperty( name="Curve Guide Variables", type=mi_curve_guide.MI_CurGuide_Settings, description="Curve Guide Settings" ) 99 | bpy.types.Scene.mi_makearc_settings = PointerProperty( name="Make Arc Variables", type=mi_make_arc.MI_MakeArc_Settings, description="Make Arc Settings" ) 100 | #bpy.types.Scene.mi_unbevel_settings = PointerProperty( name="Unbevel Settings", type=mi_unbevel.MI_Unbevel_Settings, description="Unbevel Settings" ) 101 | 102 | # alternative gui 103 | bpy.types.WindowManager.mirawindow = bpy.props.PointerProperty(type = mi_gui.DropdownMiraToolProps) 104 | bpy.types.VIEW3D_MT_mesh_add.prepend(mi_gui.mifth_prim_menu) 105 | 106 | 107 | # bpy.types.VIEW3D_PT_tools_curveedit.append(mi_linear_deformer_curve.linear_deform_button) 108 | 109 | def unregister(): 110 | 111 | #del bpy.types.Scene.miraTool 112 | #del bpy.types.Object.mi_curves # need to investigate if i need to delete it 113 | del bpy.types.Scene.mi_settings 114 | del bpy.types.Scene.mi_cur_stretch_settings 115 | del bpy.types.Scene.mi_cur_surfs_settings 116 | del bpy.types.Scene.mi_extrude_settings 117 | del bpy.types.Scene.mi_ldeformer_settings 118 | del bpy.types.Scene.mi_curguide_settings 119 | del bpy.types.Scene.mi_makearc_settings 120 | 121 | del bpy.types.WindowManager.mirawindow 122 | bpy.types.VIEW3D_MT_mesh_add.remove(mi_gui.mifth_prim_menu) 123 | 124 | # bpy.types.VIEW3D_PT_tools_curveedit.remove(mi_linear_deformer_curve.linear_deform_button) 125 | try: 126 | auto_load.unregister() 127 | except: 128 | traceback.print_exc() 129 | 130 | if __name__ == "__main__": 131 | register() 132 | -------------------------------------------------------------------------------- /blender/addons/2.8/mira_tools/add_mesh_capsule.py: -------------------------------------------------------------------------------- 1 | import bpy 2 | from bpy.types import Operator 3 | from bpy.props import FloatProperty 4 | from bpy.props import IntProperty 5 | from bpy_extras.object_utils import object_data_add 6 | from mathutils import Vector 7 | from math import cos 8 | from math import degrees 9 | from math import radians 10 | from math import sin 11 | 12 | # "The author is David Ludwig. The code was taken from here https://www.youtube.com/watch?v=O-Yhxhjx_VY " 13 | 14 | def add_capsule(length, radius, rings, segments, context): 15 | 16 | topRings = [] 17 | bottomRings = [] 18 | topCap = [] 19 | bottomCap = [] 20 | 21 | vertId = 0 22 | 23 | for j in range(0, rings + 1): 24 | 25 | if j == rings: 26 | 27 | topVertex = Vector((0, 0, ((length / 2) + radius))) 28 | bottomVertex = Vector((0, 0, -((length / 2) + radius))) 29 | 30 | topCap.append(topVertex) 31 | bottomCap.append(bottomVertex) 32 | else: 33 | 34 | heightAngle = radians((90 / rings) * (j + 1)) 35 | 36 | topRing = [] 37 | bottomRing = [] 38 | 39 | for i in range(0, segments): 40 | 41 | zAngle = radians((360 / segments) * i) 42 | 43 | x = radius * cos(zAngle) * sin(heightAngle) 44 | y = radius * sin(zAngle) * sin(heightAngle) 45 | z = radius * cos(heightAngle) 46 | 47 | topVertex = Vector((x, y, z + (length / 2))) 48 | bottomVertex = Vector((x, y, -(z + (length / 2)))) 49 | 50 | topRing.append(vertId) 51 | bottomRing.append(vertId + ((rings * segments) + 1)) 52 | topCap.append(topVertex) 53 | bottomCap.append(bottomVertex) 54 | 55 | vertId += 1 56 | 57 | topRings.append(topRing) 58 | bottomRings.append(bottomRing) 59 | 60 | verts = topCap + bottomCap 61 | 62 | faces = [] 63 | 64 | ringIndex = len(topRings) - 1 65 | while ringIndex > 0: 66 | 67 | topRing = topRings[ringIndex] 68 | topNextRing = topRings[ringIndex - 1] 69 | 70 | bottomRing = bottomRings[ringIndex] 71 | bottomNextRing = bottomRings[ringIndex - 1] 72 | 73 | for i in range(0, segments): 74 | 75 | index1 = i 76 | index2 = 0 if i + 1 == segments else i + 1 77 | 78 | topCapFace = [topRing[index1], topRing[index2], topNextRing[index2], topNextRing[index1]] 79 | bottomCapFace = [bottomRing[index2], bottomRing[index1], bottomNextRing[index1], bottomNextRing[index2]] 80 | faces.append(topCapFace) 81 | faces.append(bottomCapFace) 82 | 83 | ringIndex -= 1 84 | 85 | topRing = topRings[rings - 1] 86 | bottomRing = bottomRings[rings - 1] 87 | 88 | topCapRing = topRings[0] 89 | bottomCapRing = bottomRings[0] 90 | 91 | topCapFaces = [] 92 | bottomCapFaces = [] 93 | 94 | for i in range(0, segments): 95 | 96 | index1 = i 97 | index2 = 0 if i + 1 == segments else i + 1 98 | 99 | bodyFace = [topRing[index2], topRing[index1], bottomRing[index1], bottomRing[index2]] 100 | topCapFace = [topCapRing[index1], topCapRing[index2], rings * segments] 101 | bottomCapFace = [bottomCapRing[index2], bottomCapRing[index1], ((rings * segments) * 2) + 1] 102 | 103 | faces.append(bodyFace) 104 | topCapFaces.append(topCapFace) 105 | bottomCapFaces.append(bottomCapFace) 106 | 107 | faces += topCapFaces + bottomCapFaces 108 | 109 | mesh = bpy.data.meshes.new(name="Capsule") 110 | mesh.from_pydata(verts, [], faces) 111 | mesh.update() 112 | 113 | return object_data_add(context, mesh, operator=None) 114 | -------------------------------------------------------------------------------- /blender/addons/2.8/mira_tools/auto_load.py: -------------------------------------------------------------------------------- 1 | # import os 2 | import bpy 3 | # import sys 4 | import typing 5 | import inspect 6 | import pkgutil 7 | import importlib 8 | from pathlib import Path 9 | 10 | __all__ = ( 11 | "init", 12 | "register", 13 | "unregister", 14 | ) 15 | 16 | modules = None 17 | ordered_classes = None 18 | 19 | def init(): 20 | global modules 21 | global ordered_classes 22 | 23 | modules = get_all_submodules(Path(__file__).parent) 24 | ordered_classes = get_ordered_classes_to_register(modules) 25 | 26 | def register(): 27 | for cls in ordered_classes: 28 | bpy.utils.register_class(cls) 29 | 30 | for module in modules: 31 | if module.__name__ == __name__: 32 | continue 33 | if hasattr(module, "register"): 34 | module.register() 35 | 36 | def unregister(): 37 | for cls in reversed(ordered_classes): 38 | bpy.utils.unregister_class(cls) 39 | 40 | for module in modules: 41 | if module.__name__ == __name__: 42 | continue 43 | if hasattr(module, "unregister"): 44 | module.unregister() 45 | 46 | 47 | # Import modules 48 | ################################################# 49 | 50 | def get_all_submodules(directory): 51 | return list(iter_submodules(directory, directory.name)) 52 | 53 | def iter_submodules(path, package_name): 54 | for name in sorted(iter_submodule_names(path)): 55 | yield importlib.import_module("." + name, package_name) 56 | 57 | def iter_submodule_names(path, root=""): 58 | for _, module_name, is_package in pkgutil.iter_modules([str(path)]): 59 | if is_package: 60 | sub_path = path / module_name 61 | sub_root = root + module_name + "." 62 | yield from iter_submodule_names(sub_path, sub_root) 63 | else: 64 | yield root + module_name 65 | 66 | 67 | # Find classes to register 68 | ################################################# 69 | 70 | def get_ordered_classes_to_register(modules): 71 | return toposort(get_register_deps_dict(modules)) 72 | 73 | def get_register_deps_dict(modules): 74 | deps_dict = {} 75 | classes_to_register = set(iter_classes_to_register(modules)) 76 | for cls in classes_to_register: 77 | deps_dict[cls] = set(iter_own_register_deps(cls, classes_to_register)) 78 | return deps_dict 79 | 80 | def iter_own_register_deps(cls, own_classes): 81 | yield from (dep for dep in iter_register_deps(cls) if dep in own_classes) 82 | 83 | if getattr(cls, "bl_parent_id", None): 84 | for other_cls in own_classes: 85 | if other_cls.__name__ == cls.bl_parent_id: 86 | yield other_cls 87 | 88 | def iter_register_deps(cls): 89 | for value in typing.get_type_hints(cls, {}, {}).values(): 90 | dependency = get_dependency_from_annotation(value) 91 | if dependency is not None: 92 | yield dependency 93 | 94 | def get_dependency_from_annotation(value): 95 | if isinstance(value, tuple) and len(value) == 2: 96 | if value[0] in (bpy.props.PointerProperty, bpy.props.CollectionProperty): 97 | return value[1]["type"] 98 | return None 99 | 100 | def iter_classes_to_register(modules): 101 | base_types = get_register_base_types() 102 | for cls in get_classes_in_modules(modules): 103 | if any(base in base_types for base in cls.__bases__): 104 | if not getattr(cls, "is_registered", False): 105 | yield cls 106 | 107 | def get_classes_in_modules(modules): 108 | classes = set() 109 | for module in modules: 110 | for cls in iter_classes_in_module(module): 111 | classes.add(cls) 112 | return classes 113 | 114 | def iter_classes_in_module(module): 115 | for value in module.__dict__.values(): 116 | if inspect.isclass(value): 117 | yield value 118 | 119 | def get_register_base_types(): 120 | return set(getattr(bpy.types, name) for name in [ 121 | "Panel", "Operator", "PropertyGroup", 122 | "AddonPreferences", "Header", "Menu", 123 | "Node", "NodeSocket", "NodeTree", 124 | "UIList", "RenderEngine" 125 | ]) 126 | 127 | 128 | # Find order to register to solve dependencies 129 | ################################################# 130 | 131 | def toposort(deps_dict): 132 | sorted_list = [] 133 | sorted_values = set() 134 | while len(deps_dict) > 0: 135 | unsorted = [] 136 | for value, deps in deps_dict.items(): 137 | if len(deps) == 0: 138 | sorted_list.append(value) 139 | sorted_values.add(value) 140 | else: 141 | unsorted.append(value) 142 | deps_dict = {value : deps_dict[value] - sorted_values for value in unsorted} 143 | return sorted_list 144 | -------------------------------------------------------------------------------- /blender/addons/2.8/mira_tools/mi_color_manager.py: -------------------------------------------------------------------------------- 1 | # ***** BEGIN GPL LICENSE BLOCK ***** 2 | # 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software Foundation, 16 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | # 18 | # ***** END GPL LICENCE BLOCK ***** 19 | 20 | # import bpy 21 | # import bgl 22 | # import blf 23 | 24 | from bpy.props import * 25 | # import math 26 | # import mathutils as mathu 27 | # import random 28 | # from mathutils import Vector 29 | 30 | 31 | # Curve Colors 32 | cur_point_base = (0.5, 0.8, 1.0, 1.0) 33 | cur_point_selected = (0.9, 0.5, 0.1, 1.0) 34 | cur_point_active = (0.9, 0.7, 0.3, 1.0) 35 | 36 | cur_point_closed_start = (0.7, 0.4, 0.9, 1.0) 37 | cur_point_closed_end = (0.3, 0.4, 0.9, 1.0) 38 | 39 | cur_line_base = (0.5, 0.8, 0.9, 1.0) 40 | 41 | cur_handle_1_base = (0.0, 0.5, 1.0, 1.0) 42 | cur_handle_2_base = (1.0, 0.5, 0.0, 1.0) 43 | 44 | 45 | # Draw Extrude Colors 46 | dre_point_base = (0.5, 0.8, 1.0, 1.0) 47 | 48 | # PolyLoop colors 49 | pl_point_col = (0.95, 0.7, 1.0, 1.0) -------------------------------------------------------------------------------- /blender/addons/2.8/mira_tools/mi_inputs.py: -------------------------------------------------------------------------------- 1 | 2 | # ***** BEGIN GPL LICENSE BLOCK ***** 3 | # 4 | # 5 | # This program is free software; you can redistribute it and/or 6 | # modify it under the terms of the GNU General Public License 7 | # as published by the Free Software Foundation; either version 2 8 | # of the License, or (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License 16 | # along with this program; if not, write to the Free Software Foundation, 17 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 18 | # 19 | # ***** END GPL LICENCE BLOCK ***** 20 | 21 | # import bpy 22 | 23 | 24 | pass_keys = {'NUMPAD_0', 'NUMPAD_1', 'NUMPAD_3', 'NUMPAD_4', 25 | 'NUMPAD_5', 'NUMPAD_6', 'NUMPAD_7', 'NUMPAD_8', 26 | 'NUMPAD_9', 'MIDDLEMOUSE', 'WHEELUPMOUSE', 'WHEELDOWNMOUSE', 27 | 'MOUSEMOVE', 'INBETWEEN_MOUSEMOVE', 'TRACKPADPAN', 'TRACKPADZOOM'} 28 | 29 | 30 | def get_input_pass(pass_keys, key_inputs, event): 31 | if event.type in pass_keys: 32 | return True 33 | 34 | if key_inputs == 'Maya': 35 | if event.type in {'RIGHTMOUSE', 'LEFTMOUSE'} and event.alt and not event.shift and not event.ctrl: 36 | return True 37 | 38 | return False 39 | -------------------------------------------------------------------------------- /blender/addons/2.8/mira_tools/mi_linear_widget.py: -------------------------------------------------------------------------------- 1 | # ***** BEGIN GPL LICENSE BLOCK ***** 2 | # 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software Foundation, 16 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | # 18 | # ***** END GPL LICENCE BLOCK ***** 19 | 20 | 21 | import gpu 22 | from gpu_extras.batch import batch_for_shader 23 | 24 | from bpy.props import * 25 | 26 | from bpy_extras import view3d_utils 27 | 28 | import mathutils as mathu 29 | from mathutils import Vector 30 | 31 | from . import mi_utils_base as ut_base 32 | 33 | 34 | shader3d = gpu.shader.from_builtin('UNIFORM_COLOR') 35 | shader2d = gpu.shader.from_builtin('UNIFORM_COLOR') 36 | 37 | 38 | class MI_LW_Point(): 39 | 40 | # class constructor 41 | def __init__(self, position): 42 | self.position = position 43 | 44 | 45 | class MI_Linear_Widget(): 46 | 47 | # class constructor 48 | def __init__(self): 49 | self.start_point = None 50 | self.middle_point = None 51 | self.end_point = None 52 | 53 | 54 | def update_middle_point(lw_tool): 55 | lw_dir = (lw_tool.end_point.position - lw_tool.start_point.position) 56 | lw_len = (lw_dir).length 57 | lw_dir = lw_dir.normalized() 58 | 59 | lw_tool.middle_point.position = lw_tool.start_point.position + (lw_dir * (lw_len / 2.0)) 60 | 61 | 62 | def get_tool_verts(lw_tool, verts_ids, bm, obj, do_clamp, local_coords): 63 | apply_tool_verts = [] 64 | final_dir = ( lw_tool.end_point.position - lw_tool.start_point.position ) 65 | max_dist = final_dir.length 66 | for vert_id in verts_ids: 67 | v_pos = obj.matrix_world @ bm.verts[vert_id].co 68 | value = mathu.geometry.distance_point_to_plane(v_pos, lw_tool.start_point.position, final_dir) 69 | if value > 0: 70 | if value > max_dist and do_clamp: 71 | value = 1.0 72 | else: 73 | value /= max_dist 74 | 75 | pos_final = v_pos 76 | if local_coords is True: 77 | pos_final = bm.verts[vert_id].co.copy() 78 | 79 | apply_tool_verts.append( (vert_id, value, pos_final) ) 80 | 81 | return apply_tool_verts 82 | 83 | 84 | def draw_lw(context, lw, cross_up_dir, draw_faloff): 85 | region = context.region 86 | rv3d = context.region_data 87 | addon_prefs = context.preferences.addons[__package__].preferences 88 | 89 | start_2d = view3d_utils.location_3d_to_region_2d(region, rv3d, lw.start_point.position) 90 | end_2d = view3d_utils.location_3d_to_region_2d(region, rv3d, lw.end_point.position) 91 | middle_2d = view3d_utils.location_3d_to_region_2d(region, rv3d, lw.middle_point.position) 92 | 93 | dist_ends = ((lw.start_point.position - lw.end_point.position).length * 0.1) * cross_up_dir 94 | end_p1 = view3d_utils.location_3d_to_region_2d(region, rv3d, lw.end_point.position + dist_ends) 95 | end_p2 = view3d_utils.location_3d_to_region_2d(region, rv3d, lw.end_point.position - dist_ends) 96 | 97 | if start_2d and end_2d and end_p1 and end_p2: 98 | gpu.state.line_width_set(addon_prefs.line_size) 99 | gpu.state.point_size_set(addon_prefs.point_size) 100 | 101 | coords = ((start_2d[0], start_2d[1]), (end_2d[0], end_2d[1])) 102 | batch = batch_for_shader(shader2d, 'LINE_STRIP', {"pos": coords}) 103 | shader2d.bind() 104 | shader2d.uniform_float("color", (0.99, 0.5, 0.99, 1.0)) 105 | batch.draw(shader2d) 106 | 107 | 108 | if draw_faloff: 109 | coords = ((start_2d[0], start_2d[1]), (end_p1[0], end_p1[1]), (end_p2[0], end_p2[1])) 110 | batch = batch_for_shader(shader2d, 'LINE_LOOP', {"pos": coords}) 111 | shader2d.bind() 112 | shader2d.uniform_float("color", (0.99, 0.5, 0.99, 1.0)) 113 | batch.draw(shader2d) 114 | 115 | coords = ((start_2d[0], start_2d[1]), (middle_2d[0], middle_2d[1]), (end_2d[0], end_2d[1])) 116 | batch = batch_for_shader(shader2d, 'POINTS', {"pos": coords}) 117 | shader2d.bind() 118 | shader2d.uniform_float("color", (0.99, 0.8, 0.5, 1.0)) 119 | batch.draw(shader2d) 120 | 121 | 122 | def pick_lw_point(context, m_coords, lw): 123 | region = context.region 124 | rv3d = context.region_data 125 | addon_prefs = context.preferences.addons[__package__].preferences 126 | 127 | return_point = None 128 | good_distance = None 129 | 130 | mouse_coords = Vector(m_coords) 131 | 132 | lw_points = [lw.start_point, lw.middle_point, lw.end_point] 133 | for lw_point in lw_points: 134 | vec_2d = view3d_utils.location_3d_to_region_2d(region, rv3d, lw_point.position) 135 | dist = (vec_2d - mouse_coords).length 136 | if dist <= addon_prefs.select_point_radius: 137 | if not return_point: 138 | return_point = lw_point 139 | good_distance = dist 140 | elif good_distance > dist: 141 | return_point = lw_point 142 | good_distance = dist 143 | 144 | return return_point 145 | 146 | 147 | def setup_lw_tool(rv3d, lw_tool, active_obj, verts, center_type, scale_size): 148 | # Types 149 | # 'Auto', 'X', 'X_Left', 'X_Right', 'Z', 'Z_Top', 'Z_Bottom' 150 | 151 | # get verts bounds 152 | cam_x = (rv3d.view_rotation @ Vector((1.0, 0.0, 0.0))).normalized() 153 | cam_y = (rv3d.view_rotation @ Vector((0.0, 1.0, 0.0))).normalized() 154 | #cam_z = (rv3d.view_rotation @ Vector((0.0, 0.0, -1.0))).normalized() # Camera Direction 155 | bounds = ut_base.get_verts_bounds(verts, active_obj, cam_x, cam_y, None, False) 156 | 157 | # set middle_point 158 | middle_p = None 159 | if center_type in {'Auto', 'X', 'Z'}: 160 | middle_p = bounds[3] 161 | elif center_type == 'X_Left': 162 | middle_p = bounds[3] + (cam_y * (bounds[1] / 2.0)) 163 | elif center_type == 'X_Right': 164 | middle_p = bounds[3] - (cam_y * (bounds[1] / 2.0)) 165 | elif center_type == 'Z_Top': 166 | middle_p = bounds[3] - (cam_x * (bounds[0] / 2.0)) 167 | elif center_type == 'Z_Bottom': 168 | middle_p = bounds[3] + (cam_x * (bounds[0] / 2.0)) 169 | 170 | # set lw_tool points 171 | start_p = None 172 | end_p = None 173 | if center_type == 'Auto': 174 | if bounds[0] > bounds[1]: 175 | # scale_size is additive value so that to get points on the top and on the left 176 | start_p = middle_p - (cam_x * (bounds[0] / 2.0) * scale_size) 177 | end_p = middle_p + (cam_x * (bounds[0] / 2.0) * scale_size) 178 | else: 179 | start_p = middle_p - (cam_y * (bounds[1] / 2.0) * scale_size) 180 | end_p = middle_p + (cam_y * (bounds[1] / 2.0) * scale_size) 181 | elif center_type in {'X', 'X_Left', 'X_Right'}: 182 | # scale_size is additive value so that to get points on the top and on the left 183 | start_p = middle_p - (cam_x * (bounds[0] / 2.0) * scale_size) 184 | end_p = middle_p + (cam_x * (bounds[0] / 2.0) * scale_size) 185 | elif center_type in {'Z', 'Z_Top', 'Z_Bottom'}: 186 | # scale_size is additive value so that to get points on the top and on the left 187 | start_p = middle_p - (cam_y * (bounds[1] / 2.0) * scale_size) 188 | end_p = middle_p + (cam_y * (bounds[1] / 2.0) * scale_size) 189 | 190 | lw_tool.start_point = MI_LW_Point(start_p) 191 | lw_tool.middle_point = MI_LW_Point(middle_p) 192 | lw_tool.end_point = MI_LW_Point(end_p) 193 | -------------------------------------------------------------------------------- /blender/addons/2.8/mira_tools/mi_looptools.py: -------------------------------------------------------------------------------- 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 | 19 | # import bmesh 20 | # import bpy 21 | # import collections 22 | # import mathutils 23 | # import math 24 | # from bpy_extras import view3d_utils 25 | 26 | # THIS CODE IS TAKEN FROM BLENDER LOOPTOOLS ADDON. Thanks a lot to Bart Crouch. 27 | 28 | ########################################## 29 | ####### General functions ################ 30 | ########################################## 31 | 32 | 33 | # check loops and only return valid ones 34 | # method is modified 35 | def check_loops(loops, bm_mod): 36 | valid_loops = [] 37 | for loop, circular in loops: 38 | # loop needs to have at least 3 vertices 39 | if len(loop) < 3: 40 | continue 41 | ## loop needs at least 1 vertex in the original, non-mirrored mesh 42 | #if mapping: 43 | #all_virtual = True 44 | #for vert in loop: 45 | #if mapping[vert] > -1: 46 | #all_virtual = False 47 | #break 48 | #if all_virtual: 49 | #continue 50 | # vertices can not all be at the same location 51 | stacked = True 52 | for i in range(len(loop) - 1): 53 | if (bm_mod.verts[loop[i]].co - \ 54 | bm_mod.verts[loop[i+1]].co).length > 1e-6: 55 | stacked = False 56 | break 57 | if stacked: 58 | continue 59 | # passed all tests, loop is valid 60 | valid_loops.append([loop, circular]) 61 | 62 | return(valid_loops) 63 | 64 | 65 | # input: bmesh, output: dict with the edge-key as key and face-index as value 66 | def dict_edge_faces(bm): 67 | edge_faces = dict([[edgekey(edge), []] for edge in bm.edges if \ 68 | not edge.hide]) 69 | for face in bm.faces: 70 | if face.hide: 71 | continue 72 | for key in face_edgekeys(face): 73 | edge_faces[key].append(face.index) 74 | 75 | return(edge_faces) 76 | 77 | 78 | # input: bmesh (edge-faces optional), output: dict with face-face connections 79 | def dict_face_faces(bm, edge_faces=False): 80 | if not edge_faces: 81 | edge_faces = dict_edge_faces(bm) 82 | 83 | connected_faces = dict([[face.index, []] for face in bm.faces if \ 84 | not face.hide]) 85 | for face in bm.faces: 86 | if face.hide: 87 | continue 88 | for edge_key in face_edgekeys(face): 89 | for connected_face in edge_faces[edge_key]: 90 | if connected_face == face.index: 91 | continue 92 | connected_faces[face.index].append(connected_face) 93 | 94 | return(connected_faces) 95 | 96 | 97 | # input: bmesh, output: dict with the vert index as key and edge-keys as value 98 | def dict_vert_edges(bm): 99 | vert_edges = dict([[v.index, []] for v in bm.verts if not v.hide]) 100 | for edge in bm.edges: 101 | if edge.hide: 102 | continue 103 | ek = edgekey(edge) 104 | for vert in ek: 105 | vert_edges[vert].append(ek) 106 | 107 | return(vert_edges) 108 | 109 | 110 | # input: bmesh, output: dict with the vert index as key and face index as value 111 | def dict_vert_faces(bm): 112 | vert_faces = dict([[v.index, []] for v in bm.verts if not v.hide]) 113 | for face in bm.faces: 114 | if not face.hide: 115 | for vert in face.verts: 116 | vert_faces[vert.index].append(face.index) 117 | 118 | return(vert_faces) 119 | 120 | 121 | # input: list of edge-keys, output: dictionary with vertex-vertex connections 122 | def dict_vert_verts(edge_keys): 123 | # create connection data 124 | vert_verts = {} 125 | for ek in edge_keys: 126 | for i in range(2): 127 | if ek[i] in vert_verts: 128 | vert_verts[ek[i]].append(ek[1-i]) 129 | else: 130 | vert_verts[ek[i]] = [ek[1-i]] 131 | 132 | return(vert_verts) 133 | 134 | 135 | # return the edgekey ([v1.index, v2.index]) of a bmesh edge 136 | def edgekey(edge): 137 | return(tuple(sorted([edge.verts[0].index, edge.verts[1].index]))) 138 | 139 | 140 | # returns the edgekeys of a bmesh face 141 | def face_edgekeys(face): 142 | return([tuple(sorted([edge.verts[0].index, edge.verts[1].index])) for \ 143 | edge in face.edges]) 144 | 145 | 146 | # calculate input loops 147 | # method is modified 148 | def get_connected_input(bm): 149 | # calculate selected loops 150 | edge_keys = [edgekey(edge) for edge in bm.edges if \ 151 | edge.select and not edge.hide] 152 | loops = get_connected_selections(edge_keys) 153 | 154 | return(loops) 155 | 156 | 157 | # sorts all edge-keys into a list of loops 158 | def get_connected_selections(edge_keys): 159 | # create connection data 160 | vert_verts = dict_vert_verts(edge_keys) 161 | 162 | # find loops consisting of connected selected edges 163 | loops = [] 164 | while len(vert_verts) > 0: 165 | loop = [iter(vert_verts.keys()).__next__()] 166 | growing = True 167 | flipped = False 168 | 169 | # extend loop 170 | while growing: 171 | # no more connection data for current vertex 172 | if loop[-1] not in vert_verts: 173 | if not flipped: 174 | loop.reverse() 175 | flipped = True 176 | else: 177 | growing = False 178 | else: 179 | extended = False 180 | for i, next_vert in enumerate(vert_verts[loop[-1]]): 181 | if next_vert not in loop: 182 | vert_verts[loop[-1]].pop(i) 183 | if len(vert_verts[loop[-1]]) == 0: 184 | del vert_verts[loop[-1]] 185 | # remove connection both ways 186 | if next_vert in vert_verts: 187 | if len(vert_verts[next_vert]) == 1: 188 | del vert_verts[next_vert] 189 | else: 190 | vert_verts[next_vert].remove(loop[-1]) 191 | loop.append(next_vert) 192 | extended = True 193 | break 194 | if not extended: 195 | # found one end of the loop, continue with next 196 | if not flipped: 197 | loop.reverse() 198 | flipped = True 199 | # found both ends of the loop, stop growing 200 | else: 201 | growing = False 202 | 203 | # check if loop is circular 204 | if loop[0] in vert_verts: 205 | if loop[-1] in vert_verts[loop[0]]: 206 | # is circular 207 | if len(vert_verts[loop[0]]) == 1: 208 | del vert_verts[loop[0]] 209 | else: 210 | vert_verts[loop[0]].remove(loop[-1]) 211 | if len(vert_verts[loop[-1]]) == 1: 212 | del vert_verts[loop[-1]] 213 | else: 214 | vert_verts[loop[-1]].remove(loop[0]) 215 | loop = [loop, True] 216 | else: 217 | # not circular 218 | loop = [loop, False] 219 | else: 220 | # not circular 221 | loop = [loop, False] 222 | 223 | loops.append(loop) 224 | 225 | return(loops) 226 | 227 | -------------------------------------------------------------------------------- /blender/addons/2.8/mira_tools/mi_noise.py: -------------------------------------------------------------------------------- 1 | # ***** BEGIN GPL LICENSE BLOCK ***** 2 | # 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software Foundation, 16 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | # 18 | # ***** END GPL LICENCE BLOCK ***** 19 | 20 | import bpy 21 | # import bgl 22 | import blf 23 | import string 24 | import bmesh 25 | 26 | from bpy.props import * 27 | from bpy.types import Operator, AddonPreferences 28 | 29 | from bpy_extras import view3d_utils 30 | 31 | import math 32 | import mathutils as mathu 33 | import random 34 | from mathutils import Vector 35 | 36 | from . import mi_utils_base as ut_base 37 | 38 | 39 | class MI_OT_Noise(bpy.types.Operator): 40 | bl_idname = "mira.noise" 41 | bl_label = "Noise" 42 | bl_description = "Noise" 43 | bl_options = {'REGISTER', 'UNDO'} 44 | 45 | noise_type: EnumProperty( 46 | items=(('Turbulence', 'Turbulence', ''), 47 | ('Fractal', 'Fractal', ''), 48 | ('HeteroTerrain', 'HeteroTerrain', ''), 49 | ), 50 | default = 'Turbulence' 51 | ) 52 | 53 | frequency: FloatProperty(default=1.0, soft_min=0) 54 | intensity: FloatProperty(default=1.0, soft_min=0) 55 | offset_x: FloatProperty(default=0.0) 56 | offset_y: FloatProperty(default=0.0) 57 | offset_z: FloatProperty(default=0.0) 58 | octaves: IntProperty(default=2) 59 | amplitude_scale: FloatProperty(default=0.5, soft_min=0) 60 | frequency_scale: FloatProperty(default=2.0, soft_min=0) 61 | hard: BoolProperty(default=True) 62 | 63 | 64 | def execute(self, context): 65 | 66 | obj = context.active_object 67 | noise_obj(obj, context, self) 68 | 69 | return {'FINISHED'} 70 | 71 | def invoke(self, context, event): 72 | # if context.area.type == 'VIEW_3D': 73 | # change startup 74 | # self.select_mouse_mode = context.preferences.inputs.select_mouse 75 | # context.preferences.inputs.select_mouse = 'RIGHT' 76 | 77 | return self.execute(context) 78 | # else: 79 | # self.report({'WARNING'}, "View3D not found, cannot run operator") 80 | # return {'CANCELLED'} 81 | 82 | 83 | def noise_obj(obj, context, self): 84 | bm = bmesh.from_edit_mesh(obj.data) 85 | verts = [v for v in bm.verts if v.select] 86 | if not verts: 87 | verts = [v for v in bm.verts if v.hide is False] 88 | 89 | for vert in verts: 90 | noise_pos = self.frequency * vert.co.copy() 91 | noise_pos.x += self.offset_x 92 | noise_pos.z += self.offset_y 93 | noise_pos.z += self.offset_z 94 | 95 | noise_val = None 96 | if self.noise_type == 'Turbulence': 97 | noise_val = mathu.noise.turbulence(noise_pos, self.octaves, self.hard, noise_basis="PERLIN_ORIGINAL", amplitude_scale=self.amplitude_scale, frequency_scale=self.frequency_scale) 98 | elif self.noise_type == 'Fractal': 99 | noise_val = mathu.noise.fractal(noise_pos, self.amplitude_scale, self.frequency_scale, self.octaves, noise_basis="PERLIN_ORIGINAL") 100 | else: 101 | noise_val = mathu.noise.hetero_terrain(noise_pos, self.amplitude_scale, self.frequency_scale, self.octaves, 0, noise_basis="PERLIN_ORIGINAL") 102 | 103 | vert_offset = vert.normal.copy().normalized() * noise_val 104 | vert.co += vert_offset * self.intensity 105 | 106 | bm.normal_update() 107 | bmesh.update_edit_mesh(obj.data) 108 | -------------------------------------------------------------------------------- /blender/addons/2.8/mira_tools/mi_retopo_loops.py: -------------------------------------------------------------------------------- 1 | # ***** BEGIN GPL LICENSE BLOCK ***** 2 | # 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software Foundation, 16 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | # 18 | # ***** END GPL LICENCE BLOCK ***** 19 | 20 | import bpy 21 | import bmesh 22 | 23 | from bpy.props import * 24 | from bpy.types import Operator, AddonPreferences 25 | 26 | import math 27 | import mathutils as mathu 28 | import random 29 | from mathutils import Vector, Matrix 30 | 31 | from . import mi_utils_base as ut_base 32 | 33 | class MI_OT_Wrap_Object(bpy.types.Operator): 34 | bl_idname = "mira.retopo_loops" 35 | bl_label = "Retopo Loops" 36 | bl_description = "Retopo Loops" 37 | bl_options = {'REGISTER', 'UNDO'} 38 | 39 | retpo_mode: EnumProperty( 40 | items=(('Normal', 'Normal', ''), 41 | ('Generic', 'Generic', '') 42 | ), 43 | default='Generic' 44 | ) 45 | 46 | #reset_values: BoolProperty(default=False) 47 | cuts_number: bpy.props.IntProperty(name="Cuts Number", description="Cuts Number for Generic Mode", default=10, min=2) 48 | verts_number: bpy.props.IntProperty(name="Verts Number", description="Verts Number for Cuts", default=8, min=3) 49 | rotate_loops: bpy.props.IntProperty(name="Rotate Loops", description="Cuts Number for Generic Mode", default=0, min=-360, max=360) 50 | 51 | 52 | def execute(self, context): 53 | # check issues 54 | if not context.selected_objects: 55 | self.report({'WARNING'}, "Please, Select Circle Objects for Loops and Add Some Hipoly Objects!") 56 | return {'CANCELLED'} 57 | elif len(context.selected_objects) == 1: 58 | self.report({'WARNING'}, "Please, Select 2 Circle Objects At Least!") 59 | return {'CANCELLED'} 60 | 61 | sel_objs = context.selected_objects.copy() 62 | curve_settings = context.scene.mi_settings 63 | 64 | # get meshes for snapping 65 | if sel_objs: 66 | for obj in sel_objs: 67 | obj.hide_viewport = True 68 | 69 | meshes_array = ut_base.get_obj_dup_meshes(None, curve_settings.convert_instances, context) 70 | 71 | for obj in sel_objs: 72 | obj.hide_viewport = False 73 | 74 | # check issues 75 | if not meshes_array: 76 | self.report({'WARNING'}, "Please, Select Circle Objects for Loops and Add Some Hipoly Objects!") 77 | return {'CANCELLED'} 78 | 79 | generic_sel_objs = [] 80 | 81 | if self.retpo_mode == 'Generic': 82 | distances = [] 83 | max_dist = 0 84 | 85 | # get distances 86 | for idx, obj in enumerate(sel_objs): 87 | if idx == 0: 88 | distances.append(0) 89 | else: 90 | dist = (obj.location - sel_objs[idx - 1].location).length 91 | max_dist += dist 92 | distances.append(max_dist) 93 | 94 | # create new generic objects 95 | for obj_count in range(self.cuts_number): 96 | count_length = (obj_count/(self.cuts_number - 1)) * max_dist 97 | 98 | obj_count_pos = None 99 | obj_count_rot = None 100 | obj_count_scale = None 101 | 102 | if obj_count == 0: 103 | obj_count_pos = sel_objs[0].location.copy() 104 | obj_count_rot = sel_objs[0].rotation_euler.copy() 105 | obj_count_scale = sel_objs[0].scale.copy() 106 | 107 | elif obj_count == self.cuts_number - 1: 108 | obj_count_pos = sel_objs[-1].location.copy() 109 | obj_count_rot = sel_objs[-1].rotation_euler.copy() 110 | obj_count_scale = sel_objs[-1].scale.copy() 111 | 112 | else: 113 | for idx, dist in enumerate(distances): 114 | if dist > count_length: 115 | obj1 = sel_objs[idx] 116 | obj2 = sel_objs[idx - 1] 117 | count_length_2 = (count_length - distances[idx-1]) / (dist - distances[idx-1]) 118 | 119 | obj_count_pos = obj2.location.lerp(obj1.location, count_length_2) 120 | obj_count_rot = Vector(obj2.rotation_euler).lerp(Vector(obj1.rotation_euler), count_length_2) 121 | obj_count_scale = obj2.scale.lerp(obj1.scale, count_length_2) 122 | break 123 | 124 | bpy.ops.object.select_all(action='DESELECT') 125 | sel_objs[0].select_set(True) 126 | 127 | # create new prims 128 | bpy.ops.mesh.primitive_circle_add(vertices=self.verts_number, radius=1.0, enter_editmode=False) 129 | new_gen_obj = context.active_object 130 | new_gen_obj.location = obj_count_pos 131 | new_gen_obj.rotation_euler = obj_count_rot 132 | new_gen_obj.scale = obj_count_scale 133 | generic_sel_objs.append(new_gen_obj) 134 | 135 | # create new prims 136 | else: 137 | for obj in sel_objs: 138 | bpy.ops.object.select_all(action='DESELECT') 139 | bpy.ops.mesh.primitive_circle_add(vertices=self.verts_number, radius=1.0, enter_editmode=False) 140 | new_gen_obj = context.active_object 141 | new_gen_obj.location = obj.location.copy() 142 | new_gen_obj.rotation_euler = obj.rotation_euler.copy() 143 | new_gen_obj.scale = obj.scale.copy() 144 | generic_sel_objs.append(new_gen_obj) 145 | 146 | if self.rotate_loops != 0: 147 | for obj in generic_sel_objs: 148 | bpy.ops.object.select_all(action='DESELECT') 149 | obj.select_set(True) 150 | bpy.ops.transform.rotate(value=math.radians(self.rotate_loops), orient_axis='Z', orient_type='LOCAL', orient_matrix_type='LOCAL', constraint_axis=(False, False, True), use_proportional_edit=False, release_confirm=False) 151 | 152 | bpy.ops.object.select_all(action='DESELECT') 153 | for obj in generic_sel_objs: 154 | obj.select_set(True) 155 | 156 | context.view_layer.objects.active = context.selected_objects[0] 157 | 158 | bpy.ops.object.make_single_user(type='SELECTED_OBJECTS', object=True, obdata=True, material=False, animation=False) 159 | bpy.ops.object.transform_apply(location=True, rotation=True, scale=True) 160 | bpy.ops.object.join() 161 | 162 | retop_obj = context.active_object 163 | retop_obj.show_in_front = True 164 | retop_obj.show_wire = True 165 | #dg = bpy.context.evaluated_depsgraph_get() 166 | #dg.update() 167 | 168 | bpy.ops.object.editmode_toggle() 169 | bm = bmesh.from_edit_mesh(retop_obj.data) 170 | 171 | bpy.ops.mesh.select_mode(use_extend=False, use_expand=False, type='EDGE') 172 | bpy.ops.mesh.select_all(action='SELECT') 173 | bpy.ops.mesh.bridge_edge_loops() 174 | 175 | # snap verts 176 | new_positions = [] 177 | for vert in bm.verts: 178 | vert_nor = vert.normal.copy() 179 | vert_nor.negate() 180 | best_obj, hit_normal, hit_position = ut_base.get_3dpoint_raycast(context, meshes_array, vert.co, vert_nor) 181 | 182 | if hit_position: 183 | new_positions.append(hit_position) 184 | else: 185 | new_positions.append(None) 186 | 187 | # set positions 188 | for idx, vert in enumerate(bm.verts): 189 | if new_positions[idx]: 190 | vert.co = new_positions[idx] 191 | 192 | bpy.ops.object.editmode_toggle() 193 | 194 | #retop_obj.data.from_pydata(out_verts, [], out_faces) 195 | retop_obj.data.update() 196 | 197 | return {'FINISHED'} 198 | 199 | 200 | -------------------------------------------------------------------------------- /blender/addons/2.8/mira_tools/mi_settings.py: -------------------------------------------------------------------------------- 1 | # ***** BEGIN GPL LICENSE BLOCK ***** 2 | # 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software Foundation, 16 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | # 18 | # ***** END GPL LICENCE BLOCK ***** 19 | 20 | import bpy 21 | 22 | from bpy.props import * 23 | from bpy.types import Operator, AddonPreferences, PropertyGroup 24 | 25 | 26 | class MI_Addon_Settings(AddonPreferences): 27 | bl_idname = __package__ 28 | 29 | key_inputs: EnumProperty( 30 | name = "Key Inputs Style", 31 | items = (('Blender', 'Blender', ''), 32 | ('Maya', 'Maya', '') 33 | ), 34 | default = 'Blender' 35 | ) 36 | 37 | point_size: IntProperty( default = 6, min = 1) 38 | line_size: IntProperty( default = 1, min = 1) 39 | select_point_radius: FloatProperty( default = 9.0, min = 3.0) 40 | 41 | def draw(self, context): 42 | layout = self.layout 43 | #row = layout.row() 44 | #row.prop(self, "sg_icons_style") 45 | layout.prop(self, "key_inputs") 46 | layout.prop(self, "point_size") 47 | layout.prop(self, "line_size") 48 | layout.prop(self, "select_point_radius") 49 | 50 | 51 | class MI_Settings(PropertyGroup): 52 | # For all tools 53 | surface_snap: BoolProperty(default=False) 54 | snap_objects: EnumProperty( 55 | name = "Objects To Snap", 56 | items = (('Selected', 'Selected', ''), 57 | ('Visible', 'Visible', '') 58 | ), 59 | default = 'Visible' 60 | ) 61 | 62 | convert_instances: BoolProperty(default=False) # This feat converts off duplis and group instances into meshes 63 | snap_points: BoolProperty(default=True) # This feat snaps points for CurveSurfaces and CurveStretch 64 | 65 | # Curve Settings 66 | curve_resolution: IntProperty(default=13, min=1, max=128) 67 | draw_handlers: BoolProperty(default=False) 68 | 69 | spread_mode: EnumProperty( 70 | name = "Spread Mode", 71 | items = (('Original', 'Original', ''), 72 | ('Uniform', 'Uniform', '') 73 | ), 74 | default = 'Original' 75 | ) 76 | -------------------------------------------------------------------------------- /blender/addons/2.8/mira_tools/mi_simple_modeling.py: -------------------------------------------------------------------------------- 1 | # ***** BEGIN GPL LICENSE BLOCK ***** 2 | # 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software Foundation, 16 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | # 18 | # ***** END GPL LICENCE BLOCK ***** 19 | 20 | import bpy 21 | import bmesh 22 | # import bgl 23 | # import blf 24 | # import string 25 | 26 | from bpy.props import * 27 | from bpy.types import Operator, AddonPreferences 28 | 29 | #from bpy_extras import view3d_utils 30 | 31 | import math 32 | import mathutils as mathu 33 | #import random 34 | #from mathutils import Vector, Matrix 35 | 36 | 37 | class MI_OT_SM_Symmetry(bpy.types.Operator): 38 | 39 | """Draw a line with the mouse""" 40 | bl_idname = "mira.sm_symmetry" 41 | bl_label = "MiraSymmetry" 42 | bl_description = "MiraSymmetry" 43 | bl_options = {'REGISTER', 'UNDO'} 44 | 45 | #taper_value: FloatProperty(default=0.0, min=-1000.0, max=1.0) 46 | 47 | sym_axis: EnumProperty( 48 | items=(('X', 'X', ''), 49 | ('Y', 'Y', ''), 50 | ('Z', 'Z', ''), 51 | ), 52 | default = 'X' 53 | ) 54 | 55 | # deform_direction: EnumProperty( 56 | # items=(('Top', 'Top', ''), 57 | #('Bottom', 'Bottom', ''), 58 | #('Left', 'Left', ''), 59 | #('Right', 'Right', ''), 60 | #), 61 | # default = 'Top' 62 | #) 63 | 64 | 65 | def invoke(self, context, event): 66 | 67 | 68 | return self.execute(context) 69 | # else: 70 | # self.report({'WARNING'}, "View3D not found, cannot run operator") 71 | # return {'CANCELLED'} 72 | 73 | 74 | def execute(self, context): 75 | 76 | bpy.ops.object.mode_set(mode='OBJECT', toggle=False) 77 | ref_obj = context.active_object 78 | verts_ref = [v for v in ref_obj.data.vertices if v.select] 79 | 80 | tmp_obj = bpy.data.objects.new("MIRA_TMP", ref_obj.data.copy()) 81 | tmp_obj.matrix_world = ref_obj.matrix_world.copy() 82 | context.scene.collection.objects.link(tmp_obj) 83 | 84 | bpy.ops.object.select_all(action='DESELECT') 85 | 86 | context.view_layer.objects.active = tmp_obj 87 | tmp_obj.select_set(True) 88 | verts_tmp = [v for v in tmp_obj.data.vertices if v.select] 89 | 90 | if self.sym_axis == 'X': 91 | for v in verts_tmp: 92 | v.co[0] = -v.co[0] 93 | elif self.sym_axis == 'Y': 94 | for v in verts_tmp: 95 | v.co[1] = -v.co[1] 96 | elif self.sym_axis == 'Z': 97 | for v in verts_tmp: 98 | v.co[2] = -v.co[2] 99 | 100 | bpy.ops.object.modifier_add(type='SHRINKWRAP') 101 | tmp_obj.modifiers["Shrinkwrap"].wrap_method = 'NEAREST_VERTEX' 102 | bpy.context.object.modifiers["Shrinkwrap"].target = ref_obj 103 | bpy.ops.object.modifier_apply(modifier="Shrinkwrap") 104 | 105 | verts_tmp = [v for v in tmp_obj.data.vertices if v.select] # get verts again with new positions 106 | 107 | for i,v in enumerate(verts_ref): 108 | v.co = verts_tmp[i].co 109 | 110 | if self.sym_axis == 'X': 111 | for v in verts_ref: 112 | v.co[0] = -v.co[0] 113 | elif self.sym_axis == 'Y': 114 | for v in verts_ref: 115 | v.co[1] = -v.co[1] 116 | elif self.sym_axis == 'Z': 117 | for v in verts_ref: 118 | v.co[2] = -v.co[2] 119 | 120 | bpy.ops.object.delete(use_global=False) 121 | 122 | context.view_layer.objects.active = ref_obj 123 | ref_obj.select_set(True) 124 | bpy.ops.object.mode_set(mode='EDIT', toggle=False) 125 | 126 | return {'FINISHED'} 127 | 128 | 129 | 130 | 131 | -------------------------------------------------------------------------------- /blender/addons/2.8/mira_tools/mi_snap_points.py: -------------------------------------------------------------------------------- 1 | # ***** BEGIN GPL LICENSE BLOCK ***** 2 | # 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software Foundation, 16 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | # 18 | # ***** END GPL LICENCE BLOCK ***** 19 | 20 | import bpy 21 | import bmesh 22 | import math 23 | from math import * 24 | import mathutils as mathu 25 | 26 | from bpy.props import * 27 | from bpy.types import Operator, AddonPreferences 28 | 29 | from . import mi_utils_base as ut_base 30 | from . import mi_looptools as loop_t 31 | from mathutils import Vector, Matrix 32 | 33 | 34 | class MI_OT_Unbevel(bpy.types.Operator): 35 | 36 | """Draw a line with the mouse""" 37 | bl_idname = "mira.snap_points" 38 | bl_label = "Snap Points" 39 | bl_description = "Snap Points" 40 | bl_options = {'REGISTER', 'UNDO'} 41 | 42 | #reset_values: BoolProperty(default=False) 43 | #unbevel_value: bpy.props.FloatProperty(name="Snap Points", description="Snap Points", default=1000, min=0.0) 44 | 45 | def execute(self, context): 46 | 47 | #if self.reset_values is True: 48 | #self.reset_all_values() 49 | 50 | active_obj = context.active_object 51 | 52 | bm = bmesh.from_edit_mesh(active_obj.data) 53 | bm.verts.ensure_lookup_table() 54 | sel_verts = [v for v in bm.verts if v.select] 55 | 56 | curve_settings = context.scene.mi_settings 57 | 58 | if curve_settings.snap_objects == 'Selected': 59 | objects_array = [obj for obj in context.selected_objects if obj != active_obj and obj.type == 'MESH'] 60 | else: 61 | objects_array = [obj for obj in context.visible_objects if obj != active_obj and obj.type == 'MESH'] 62 | 63 | # do snapping 64 | if sel_verts and objects_array: 65 | vert_pose_list = {} 66 | 67 | # get nearest positions 68 | for obj in objects_array: 69 | bvh = mathu.bvhtree.BVHTree.FromObject(obj, context.evaluated_depsgraph_get()) 70 | 71 | for idx, vert in enumerate(sel_verts): 72 | v_pos = obj.matrix_world.inverted() @ (active_obj.matrix_world @ vert.co) 73 | nearest = bvh.find_nearest(v_pos) 74 | 75 | if nearest and nearest[0]: 76 | v_pos_near = active_obj.matrix_world.inverted() @ (obj.matrix_world @ nearest[0]) 77 | 78 | if vert in vert_pose_list.keys(): 79 | # if new near position is less 80 | if (vert.co - vert_pose_list[vert]).length > (vert.co - v_pos_near).length: 81 | vert_pose_list[vert] = v_pos_near 82 | else: 83 | vert_pose_list[vert] = v_pos_near 84 | 85 | for vert in sel_verts: 86 | vert.co = vert_pose_list[vert] 87 | 88 | bm.normal_update() 89 | bmesh.update_edit_mesh(active_obj.data) 90 | 91 | return {'FINISHED'} 92 | -------------------------------------------------------------------------------- /blender/addons/2.8/mira_tools/mi_unbevel.py: -------------------------------------------------------------------------------- 1 | # ***** BEGIN GPL LICENSE BLOCK ***** 2 | # 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software Foundation, 16 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | # 18 | # ***** END GPL LICENCE BLOCK ***** 19 | 20 | import bpy 21 | import bmesh 22 | import math 23 | from math import * 24 | import mathutils as mathu 25 | 26 | from bpy.props import * 27 | from bpy.types import Operator, AddonPreferences 28 | 29 | from . import mi_utils_base as ut_base 30 | from . import mi_looptools as loop_t 31 | from mathutils import Vector, Matrix 32 | 33 | 34 | class MI_OT_Unbevel(bpy.types.Operator): 35 | 36 | """Draw a line with the mouse""" 37 | bl_idname = "mira.unbevel" 38 | bl_label = "Unbevel" 39 | bl_description = "Unbevel" 40 | bl_options = {'REGISTER', 'UNDO'} 41 | 42 | #reset_values: BoolProperty(default=False) 43 | unbevel_value: bpy.props.FloatProperty(name="Unbevel Value", description="Unbevel Value", default=1.0, min=0.0) 44 | 45 | def execute(self, context): 46 | 47 | #if self.reset_values is True: 48 | #self.reset_all_values() 49 | 50 | active_obj = context.active_object 51 | 52 | bm = bmesh.from_edit_mesh(active_obj.data) 53 | bm.verts.ensure_lookup_table() 54 | #verts = [v for v in bm.verts if v.select] 55 | 56 | # get loops 57 | loops = loop_t.get_connected_input(bm) 58 | loops = loop_t.check_loops(loops, bm) 59 | 60 | if not loops: 61 | #self.report({'WARNING'}, "No Loops!") 62 | #return {'CANCELLED'} 63 | 64 | b_edges = [edge for edge in bm.edges if edge.select] 65 | 66 | #obj_matrix = active_obj.matrix_world 67 | #obj_matrix_inv = obj_matrix.inverted() 68 | 69 | if self.unbevel_value != 1: 70 | 71 | degree_90 = 1.5708 72 | 73 | if loops: 74 | for loop in loops: 75 | if loop[1] is True: 76 | continue 77 | 78 | loop_verts = [] 79 | 80 | for ind in loop[0]: 81 | loop_verts.append(bm.verts[ind]) 82 | 83 | v1 = (loop_verts[1].co - loop_verts[0].co).normalized() 84 | v2 = (loop_verts[2].co - loop_verts[1].co).normalized() 85 | angle_1 = v1.angle(v2) / 2 86 | 87 | v3 = (loop_verts[-2].co - loop_verts[-1].co).normalized() 88 | v4 = (loop_verts[-3].co - loop_verts[-2].co).normalized() 89 | angle_2 = v1.angle(v2) / 2 90 | 91 | rot_dir = v1.cross(v2).normalized() 92 | rot_mat = Matrix.Rotation(-angle_1, 3, rot_dir) 93 | rot_mat_2 = Matrix.Rotation((angle_2 - degree_90), 3, rot_dir) 94 | v1_nor = ((rot_mat @ v1).normalized() * 10000) + loop_verts[0].co 95 | v3_nor = (rot_mat_2 @ v3).normalized() 96 | 97 | scale_pos = mathu.geometry.intersect_line_plane(loop_verts[0].co, v1_nor, loop_verts[-1].co, v3_nor) 98 | 99 | for vert in loop_verts: 100 | vert.co = scale_pos.lerp(vert.co, self.unbevel_value) 101 | 102 | if self.unbevel_value == 0: 103 | bpy.ops.mesh.merge(type='COLLAPSE') 104 | 105 | bm.normal_update() 106 | bmesh.update_edit_mesh(active_obj.data) 107 | 108 | elif b_edges: 109 | b_edges_pos = [] 110 | b_edgess_ids = [edge.index for edge in b_edges] 111 | 112 | for edge in b_edges: 113 | verts = edge.verts 114 | 115 | # fix normals 116 | if len(edge.link_faces) > 1: 117 | linked_edges_0 = 0 118 | linked_edges_1 = 0 119 | 120 | for edge2 in edge.link_faces[0].edges: 121 | if edge2.index in b_edgess_ids: 122 | linked_edges_0 += 1 123 | 124 | for edge2 in edge.link_faces[1].edges: 125 | if edge2.index in b_edgess_ids: 126 | linked_edges_1 += 1 127 | 128 | if len(edge.link_faces[0].verts) > 4 or linked_edges_0 < 2: 129 | ed_normal = edge.link_faces[1].normal 130 | elif len(edge.link_faces[1].verts) > 4 or linked_edges_1 < 2: 131 | ed_normal = edge.link_faces[0].normal 132 | else: 133 | ed_normal = edge.link_faces[0].normal.lerp(edge.link_faces[1].normal, 0.5) 134 | 135 | fix_dir = ed_normal.cross( (verts[0].co - verts[1].co).normalized() ) 136 | v0_nor = mathu.geometry.intersect_line_plane(verts[0].normal + (fix_dir * 2), verts[0].normal - (fix_dir * 2), Vector((0,0,0)), fix_dir).normalized() 137 | v1_nor = mathu.geometry.intersect_line_plane(verts[1].normal + (fix_dir * 2), verts[1].normal - (fix_dir * 2), Vector((0,0,0)), fix_dir).normalized() 138 | #nor_dir = ed_normal 139 | 140 | else: 141 | v0_nor = verts[0].normal 142 | v1_nor = verts[1].normal 143 | #nor_dir = v0_nor.lerp(v1_nor, 0.5).normalized() 144 | 145 | # base math 146 | nor_dir = v0_nor.lerp(v1_nor, 0.5).normalized() 147 | side_dir_2 = (verts[0].co - verts[1].co).normalized() 148 | side_dir_2.negate() 149 | side_dir_1 = nor_dir.cross(side_dir_2).normalized() 150 | #side_dir_2 = (verts[0].co - verts[1].co).normalized() 151 | #side_dir_2 = nor_dir.cross(side_dir_1).normalized() 152 | 153 | pos_between = verts[0].co.lerp(verts[1].co, 0.5) 154 | angle_between_1 = v0_nor.angle(nor_dir) 155 | angle_between_2 = v1_nor.angle(nor_dir) 156 | 157 | rot_mat = Matrix.Rotation((-angle_between_1 * 2) - degree_90, 3, side_dir_1) 158 | rot_mat_2 = Matrix.Rotation((angle_between_1 * 2) + (degree_90 * 2), 3, side_dir_1) 159 | dir_1 = ((rot_mat @ nor_dir).normalized() * 10000) + verts[0].co 160 | dir_2 = (rot_mat_2 @ nor_dir).normalized() 161 | 162 | scale_pos = mathu.geometry.intersect_line_plane(verts[0].co, dir_1, verts[1].co, dir_2) 163 | b_edges_pos.append((verts[0], scale_pos)) 164 | b_edges_pos.append((verts[1], scale_pos)) 165 | 166 | for v_data in b_edges_pos: 167 | v_data[0].co = v_data[1].lerp(v_data[0].co, self.unbevel_value) 168 | 169 | if self.unbevel_value == 0: 170 | bpy.ops.mesh.merge(type='COLLAPSE') 171 | 172 | bm.normal_update() 173 | bmesh.update_edit_mesh(active_obj.data) 174 | 175 | return {'FINISHED'} 176 | -------------------------------------------------------------------------------- /blender/addons/2.8/mira_tools/mi_widget_curve.py: -------------------------------------------------------------------------------- 1 | # ***** BEGIN GPL LICENSE BLOCK ***** 2 | # 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software Foundation, 16 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | # 18 | # ***** END GPL LICENCE BLOCK ***** 19 | 20 | 21 | import gpu 22 | from gpu_extras.batch import batch_for_shader 23 | 24 | from bpy.props import * 25 | 26 | from . import mi_utils_base as ut_base 27 | 28 | 29 | shader3d = gpu.shader.from_builtin('UNIFORM_COLOR') 30 | shader2d = gpu.shader.from_builtin('UNIFORM_COLOR') 31 | 32 | 33 | def draw_2d_point(point_x, point_y, p_size=4, p_col=(1.0,1.0,1.0,1.0)): 34 | gpu.state.point_size_set(p_size) 35 | 36 | coords = ((point_x, point_y), (point_x, point_y)) 37 | batch = batch_for_shader(shader2d, 'POINTS', {"pos": coords}) 38 | shader2d.bind() 39 | shader2d.uniform_float("color", (p_col[0], p_col[1], p_col[2], p_col[3])) 40 | batch.draw(shader2d) 41 | 42 | 43 | def draw_3d_polyline(points, p_size, l_size, p_col, x_ray): 44 | 45 | gpu.state.line_width_set(l_size) 46 | 47 | # if x_ray is True: 48 | # # bgl.glDisable(bgl.GL_DEPTH_TEST) 49 | # gpu.state.depth_test_set("NONE") 50 | 51 | coords = [(point[0], point[1], point[2]) for point in points] 52 | batch = batch_for_shader(shader3d, 'LINE_STRIP', {"pos": coords}) 53 | shader3d.bind() 54 | shader3d.uniform_float("color", (p_col[0], p_col[1], p_col[2], p_col[3])) 55 | batch.draw(shader3d) 56 | 57 | -------------------------------------------------------------------------------- /blender/addons/2.8/mira_tools/mi_widget_select.py: -------------------------------------------------------------------------------- 1 | # ***** BEGIN GPL LICENSE BLOCK ***** 2 | # 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software Foundation, 16 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | # 18 | # ***** END GPL LICENCE BLOCK ***** 19 | 20 | 21 | from bpy.props import * 22 | from bpy.types import Operator, AddonPreferences 23 | 24 | import gpu 25 | from gpu_extras import presets 26 | from gpu_extras.batch import batch_for_shader 27 | 28 | 29 | shader3d = gpu.shader.from_builtin('UNIFORM_COLOR') 30 | shader2d = gpu.shader.from_builtin('UNIFORM_COLOR') 31 | 32 | 33 | def draw_circle_select(m_coords, radius = 16, p_col = (0.7,0.8,1.0,0.6), enabled = False, sub = False): 34 | if(enabled): 35 | f_col = p_col 36 | 37 | if sub: 38 | f_col = (1.0, 0.5, 0.4, 0.6) 39 | 40 | gpu.state.line_width_set(1) 41 | 42 | radius = int(radius) 43 | 44 | presets.draw_circle_2d(m_coords, (f_col[0], f_col[1], f_col[2], f_col[3]), radius, segments=64) 45 | 46 | 47 | def draw_box_select(anchor, m_coords, region, p_col = (0.7,0.8,1.0,0.6), enabled = False, dragging = False, sub = False): 48 | 49 | if enabled: 50 | f_col = p_col 51 | if sub: 52 | f_col = (1.0, 0.5, 0.4, 0.6) 53 | 54 | point_x = m_coords[0] 55 | point_y = m_coords[1] 56 | 57 | coords = [] 58 | 59 | coords.append( (point_x, 0) ) 60 | coords.append( (point_x, region.height) ) 61 | 62 | coords.append( (0, point_y) ) 63 | coords.append( (region.width, point_y) ) 64 | 65 | gpu.state.line_width_set(1) 66 | 67 | batch = batch_for_shader(shader2d, 'LINES', {"pos": coords}) 68 | shader2d.bind() 69 | shader2d.uniform_float("color", (f_col[0], f_col[1], f_col[2], f_col[3])) 70 | batch.draw(shader2d) 71 | 72 | 73 | if dragging: 74 | point_x = m_coords[0] 75 | point_y = m_coords[1] 76 | 77 | anc_x = anchor[0] 78 | anc_y = anchor[1] 79 | 80 | coords_2 = [] 81 | 82 | coords_2.append( (anc_x, anc_y) ) 83 | coords_2.append( (point_x, anc_y) ) 84 | coords_2.append( (point_x, point_y) ) 85 | coords_2.append( (anc_x, point_y) ) 86 | 87 | batch = batch_for_shader(shader2d, 'LINE_LOOP', {"pos": coords_2}) 88 | shader2d.bind() 89 | shader2d.uniform_float("color", (f_col[0], f_col[1], f_col[2], f_col[3])) 90 | batch.draw(shader2d) 91 | 92 | coords_3 = [] 93 | 94 | coords_3.append( (anc_x, anc_y) ) 95 | coords_3.append( (point_x, anc_y) ) 96 | coords_3.append( (point_x, point_y) ) 97 | coords_3.append( (anc_x, point_y) ) 98 | 99 | batch = batch_for_shader(shader2d, 'LINE_STRIP', {"pos": coords_3}) 100 | shader2d.bind() 101 | shader2d.uniform_float("color", (f_col[0], f_col[1], f_col[2], f_col[3])) 102 | batch.draw(shader2d) 103 | -------------------------------------------------------------------------------- /blender/addons/2.8/quick_pipe/quick_pipe.py: -------------------------------------------------------------------------------- 1 | import bpy 2 | import bmesh 3 | import math 4 | import mathutils as mathu 5 | 6 | from bpy.props import ( 7 | IntProperty, 8 | FloatProperty 9 | ) 10 | 11 | bl_info = { 12 | "name": "Quick Pipe", 13 | "author": "floatvoid (Jeremy Mitchell), Pavel Geraskin", 14 | "version": (1, 0), 15 | "blender": (2, 80, 0), 16 | "location": "View3D > Edit Mode", 17 | "description": "Quickly converts an edge selection to an extruded curve.", 18 | "warning": "", 19 | "wiki_url": "", 20 | "category": "View3D"} 21 | 22 | 23 | class jmPipeTool(bpy.types.Operator): 24 | bl_idname = "object.quickpipe" 25 | bl_label = "Quick Pipe" 26 | bl_options = {'REGISTER', 'UNDO'} 27 | 28 | first_mouse_x : IntProperty() 29 | first_value : FloatProperty() 30 | 31 | def modal(self, context, event): 32 | if event.type in {'RIGHTMOUSE', 'ESC', 'LEFTMOUSE'}: 33 | return {'FINISHED'} 34 | 35 | if event.type == 'MOUSEMOVE': 36 | delta = (self.first_mouse_x - event.mouse_x) 37 | 38 | if event.ctrl: 39 | delta *= 0.1 40 | 41 | if event.shift: 42 | delta *= 0.1 43 | 44 | context.object.data.bevel_depth = abs( (self.first_value + delta) * 0.01 ) 45 | elif event.type == 'WHEELUPMOUSE': 46 | bpy.context.object.data.bevel_resolution += 1 47 | elif event.type == 'WHEELDOWNMOUSE': 48 | if bpy.context.object.data.bevel_resolution > 0: 49 | bpy.context.object.data.bevel_resolution -= 1 50 | 51 | return {'RUNNING_MODAL'} 52 | 53 | def invoke(self, context, event): 54 | if context.object: 55 | 56 | if( context.object.type == 'MESH' ): 57 | self.first_mouse_x = event.mouse_x 58 | 59 | bpy.ops.mesh.duplicate_move() 60 | bpy.ops.mesh.separate(type='SELECTED') 61 | bpy.ops.object.editmode_toggle() 62 | 63 | #pipe = context.view_layer.objects[-1] 64 | pipe = context.selected_objects[-1] 65 | bpy.ops.object.select_all(action='DESELECT') 66 | pipe.select_set(state=True) 67 | context.view_layer.objects.active = pipe 68 | bpy.ops.object.convert(target='CURVE') 69 | 70 | pipe.data.fill_mode = 'FULL' 71 | pipe.data.splines[0].use_smooth = True 72 | pipe.data.bevel_resolution = 1 73 | pipe.data.bevel_depth = 0.1 74 | 75 | elif( context.object.type == 'CURVE' ): 76 | self.report({'WARNING'}, "Need Edit Mode!") 77 | return {'CANCELLED'} 78 | 79 | self.first_value = pipe.data.bevel_depth 80 | 81 | context.window_manager.modal_handler_add(self) 82 | return {'RUNNING_MODAL'} 83 | else: 84 | self.report({'WARNING'}, "No active object, could not finish") 85 | return {'CANCELLED'} 86 | 87 | 88 | #class VIEW3D_PT_tools_jmPipeTool(bpy.types.Panel): 89 | 90 | #bl_label = "Quick Pipe" 91 | #bl_space_type = 'VIEW_3D' 92 | #bl_region_type = 'TOOLS' 93 | #bl_category = 'Tools' 94 | #bl_context = "mesh_edit" 95 | #bl_options = {'DEFAULT_CLOSED'} 96 | 97 | #def draw(self, context): 98 | #layout = self.layout 99 | 100 | #row = layout.row() 101 | #row.operator("object.quickpipe") 102 | 103 | 104 | def menu_func(self, context): 105 | layout = self.layout 106 | layout.operator_context = "INVOKE_DEFAULT" 107 | self.layout.operator(jmPipeTool.bl_idname, text="Quick Pipe") 108 | 109 | classes = ( 110 | jmPipeTool, 111 | ) 112 | 113 | 114 | # Register 115 | def register(): 116 | for cls in classes: 117 | bpy.utils.register_class(cls) 118 | # update_panel(None, bpy.context) 119 | bpy.types.VIEW3D_MT_edit_mesh_context_menu.append(menu_func) # Mesh Context Menu 120 | #bpy.types.VIEW3D_MT_edit_mesh_vertices.append(menu_func) # Vertices Menu(CTRL+V) 121 | bpy.types.VIEW3D_MT_edit_mesh_edges.append(menu_func) # Edge Menu(CTRL+E) 122 | 123 | 124 | def unregister(): 125 | for cls in classes: 126 | bpy.utils.unregister_class(cls) 127 | 128 | bpy.types.VIEW3D_MT_edit_mesh_context_menu.remove(menu_func) 129 | #bpy.types.VIEW3D_MT_edit_mesh_vertices.remove(menu_func) 130 | bpy.types.VIEW3D_MT_edit_mesh_edges.remove(menu_func) 131 | 132 | if __name__ == "__main__": 133 | register() 134 | -------------------------------------------------------------------------------- /blender/animation_nodes/modeling/clone_curve.blend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/blender/animation_nodes/modeling/clone_curve.blend -------------------------------------------------------------------------------- /blender/animation_nodes/modeling/simple_array.blend: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/blender/animation_nodes/modeling/simple_array.blend -------------------------------------------------------------------------------- /houdini/Houdini.keymap.overrides: -------------------------------------------------------------------------------- 1 | h.pane.gview.tool:sop_polybevel::3.0 PolyBevel "Shelf Tool: PolyBevel" Ctrl+B 2 | h.pane.gview.state.select.rotate "Rotate Tool" "Invoke the rotate tool" E 3 | HCONTEXT h.pane.gview.state.sop.sidefx_rbdconstraintsfromcurves "sidefx_rbdconstraintsfromcurves Operation" "These keys apply to the sidefx_rbdconstraintsfromcurves operation." 4 | HCONTEXT h.pane.gview.state.sop.sidefx_rbdconstraintsfromcurves.pystate "sidefx_rbdconstraintsfromcurves.pystate Operation" "These keys apply to the sidefx_rbdconstraintsfromcurves.pystate operation." 5 | h.pane.gview.state.sop.sidefx_rbdconstraintsfromcurves.pystate.toggle_edit "Toggle Hinge Edits" "Toggle Hinge Edits" 4 6 | h.pane.maximize_full Maximize "Toggle pane full screen" Alt+\\' 7 | h.find "Find Operator" "Find operator" Alt+F 8 | HCONTEXT h.pane.gview.state.sop.sidefx_rbdconstraintsfromrules "sidefx_rbdconstraintsfromrules Operation" "These keys apply to the sidefx_rbdconstraintsfromrules operation." 9 | HCONTEXT h.pane.gview.state.sop.sidefx_rbdconstraintsfromrules.pystate "sidefx_rbdconstraintsfromrules.pystate Operation" "These keys apply to the sidefx_rbdconstraintsfromrules.pystate operation." 10 | h.pane.gview.state.sop.sidefx_rbdconstraintsfromrules.pystate.toggle_edit "Toggle Hinge Edits" "Toggle Hinge Edits" 4 11 | HCONTEXT h.pane.gview.state.sop.sidefx_rbdpaintstroke "sidefx_rbdpaintstroke Operation" "These keys apply to the sidefx_rbdpaintstroke operation." 12 | HCONTEXT h.pane.gview.state.sop.sidefx_rbdpaintstroke.pystate "sidefx_rbdpaintstroke.pystate Operation" "These keys apply to the sidefx_rbdpaintstroke.pystate operation." 13 | h.pane.gview.state.sop.sidefx_rbdpaintstroke.pystate.cycle_brushes "Cycle brushes" "Cycle stroke tools" 1 14 | h.pane.gview.model.seltypegroups "Select Groups" "Select geometry groups" 9 Pad9 Shift+D 15 | HCONTEXT h.pane.gview.state.sop.sidefx_rbdconstraintsfromlines "sidefx_rbdconstraintsfromlines Operation" "These keys apply to the sidefx_rbdconstraintsfromlines operation." 16 | HCONTEXT h.pane.gview.state.sop.sidefx_rbdconstraintsfromlines.pystate "sidefx_rbdconstraintsfromlines.pystate Operation" "These keys apply to the sidefx_rbdconstraintsfromlines.pystate operation." 17 | h.pane.gview.state.sop.sidefx_rbdconstraintsfromlines.pystate.toggle_edit "Toggle Hinge Edits" "Toggle Hinge Edits" 4 18 | HCONTEXT h.pane.gview.state.sop.sidefx_bend "sidefx_bend Operation" "These keys apply to the sidefx_bend operation." 19 | h.pane.gview.state.sop.sidefx_bend.bend Bending "Modulate bend parameter with mouse wheel" 1 20 | h.pane.gview.state.sop.sidefx_rbdconstraintsfromrules.pystate.show_hinge_edit "Toggle Transform Handle" "Toggle Transform Handle" 2 21 | h.pane.gview.state.view.set_pivot_and_center "Set Pivot And Center" "Set pivot and center view to geometry under the cursor" 22 | mplay.quit Quit Quit Ctrl+Q 23 | h.pane.gview.tool:edges_to_face EdgesToFace "Shelf Tool: EdgesToFace" Ctrl+F 24 | h.pane.gview.repeat_current "Repeat Current Operation" "Quick-repeat current operation" Shift+Q 25 | h.pane.gview.toggle_wireshaded "Toggle Wireframe/Shaded" "Toggle wireframe/shaded" Ctrl+W 26 | h.pane.gview.state.select.move "Move Tool" "Invoke the move tool" W 27 | h.pane.gview.tool:sop_edgeloop "Edge Loop" "Shelf Tool: Edge Loop" Ctrl+R 28 | h.pane.gview.state.sop.sidefx_rbdconstraintsfromcurves.pystate.toggle_tweak "Toggle Transform Handle" "Toggle Transform Handle" 2 29 | h.pane.gview.state.sop.sidefx_rbdpaintstroke.pystate.realtime_mode realtime "Enable realtime mode" 0 30 | h.pane.gview.state.sop.sidefx_bend.twist Twisting "Modulate twist parameter with mouse wheel" 2 31 | h.pane.gview.state.sop.sidefx_bend.squish Squishing "Modulate squish parameter with mouse wheel" 5 32 | h.pane.closetab "Close Tab" "Close tab" 33 | h.pane.gview.repeat_current_branch "Repeat Current Operation Branched" "Quick-repeat current operation branched" Ctrl+Shift+Q 34 | gplay.quit Quit Quit Ctrl+Q 35 | h.pane.gview.state.sop.sidefx_bend.length "Length Scaling" "Modulate length scale parameter with mouse wheel" 3 36 | h.pane.gview.state.sop.sidefx_rbdconstraintsfromlines.pystate.toggle_enable "Toggle Enable Line" "Toggle Enable Line" 3 37 | h.pane.gview.state.sop.sidefx_rbdpaintstroke.pystate.log_state "Log state" "Log state attributes" 8 38 | h.pane.gview.state.sop.sidefx_rbdpaintstroke.pystate.set_wireframe_brush "Set wireframe brush" "Set wireframe brush" 2 39 | h.pane.gview.tool:hard_gun_prim Prim "Shelf Tool: Prim" Alt+A 40 | h.pane.gview.state.sop.sidefx_rbdconstraintsfromlines.pystate.toggle_tweak "Toggle Transform Handle" "Toggle Transform Handle" 2 41 | h.pane.gview.tool:sop_polyextrude::2.0 PolyExtrude "Shelf Tool: PolyExtrude" Ctrl+E 42 | h.pane.gview.state.sop.sidefx_rbdconstraintsfromrules.pystate.show_bbox_handle "Toggle BBox Handle" "Toggle BBox Handle" 3 43 | h.pane.gview.state.sop.sidefx_rbdpaintstroke.pystate.debug_msg "Debug messages" "Enable debug messages" 7 44 | h.pane.gview.state.sop.sidefx_bend.taper Tapering "Modulate taper parameter with mouse wheel" 4 45 | h.pane.gview.state.sop.sidefx_rbdconstraintsfromcurves.pystate.toggle_draw "Toggle Curve/Hinge Mode" "Toggle Curve/Hinge Mode" 1 46 | h.pane.gview.state.sop.sidefx_rbdconstraintsfromlines.pystate.toggle_draw "Toggle Curve/Hinge Mode" "Toggle Curve/Hinge Mode" 1 47 | h.pane.gview.state.sop.sidefx_rbdpaintstroke.pystate.set_viewport_brush "Set viewport brush" "Set viewport brush" 3 48 | h.pane.gview.tool:sop_polysplit::2.0 PolySplit "Shelf Tool: PolySplit" Alt+R 49 | h.pane.gview.state.sop.sidefx_rbdpaintstroke.pystate.reload_state "Reload state" "Reload state" 9 50 | h.pane.gview.tool:merge_verts "Merge Verts" "Shelf Tool: Merge Verts" Alt+C 51 | h.pane.gview.state.new_select "Select Tool" "Invoke the select tool" Q 52 | h.pane.gview.tool:object_pose "Pose Tool" "Invoke the pose tool" Ctrl+Shift+R 53 | h.pane.gview.state.sop.sidefx_rbdconstraintsfromcurves.pystate.toggle_enable "Toggle Enable Curve" "Toggle Enable Curve" 3 54 | h.pane.gview.state.view.set_pivot "Set Pivot" "Set pivot to geometry under the cursor" Z 55 | h.pane.gview.state.sop.sidefx_rbdconstraintsfromrules.pystate.toggle "Toggle Handles" "Toggle Handles" Z 56 | h.pane.copytab "Copy Tab" "Copy tab" 57 | h.pane.gview.state.sop.sidefx_rbdpaintstroke.pystate.trace "Trace callbacks" "Enable trace for callbacks" 6 58 | h.pane.gview.tool:hard_gun_merge Merge "Shelf Tool: Merge" Shift+M 59 | h.pane.wsheet.bypass_mode "Set Bypass Flag" "Hold this key and select a node to toggle the bypass flag value" B 60 | h.pane.gview.tool:hard_gun_view_subdive "View Subdive" "Shelf Tool: View Subdive" Ctrl+~ 61 | h.pane.gview.tool:hard_gun_view_subdive_2 "View Subdive 2" "Shelf Tool: View Subdive 2" Ctrl+` 62 | deskmgr.add Add "Add a desktop" D 63 | h.pane.gview.state.view.cycle_view_context "Cycle View Context" "Cycle view context" Alt+Z 64 | h.copy Copy "Copy selection" Ctrl+C 65 | h.pane.gview.state.select.scale "Scale Tool" "Invoke the scale tool" R 66 | h.quit Quit "Quit the appication" Ctrl+Q 67 | -------------------------------------------------------------------------------- /houdini/otls/animation/mifth_capture_symmetry.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/animation/mifth_capture_symmetry.otllc -------------------------------------------------------------------------------- /houdini/otls/modeling/mifth_attrib_copy_topology.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mifth_attrib_copy_topology.otllc -------------------------------------------------------------------------------- /houdini/otls/modeling/mifth_attrib_ramp.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mifth_attrib_ramp.otllc -------------------------------------------------------------------------------- /houdini/otls/modeling/mifth_bend_plus.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mifth_bend_plus.otllc -------------------------------------------------------------------------------- /houdini/otls/modeling/mifth_capsule.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mifth_capsule.otllc -------------------------------------------------------------------------------- /houdini/otls/modeling/mifth_copy_curve.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mifth_copy_curve.otllc -------------------------------------------------------------------------------- /houdini/otls/modeling/mifth_copy_meshes.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mifth_copy_meshes.otllc -------------------------------------------------------------------------------- /houdini/otls/modeling/mifth_curve_length.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mifth_curve_length.otllc -------------------------------------------------------------------------------- /houdini/otls/modeling/mifth_curve_surface.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mifth_curve_surface.otllc -------------------------------------------------------------------------------- /houdini/otls/modeling/mifth_destructive_extrude.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mifth_destructive_extrude.otllc -------------------------------------------------------------------------------- /houdini/otls/modeling/mifth_divide_edges.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mifth_divide_edges.otllc -------------------------------------------------------------------------------- /houdini/otls/modeling/mifth_edge_collapse_plus.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mifth_edge_collapse_plus.otllc -------------------------------------------------------------------------------- /houdini/otls/modeling/mifth_edgeflipflow.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mifth_edgeflipflow.otllc -------------------------------------------------------------------------------- /houdini/otls/modeling/mifth_edgestoface.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mifth_edgestoface.otllc -------------------------------------------------------------------------------- /houdini/otls/modeling/mifth_edit_linear_falloff.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mifth_edit_linear_falloff.otllc -------------------------------------------------------------------------------- /houdini/otls/modeling/mifth_edit_radial_falloff.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mifth_edit_radial_falloff.otllc -------------------------------------------------------------------------------- /houdini/otls/modeling/mifth_extract_edges.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mifth_extract_edges.otllc -------------------------------------------------------------------------------- /houdini/otls/modeling/mifth_extract_edges_2.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mifth_extract_edges_2.otllc -------------------------------------------------------------------------------- /houdini/otls/modeling/mifth_extrude_point.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mifth_extrude_point.otllc -------------------------------------------------------------------------------- /houdini/otls/modeling/mifth_insert_mesh.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mifth_insert_mesh.otllc -------------------------------------------------------------------------------- /houdini/otls/modeling/mifth_knife_plus.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mifth_knife_plus.otllc -------------------------------------------------------------------------------- /houdini/otls/modeling/mifth_lod_helper.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mifth_lod_helper.otllc -------------------------------------------------------------------------------- /houdini/otls/modeling/mifth_make_arc.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mifth_make_arc.otllc -------------------------------------------------------------------------------- /houdini/otls/modeling/mifth_make_circle.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mifth_make_circle.otllc -------------------------------------------------------------------------------- /houdini/otls/modeling/mifth_merge_verts.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mifth_merge_verts.otllc -------------------------------------------------------------------------------- /houdini/otls/modeling/mifth_move_flow.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mifth_move_flow.otllc -------------------------------------------------------------------------------- /houdini/otls/modeling/mifth_pipe.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mifth_pipe.otllc -------------------------------------------------------------------------------- /houdini/otls/modeling/mifth_point_to_circle.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mifth_point_to_circle.otllc -------------------------------------------------------------------------------- /houdini/otls/modeling/mifth_round_edge_bevel.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mifth_round_edge_bevel.otllc -------------------------------------------------------------------------------- /houdini/otls/modeling/mifth_round_edges_vdb.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mifth_round_edges_vdb.otllc -------------------------------------------------------------------------------- /houdini/otls/modeling/mifth_scale_edges.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mifth_scale_edges.otllc -------------------------------------------------------------------------------- /houdini/otls/modeling/mifth_seams_cheater.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mifth_seams_cheater.otllc -------------------------------------------------------------------------------- /houdini/otls/modeling/mifth_simple_gear.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mifth_simple_gear.hdalc -------------------------------------------------------------------------------- /houdini/otls/modeling/mifth_simple_pipe.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mifth_simple_pipe.otllc -------------------------------------------------------------------------------- /houdini/otls/modeling/mifth_soft_push.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mifth_soft_push.otllc -------------------------------------------------------------------------------- /houdini/otls/modeling/mifth_spread_edges.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mifth_spread_edges.otllc -------------------------------------------------------------------------------- /houdini/otls/modeling/mifth_strap.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mifth_strap.otllc -------------------------------------------------------------------------------- /houdini/otls/modeling/mifth_subdive_plus.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mifth_subdive_plus.otllc -------------------------------------------------------------------------------- /houdini/otls/modeling/mifth_symmetrize.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mifth_symmetrize.otllc -------------------------------------------------------------------------------- /houdini/otls/modeling/mifth_symmetry_extrude_v1.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mifth_symmetry_extrude_v1.otllc -------------------------------------------------------------------------------- /houdini/otls/modeling/mifth_symmetry_extrude_v2.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mifth_symmetry_extrude_v2.otllc -------------------------------------------------------------------------------- /houdini/otls/modeling/mifth_transform_primitives.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mifth_transform_primitives.otllc -------------------------------------------------------------------------------- /houdini/otls/modeling/mifth_unbevel.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mifth_unbevel.otllc -------------------------------------------------------------------------------- /houdini/otls/modeling/mifth_unbevel_v2.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mifth_unbevel_v2.otllc -------------------------------------------------------------------------------- /houdini/otls/modeling/mifth_uv_center.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mifth_uv_center.otllc -------------------------------------------------------------------------------- /houdini/otls/modeling/mifth_uv_grid.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mifth_uv_grid.otllc -------------------------------------------------------------------------------- /houdini/otls/modeling/mifth_uv_layout_plus.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mifth_uv_layout_plus.otllc -------------------------------------------------------------------------------- /houdini/otls/modeling/mifth_uv_pixel_offset.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mifth_uv_pixel_offset.otllc -------------------------------------------------------------------------------- /houdini/otls/modeling/mifth_uv_wrap.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mifth_uv_wrap.otllc -------------------------------------------------------------------------------- /houdini/otls/modeling/mira_tree.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mira_tree.otllc -------------------------------------------------------------------------------- /houdini/otls/modeling/mirror_attribute_good.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/modeling/mirror_attribute_good.otllc -------------------------------------------------------------------------------- /houdini/otls/other/checker2.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/other/checker2.hdalc -------------------------------------------------------------------------------- /houdini/otls/other/checker2_sop.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/other/checker2_sop.hdalc -------------------------------------------------------------------------------- /houdini/otls/other/group_inverted_uvs.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/other/group_inverted_uvs.otllc -------------------------------------------------------------------------------- /houdini/otls/other/mifth_3dcoat_applinker.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/other/mifth_3dcoat_applinker.otllc -------------------------------------------------------------------------------- /houdini/otls/other/mifth_extract_objects.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/other/mifth_extract_objects.otllc -------------------------------------------------------------------------------- /houdini/otls/other/mifth_simple_goz.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/other/mifth_simple_goz.otllc -------------------------------------------------------------------------------- /houdini/otls/other/mifth_texel_density.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/other/mifth_texel_density.otllc -------------------------------------------------------------------------------- /houdini/otls/other/simple_reguide.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/other/simple_reguide.otllc -------------------------------------------------------------------------------- /houdini/otls/other/wireframe.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/other/wireframe.otllc -------------------------------------------------------------------------------- /houdini/otls/render/mifth_extract_bake.otllc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/otls/render/mifth_extract_bake.otllc -------------------------------------------------------------------------------- /houdini/pk/otls/pk_image_plane.hdalc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mifth/mifthtools/3472a4fdd570cb2466549e6f13da39597395e9b3/houdini/pk/otls/pk_image_plane.hdalc -------------------------------------------------------------------------------- /houdini/pk/pk_shelf/pk.shelf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 35 | 36 | 37 | 38 | 91 | 92 | 93 | 94 | 114 | 115 | 116 | -------------------------------------------------------------------------------- /houdini/toolbar/mf_obj.shelf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 53 | 54 | 55 | 56 | 104 | 105 | 106 | 107 | 108 | OBJ 109 | 110 | 114 | 115 | 116 | 117 | 118 | OBJ 119 | 120 | 125 | 126 | 127 | 128 | 147 | 148 | 149 | 150 | 164 | 165 | 166 | 167 | 174 | 175 | 176 | -------------------------------------------------------------------------------- /nuke/gizmos/checker_view.gizmo: -------------------------------------------------------------------------------- 1 | #! /home/mifth/Documents/soft/Nuke/libnuke-9.0.6.so -nx 2 | version 9.0 v6 3 | Gizmo { 4 | name VIEWER_INPUT 5 | } 6 | CheckerBoard2 { 7 | inputs 0 8 | format "4096 3112 0 0 4096 3112 1 4K_Super_35(full-ap)" 9 | boxsize 24 10 | centerlinewidth 0 11 | name CheckerBoard1 12 | xpos 189 13 | ypos -230 14 | } 15 | Crop { 16 | box {0 0 2048 1556} 17 | reformat true 18 | crop false 19 | name Crop1 20 | xpos 189 21 | ypos -120 22 | } 23 | Input { 24 | inputs 0 25 | name Input1 26 | xpos -52 27 | ypos -201 28 | } 29 | Merge2 { 30 | inputs 2 31 | operation under 32 | name Merge1 33 | xpos 123 34 | ypos 19 35 | } 36 | Output { 37 | name Output1 38 | xpos 218 39 | ypos 78 40 | } 41 | Reformat { 42 | inputs 0 43 | type "to box" 44 | box_width {{Input1.width x20 20148}} 45 | box_height {{Input1.height}} 46 | box_fixed true 47 | filter Impulse 48 | name Reformat1 49 | xpos 62 50 | ypos -203 51 | disable true 52 | } 53 | end_group 54 | -------------------------------------------------------------------------------- /other/exchangers/blender/2.7/blender_exchanger/__init__.py: -------------------------------------------------------------------------------- 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 | 19 | bl_info = { 20 | "name": "Blender Exchanger", 21 | "author": "Paul Geraskin", 22 | "version": (0, 1, 0), 23 | "blender": (2, 75, 0), 24 | "location": "View3D > Ex", 25 | "description": "Transfer data between Blender and other packages", 26 | "warning": "", 27 | "wiki_url": "", 28 | "tracker_url": "", 29 | "category": "Import-Export"} 30 | 31 | 32 | if "bpy" in locals(): 33 | import imp 34 | imp.reload(blender_exchanger) 35 | else: 36 | from . import blender_exchanger 37 | 38 | 39 | import bpy 40 | from bpy.props import * 41 | 42 | 43 | def register(): 44 | 45 | class EX_Settings(bpy.types.PropertyGroup): 46 | 47 | doApplyModifiers = BoolProperty( 48 | name="Apply Modifiers", 49 | description="Apply Modifiers...", 50 | default=True 51 | ) 52 | 53 | exportMaterials = BoolProperty( 54 | name="Export Materials", 55 | description="Export Materials...", 56 | default=True 57 | ) 58 | 59 | importNormals = BoolProperty( 60 | name="Import Normals", 61 | description="Import Normals...", 62 | default=False 63 | ) 64 | 65 | bpy.utils.register_module(__name__) 66 | 67 | bpy.types.Scene.b_exchanger = PointerProperty( 68 | name="Applink Variables", 69 | type=EX_Settings, 70 | description="Applink variables" 71 | ) 72 | 73 | 74 | def unregister(): 75 | import bpy 76 | 77 | del bpy.types.Scene.b_exchanger 78 | bpy.utils.unregister_module(__name__) 79 | 80 | 81 | if __name__ == "__main__": 82 | register() 83 | -------------------------------------------------------------------------------- /other/exchangers/blender/2.7/blender_exchanger/blender_exchanger.py: -------------------------------------------------------------------------------- 1 | # ***** BEGIN GPL LICENSE BLOCK ***** 2 | # 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software Foundation, 16 | # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 | # 18 | # ***** END GPL LICENCE BLOCK ***** 19 | 20 | import bpy 21 | from bpy.props import * 22 | from bpy.types import Operator, AddonPreferences 23 | import os 24 | import shutil 25 | 26 | 27 | class EX_MainPanel(bpy.types.Panel): 28 | bl_label = "Exchanger" 29 | bl_space_type = 'VIEW_3D' 30 | bl_region_type = 'TOOLS' 31 | bl_context = "objectmode" 32 | bl_category = 'Ex' 33 | #bl_options = {'DEFAULT_CLOSED'} 34 | 35 | def draw(self, context): 36 | layout = self.layout 37 | scene = context.scene 38 | b_exchanger = bpy.context.scene.b_exchanger 39 | 40 | # GUI 41 | row = layout.row() 42 | 43 | col = row.column() 44 | 45 | col.operator("ex_export.exchanger", text="Export") 46 | #op.world_scale = 1.0 47 | col.operator("ex_import.exchanger", text="Import") 48 | #op.world_scale = 1.0 49 | 50 | layout.separator() 51 | 52 | row = layout.row() 53 | op = col.operator("ex_export.exchanger", text="ExportHoudini") 54 | op.world_scale = 0.01 55 | op = col.operator("ex_import.exchanger", text="ImportHoudini") 56 | op.world_scale = 100.0 57 | 58 | row = layout.row() 59 | row.prop(b_exchanger, "doApplyModifiers", text="Apply Modifiers") 60 | row = layout.row() 61 | row.prop(b_exchanger, "exportMaterials", text="Export Materials") 62 | row = layout.row() 63 | row.prop(b_exchanger, "importNormals", text="Import Normals") 64 | 65 | 66 | class EX_AddonPreferences(AddonPreferences): 67 | # this must match the addon name, use '__package__' 68 | # when defining this in a submodule of a python package. 69 | # bl_idname = __name__ 70 | bl_idname = __package__ 71 | 72 | exchangedir = StringProperty( 73 | name="ExchangeFolder", 74 | subtype="DIR_PATH", 75 | default="", 76 | ) 77 | 78 | def draw(self, context): 79 | layout = self.layout 80 | row = layout.row() 81 | row.label(text="Please, set Exchanges Folder and save Preferences") 82 | row = layout.row() 83 | row.prop(self, "exchangedir") 84 | 85 | 86 | class EX_ExportScene(bpy.types.Operator): 87 | bl_idname = "ex_export.exchanger" 88 | bl_label = "Export your custom property" 89 | bl_description = "Export your custom property" 90 | bl_options = {'UNDO'} 91 | 92 | world_scale = FloatProperty( default=1.0 ) 93 | 94 | def invoke(self, context, event): 95 | # Addon Preferences 96 | user_preferences = context.user_preferences 97 | addon_prefs = user_preferences.addons[__package__].preferences 98 | 99 | b_exchanger = bpy.context.scene.b_exchanger 100 | scene = context.scene 101 | 102 | exchange_dir = addon_prefs.exchangedir.replace("\\", os.sep) 103 | if exchange_dir.endswith(os.sep) is False: 104 | exchange_dir += os.sep 105 | 106 | if len(bpy.context.selected_objects) > 0 and os.path.isdir(addon_prefs.exchangedir): 107 | 108 | # change render levl of susurf and multires for good export 109 | fix_modidiers = [] 110 | for obj in bpy.context.selected_objects: 111 | for mod in obj.modifiers: 112 | if mod.type in {'SUBSURF', 'MULTIRES'}: 113 | fix_modidiers.append((mod, mod.render_levels)) 114 | 115 | if mod.show_viewport is False: 116 | mod.render_levels = 0 117 | else: 118 | mod.render_levels = mod.levels 119 | 120 | # Export setings 121 | model_path = exchange_dir + "exchange.fbx" 122 | apply_modifiers = b_exchanger.doApplyModifiers 123 | 124 | # Export Model 125 | bpy.ops.export_scene.fbx(filepath=model_path, check_existing=True, axis_forward='-Z', axis_up='Y', use_selection=True, global_scale=self.world_scale, apply_unit_scale=True, bake_space_transform=True, use_mesh_modifiers=apply_modifiers, use_custom_props=True, primary_bone_axis='Y', secondary_bone_axis='X') 126 | 127 | # revert render level of modifiers back 128 | for mod_stuff in fix_modidiers: 129 | mod_stuff[0].render_levels = mod_stuff[1] 130 | fix_modidiers = None # clear array 131 | 132 | else: 133 | self.report( 134 | {'INFO'}, "No Selected Objects or Bad Exchange Folder!!!") 135 | 136 | return {'FINISHED'} 137 | 138 | 139 | class EX_ImportScene(bpy.types.Operator): 140 | bl_idname = "ex_import.exchanger" 141 | bl_label = "import your custom property" 142 | bl_description = "import your custom property" 143 | bl_options = {'UNDO'} 144 | 145 | world_scale = FloatProperty( default=1.0 ) 146 | 147 | def invoke(self, context, event): 148 | # Addon Preferences 149 | user_preferences = context.user_preferences 150 | addon_prefs = user_preferences.addons[__package__].preferences 151 | 152 | scene = context.scene 153 | b_exchanger = bpy.context.scene.b_exchanger 154 | 155 | exchange_dir = addon_prefs.exchangedir.replace("\\", os.sep) 156 | if exchange_dir.endswith(os.sep) is False: 157 | exchange_dir += os.sep 158 | 159 | if os.path.isdir(exchange_dir): 160 | 161 | ## fix for animation removement for Modo 162 | #scene_objects = [] 163 | #for obj in bpy.context.scene.objects: 164 | #scene_objects.append(obj.name) 165 | 166 | # Import setings 167 | model_path = exchange_dir + "exchange.fbx" 168 | importNormals = b_exchanger.importNormals 169 | 170 | # IMPORT 171 | bpy.ops.import_scene.fbx(filepath=model_path, axis_forward='-Z', axis_up='Y', global_scale=self.world_scale, bake_space_transform=True, use_custom_normals=importNormals, force_connect_children=False, primary_bone_axis='Y', secondary_bone_axis='X', use_prepost_rot=True) 172 | 173 | ## remove animatrins. Fix for Modo 174 | #for obj in scene.objects: 175 | #if obj.name not in scene_objects: 176 | #obj.animation_data.action.use_fake_user = False 177 | #obj.animation_data.action = None 178 | 179 | #scene_objects = None # clear 180 | 181 | else: 182 | self.report({'INFO'}, "Bad Exchange Folder!!!") 183 | 184 | return {'FINISHED'} 185 | -------------------------------------------------------------------------------- /other/exchangers/blender/2.8/blender_exchanger/__init__.py: -------------------------------------------------------------------------------- 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 | 19 | bl_info = { 20 | "name": "Blender Exchanger", 21 | "author": "Pavel Geraskin", 22 | "version": (0, 1), 23 | "blender": (2, 80, 0), 24 | "location": "3D Viewport", 25 | "description": "Transfer data between Blender and other packages", 26 | "warning": "", 27 | "wiki_url": "", 28 | "support": 'COMMUNITY', 29 | "category": "Object", 30 | } 31 | 32 | 33 | if "bpy" in locals(): 34 | import imp 35 | imp.reload(blender_exchanger) 36 | else: 37 | from . import blender_exchanger 38 | 39 | 40 | import bpy 41 | from bpy.props import * 42 | 43 | 44 | class EX_Settings(bpy.types.PropertyGroup): 45 | 46 | doApplyModifiers: BoolProperty( 47 | name="Apply Modifiers", 48 | description="Apply Modifiers...", 49 | default=True 50 | ) 51 | 52 | exportMaterials: BoolProperty( 53 | name="Export Materials", 54 | description="Export Materials...", 55 | default=True 56 | ) 57 | 58 | importNormals: BoolProperty( 59 | name="Import Normals", 60 | description="Import Normals...", 61 | default=False 62 | ) 63 | 64 | 65 | classes = ( 66 | blender_exchanger.EX_ExportScene, 67 | blender_exchanger.EX_ImportScene, 68 | blender_exchanger.EX_MainPanel, 69 | blender_exchanger.EX_AddonPreferences, 70 | EX_Settings 71 | ) 72 | 73 | def register(): 74 | for cls in classes: 75 | bpy.utils.register_class(cls) 76 | 77 | bpy.types.Scene.b_exchanger = PointerProperty(name="Applink Variables", type=EX_Settings, description="Applink variables") 78 | 79 | 80 | def unregister(): 81 | import bpy 82 | 83 | for cls in classes: 84 | bpy.utils.unregister_class(cls) 85 | 86 | del bpy.types.Scene.b_exchanger 87 | #bpy.utils.unregister_module(__name__) 88 | 89 | 90 | if __name__ == "__main__": 91 | register() 92 | -------------------------------------------------------------------------------- /other/exchangers/houdini/exchanger.py: -------------------------------------------------------------------------------- 1 | def get_exchange_path(): 2 | return '' -------------------------------------------------------------------------------- /other/exchangers/houdini/exchanger.shelf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 45 | 46 | 47 | 48 | 73 | 74 | 75 | 76 | 103 | 104 | 105 | 106 | 122 | 123 | 124 | -------------------------------------------------------------------------------- /other/exchangers/max/test.ms: -------------------------------------------------------------------------------- 1 | pluginManager.loadClass FBXIMP 2 | FbxImporterSetParam "SmoothingGroups" true 3 | importfile "C:\Users\GeraskinPA\Documents\Exchange\exchange.fbx" #noPrompt using:FBXIMP 4 | rescaleWorldUnits 100 #selOnly 5 | -------------------------------------------------------------------------------- /other/exchangers/modo/ex_code/ex_export.py: -------------------------------------------------------------------------------- 1 | # python 2 | 3 | import lx 4 | #import modo 5 | import os 6 | 7 | 8 | export_type_old = lx.eval('user.value sceneio.fbx.save.exportType ?') 9 | sample_type_old = lx.eval('user.value sceneio.fbx.save.sampleAnimation ?') 10 | save_type_old = lx.eval('user.value sceneio.fbx.save.animation ?') 11 | 12 | # change scene type 13 | lx.eval('user.value sceneio.fbx.save.exportType FBXExportSelectionWithHierarchy') 14 | lx.eval('user.value sceneio.fbx.save.sampleAnimation true') 15 | lx.eval('user.value sceneio.fbx.save.animation true') 16 | 17 | # save scene 18 | exp_path = lx.eval('user.value exPath ?').replace("\\", os.sep) 19 | if exp_path.endswith(os.sep) is False: 20 | exp_path += os.sep 21 | exp_path += 'exchange.fbx' 22 | lx.eval('scene.saveAs {%s} fbx true' % exp_path) 23 | 24 | # revert scene type 25 | lx.eval('user.value sceneio.fbx.save.exportType %s' % export_type_old) 26 | lx.eval('user.value sceneio.fbx.save.animation %s' % save_type_old) 27 | lx.eval('user.value sceneio.fbx.save.sampleAnimation %s' % sample_type_old) -------------------------------------------------------------------------------- /other/exchangers/modo/ex_code/ex_import.py: -------------------------------------------------------------------------------- 1 | # python 2 | 3 | import os 4 | #import modo 5 | import lx 6 | 7 | 8 | # load scene 9 | ex_path = lx.eval('user.value exPath ?').replace("\\", os.sep) 10 | if ex_path.endswith(os.sep) is False: 11 | ex_path += os.sep 12 | ex_path += 'exchange.fbx' 13 | lx.eval('loaderOptions.fbx false true false true true true true true false false true true false true 0') 14 | 15 | if lx.eval('user.value importDialog ?') == 1: 16 | lx.eval('scene.open {%s} import' % ex_path) 17 | else: 18 | lx.eval('!scene.open {%s} import' % ex_path) -------------------------------------------------------------------------------- /other/exchangers/modo/exchanger_config.CFG: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Ex 6 | mifth 7 | 8 | 49.50.53 9 | 10 | 11 | Export 12 | Export to other apps 13 | 0 14 | 15 | 16 | Import 17 | Import to other apps 18 | 0 19 | 20 | 21 | Path 22 | Exchange Path... 23 | Exchange Path. 24 | 0 25 | 26 | 27 | Import 28 | Show Import Dialog... 29 | Show Import Dialog. 30 | 0 31 | 32 | 33 | 34 | 35 | 36 | 37 | string 38 | 39 | 40 | boolean 41 | 42 | 43 | 44 | --------------------------------------------------------------------------------