text stringlengths 1 93.6k |
|---|
Context,
|
UILayout
|
)
|
from bpy.props import (
|
BoolProperty,
|
FloatProperty,
|
IntProperty,
|
)
|
class GIZMODAL_OPS_APT_preferences(AddonPreferences):
|
bl_idname = __package__
|
time_window: FloatProperty(
|
name="Time Window",
|
description="The time frame, while Gizmodal Ops listens for additional keypresses",
|
default=2,
|
max=5,
|
min=1,
|
precision=1,
|
subtype="TIME" # IDEA: TIME_ABSOLUTE is a thing since 3.0
|
)
|
mouse_sensitivity: IntProperty(
|
name="Mouse sensitivity",
|
description="How sensitive Gizmodal Ops should react to mouse moves.",
|
default=10,
|
min=0,
|
max=10
|
)
|
auto_lock_to_view: BoolProperty(
|
name="Auto",
|
description="Automatically switch to Lock to view Axis when pressing G / R / S.",
|
default=False
|
)
|
def draw(self, context: Context):
|
layout: UILayout = self.layout
|
# Add a sublayout for the addon description.
|
description_col = layout.column()
|
description_col.scale_y = 0.8
|
# Addon description
|
description_col.label(text="Press G / R / S to show the Gizmo,")
|
description_col.label(
|
text="then a short time window allows you to activate Modal Operations")
|
description_col.label(text="by pressing X / Y / Z (etc).")
|
description_col.separator(factor=2.5)
|
description_col.label(
|
text="Hold G / R / S + move mouse to activate Lock to View Axis.")
|
description_col.separator(factor=7.5)
|
description_col.label(
|
text="Supports default Blender keymap. Compatibility with other keymaps will vary.", icon="ERROR")
|
classes = (
|
GIZMODAL_OPS_APT_preferences,
|
)
|
def register():
|
for cls in classes:
|
bpy.utils.register_class(cls)
|
def unregister():
|
for cls in reversed(classes):
|
bpy.utils.unregister_class(cls)
|
# <FILESEP>
|
#! /usr/bin/python3
|
# coding: utf-8
|
import logging
|
import os
|
import shutil
|
import subprocess
|
import sys
|
from axmlparserpy.axmlprinter import AXMLPrinter
|
from chardet import detect
|
from defusedxml.minidom import parseString
|
from hashlib import md5 as _md5
|
from json import load as json_load
|
from re import findall as re_findall
|
from shlex import split as shlex_split
|
from typing import List, NoReturn, Tuple, Union
|
from yaml import safe_load
|
from zipfile import ZipFile
|
log = logging.getLogger(__name__)
|
log.setLevel(logging.DEBUG)
|
handler1 = logging.FileHandler('log.txt', encoding='utf-8')
|
handler1.setLevel(logging.DEBUG)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.