Skip to content
Snippets Groups Projects
Select Git revision
  • 93cd3f9a9be7f97b150d7d9b58a9506bd9a0fbe3
  • master default protected
  • blender-v3.6-release
  • main
  • blender-v4.1-release
  • blender-v4.0-release
  • blender-v3.3-release
  • asset-shelf
  • blender-v3.5-release
  • brush-assets-project
  • blender-v2.93-release
  • blender-v3.4-release
  • xr-dev
  • bholodeck-v3.3
  • blender-v3.2-release
  • temp-xr-tracker
  • blender-v3.1-release
  • screenshots-manual
  • gltf_vtree
  • blender-v2.83-release
  • blender-v3.0-release
  • v3.6.18
  • v3.6.19
  • v3.6.20
  • v3.6.21
  • v3.6.22
  • v3.6.23
  • v4.1.1
  • v4.1.0
  • v3.6.10
  • v3.6.11
  • v3.6.12
  • v3.6.13
  • v3.6.14
  • v3.6.15
  • v3.6.16
  • v3.6.17
  • v3.6.9
  • v3.3.16
  • v3.6.8
  • v3.3.15
41 results

preferences.py

Blame
  • user avatar
    mano-wii authored
    Rename files, and split the `common_classes.py` file into `drawing_utilities.py`, `navigation_ops.py` and `widgets.py`
    93cd3f9a
    History
    preferences.py 4.02 KiB
    ### BEGIN GPL LICENSE BLOCK #####
    #
    #  This program is free software; you can redistribute it and/or
    #  modify it under the terms of the GNU General Public License
    #  as published by the Free Software Foundation; either version 3
    #  of the License, or (at your option) any later version.
    #
    #  This program is distributed in the hope that it will be useful,
    #  but WITHOUT ANY WARRANTY; without even the implied warranty of
    #  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    #  GNU General Public License for more details.
    #
    #  You should have received a copy of the GNU General Public License
    #  along with this program.  If not, see <http://www.gnu.org/licenses/>.
    #
    # ##### END GPL LICENSE BLOCK #####
    
    import bpy
    from bpy.props import (
        EnumProperty,
        StringProperty,
        BoolProperty,
        IntProperty,
        FloatVectorProperty,
        FloatProperty,
        )
    
    
    class SnapUtilitiesPreferences(bpy.types.AddonPreferences):
        # this must match the addon name, use '__package__'
        # when defining this in a submodule of a python package.
        bl_idname = __package__
    
        intersect: BoolProperty(
                name="Intersect",
                description="intersects created line with the existing edges, even if the lines do not intersect",
                default=True)
    
        create_face: BoolProperty(
                name="Create faces",
                description="Create faces defined by enclosed edges",
                default=False)
    
        outer_verts: BoolProperty(
                name="Snap to outer vertices",
                description="The vertices of the objects are not activated also snapped",
                default=True)
    
        increments_grid: BoolProperty(
                name="Increments of Grid",
                description="Snap to increments of grid",
                default=False)
    
        incremental: FloatProperty(
                name="Incremental",
                description="Snap in defined increments",
                default=0,
                min=0,
                step=1,
                precision=3)
    
        relative_scale: FloatProperty(
                name="Relative Scale",
                description="Value that divides the global scale",
                default=1,
                min=0,
                step=1,
                precision=3)
    
        out_color: FloatVectorProperty(name="OUT", default=(0.0, 0.0, 0.0, 0.5), size=4, subtype="COLOR", min=0, max=1)
        face_color: FloatVectorProperty(name="FACE", default=(1.0, 0.8, 0.0, 0.5), size=4, subtype="COLOR", min=0, max=1)
        edge_color: FloatVectorProperty(name="EDGE", default=(0.0, 0.8, 1.0, 0.5), size=4, subtype="COLOR", min=0, max=1)
        vert_color: FloatVectorProperty(name="VERT", default=(1.0, 0.5, 0.0, 0.5), size=4, subtype="COLOR", min=0, max=1)
        center_color: FloatVectorProperty(name="CENTER", default=(1.0, 0.0, 1.0, 1.0), size=4, subtype="COLOR", min=0, max=1)
        perpendicular_color: FloatVectorProperty(name="PERPENDICULAR", default=(0.1, 0.5, 0.5, 1.0), size=4, subtype="COLOR", min=0, max=1)
        constrain_shift_color: FloatVectorProperty(name="SHIFT CONSTRAIN", default=(0.8, 0.5, 0.4, 1.0), size=4, subtype="COLOR", min=0, max=1)
    
        def draw(self, context):
            layout = self.layout
    
            layout.label(text="Snap Colors:")
            split = layout.split()
    
            col = split.column()
            col.prop(self, "out_color")
            col.prop(self, "constrain_shift_color")
            col = split.column()
            col.prop(self, "face_color")
            col = split.column()
            col.prop(self, "edge_color")
            col = split.column()
            col.prop(self, "vert_color")
            col = split.column()
            col.prop(self, "center_color")
            col = split.column()
            col.prop(self, "perpendicular_color")
    
            row = layout.row()
    
            col = row.column()
            #col.label(text="Snap Items:")
            col.prop(self, "incremental")
            col.prop(self, "increments_grid")
            if self.increments_grid:
                col.prop(self, "relative_scale")
    
            col.prop(self, "outer_verts")
            row.separator()
    
            col = row.column()
            col.label(text="Line Tool:")
            col.prop(self, "intersect")
            col.prop(self, "create_face")