Python: use fields

This commit is contained in:
Campbell Barton 2018-07-12 15:09:15 +02:00
parent 8a9cc98ff1
commit 9dc19735c3
8 changed files with 228 additions and 204 deletions

View File

@ -179,26 +179,26 @@ def token_expires() -> typing.Optional[datetime.datetime]:
class BlenderIdPreferences(AddonPreferences):
bl_idname = __name__
error_message = StringProperty(
error_message: StringProperty(
name='Error Message',
default='',
options={'HIDDEN', 'SKIP_SAVE'}
options={'HIDDEN', 'SKIP_SAVE'},
)
ok_message = StringProperty(
ok_message: StringProperty(
name='Message',
default='',
options={'HIDDEN', 'SKIP_SAVE'}
options={'HIDDEN', 'SKIP_SAVE'},
)
blender_id_username = StringProperty(
blender_id_username: StringProperty(
name='E-mail address',
default='',
options={'HIDDEN', 'SKIP_SAVE'}
options={'HIDDEN', 'SKIP_SAVE'},
)
blender_id_password = StringProperty(
blender_id_password: StringProperty(
name='Password',
default='',
options={'HIDDEN', 'SKIP_SAVE'},
subtype='PASSWORD'
subtype='PASSWORD',
)
def reset_messages(self):

View File

@ -50,12 +50,12 @@ from bpy.props import (
# Note: bones are stored by name, this means that if the bone is renamed,
# there can be problems. However, bone renaming is unlikely during animation
class SelectionEntry(PropertyGroup):
name = StringProperty(name="Bone Name")
name: StringProperty(name="Bone Name")
class SelectionSet(PropertyGroup):
name = StringProperty(name="Set Name")
bone_ids = CollectionProperty(type=SelectionEntry)
name: StringProperty(name="Set Name")
bone_ids: CollectionProperty(type=SelectionEntry)
# UI Panel w/ UIList ##########################################################
@ -210,7 +210,7 @@ class POSE_OT_selection_set_move(NeedSelSetPluginOperator):
bl_description = "Move the active Selection Set up/down the list of sets"
bl_options = {'UNDO', 'REGISTER'}
direction = EnumProperty(
direction: EnumProperty(
name="Move Direction",
description="Direction to move the active Selection Set: UP (default) or DOWN",
items=[
@ -334,10 +334,11 @@ class POSE_OT_selection_set_select(NeedSelSetPluginOperator):
bl_description = "Add Selection Set bones to current selection"
bl_options = {'UNDO', 'REGISTER'}
selection_set_index = IntProperty(
selection_set_index: IntProperty(
name='Selection Set Index',
default=-1,
description='Which Selection Set to select; -1 uses the active Selection Set')
description='Which Selection Set to select; -1 uses the active Selection Set',
)
def execute(self, context):
arm = context.object

View File

@ -48,12 +48,12 @@ def _get_depsgraph(context):
# Save data from depsgraph to a specified file.
class SCENE_OT_depsgraph_save_common:
filepath = StringProperty(
name="File Path",
description="Filepath used for saving the file",
maxlen=1024,
subtype='FILE_PATH',
)
filepath: StringProperty(
name="File Path",
description="Filepath used for saving the file",
maxlen=1024,
subtype='FILE_PATH',
)
def _getExtension(self, context):
return ""
@ -86,8 +86,10 @@ class SCENE_OT_depsgraph_save_common:
pass
class SCENE_OT_depsgraph_relations_graphviz(Operator,
SCENE_OT_depsgraph_save_common):
class SCENE_OT_depsgraph_relations_graphviz(
Operator,
SCENE_OT_depsgraph_save_common,
):
bl_idname = "scene.depsgraph_relations_graphviz"
bl_label = "Save Depsgraph"
bl_description = "Save current scene's dependency graph to a graphviz file"
@ -102,8 +104,10 @@ class SCENE_OT_depsgraph_relations_graphviz(Operator,
return True
class SCENE_OT_depsgraph_stats_gnuplot(Operator,
SCENE_OT_depsgraph_save_common):
class SCENE_OT_depsgraph_stats_gnuplot(
Operator,
SCENE_OT_depsgraph_save_common,
):
bl_idname = "scene.depsgraph_stats_gnuplot"
bl_label = "Save Depsgraph Stats"
bl_description = "Save current scene's evaluaiton stats to gnuplot file"

View File

@ -154,50 +154,61 @@ class IV_Preferences(bpy.types.AddonPreferences):
def set_panel_filter(self, value):
self.panel_icons.filter = value
panel_filter = bpy.props.StringProperty(
panel_filter: bpy.props.StringProperty(
description="Filter",
default="",
get=lambda s: s.panel_icons.filter,
set=set_panel_filter,
options={'TEXTEDIT_UPDATE'})
show_panel_icons = bpy.props.BoolProperty(
options={'TEXTEDIT_UPDATE'},
)
show_panel_icons: bpy.props.BoolProperty(
name="Show Icons",
description="Show icons", default=True)
show_history = bpy.props.BoolProperty(
description="Show icons", default=True,
)
show_history: bpy.props.BoolProperty(
name="Show History",
description="Show history", default=True)
show_brush_icons = bpy.props.BoolProperty(
description="Show history", default=True,
)
show_brush_icons: bpy.props.BoolProperty(
name="Show Brush Icons",
description="Show brush icons", default=True,
update=update_icons)
show_matcap_icons = bpy.props.BoolProperty(
update=update_icons,
)
show_matcap_icons: bpy.props.BoolProperty(
name="Show Matcap Icons",
description="Show matcap icons", default=True,
update=update_icons)
show_colorset_icons = bpy.props.BoolProperty(
update=update_icons,
)
show_colorset_icons: bpy.props.BoolProperty(
name="Show Colorset Icons",
description="Show colorset icons", default=True,
update=update_icons)
copy_on_select = bpy.props.BoolProperty(
update=update_icons,
)
copy_on_select: bpy.props.BoolProperty(
name="Copy Icon On Click",
description="Copy icon on click", default=True)
close_on_select = bpy.props.BoolProperty(
description="Copy icon on click", default=True,
)
close_on_select: bpy.props.BoolProperty(
name="Close Popup On Click",
description=(
"Close the popup on click.\n"
"Not supported by some windows (User Preferences, Render)"
),
default=False)
auto_focus_filter = bpy.props.BoolProperty(
default=False,
)
auto_focus_filter: bpy.props.BoolProperty(
name="Auto Focus Input Field",
description="Auto focus input field", default=True)
show_panel = bpy.props.BoolProperty(
description="Auto focus input field", default=True,
)
show_panel: bpy.props.BoolProperty(
name="Show Panel",
description="Show the panel in the Text Editor", default=True)
show_header = bpy.props.BoolProperty(
description="Show the panel in the Text Editor", default=True,
)
show_header: bpy.props.BoolProperty(
name="Show Header",
description="Show the header in the Python Console",
default=True)
default=True,
)
def draw(self, context):
layout = self.layout

View File

@ -56,207 +56,207 @@ def register():
bpy.coat3D['kuva'] = 1
class ObjectCoat3D(PropertyGroup):
objpath = StringProperty(
objpath: StringProperty(
name="Object_Path"
)
applink_address = StringProperty(
)
applink_address: StringProperty(
name="Object_Applink_address"
)
applink_name = StringProperty(
)
applink_name: StringProperty(
name="Applink object name"
)
applink_group = StringProperty(
)
applink_group: StringProperty(
name="Applink group"
)
applink_skip = StringProperty(
applink_skip: StringProperty(
name="Object_Applink_Update",
default="False"
)
applink_firsttime = BoolProperty(
applink_firsttime: BoolProperty(
name="FirstTime",
description="FirstTime",
default=True
)
coatpath = StringProperty(
coatpath: StringProperty(
name="Coat_Path"
)
objectdir = StringProperty(
)
objectdir: StringProperty(
name="ObjectPath",
subtype="FILE_PATH"
)
objecttime = StringProperty(
)
objecttime: StringProperty(
name="ObjectTime",
subtype="FILE_PATH"
)
texturefolder = StringProperty(
)
texturefolder: StringProperty(
name="Texture folder:",
subtype="DIR_PATH"
)
path3b = StringProperty(
)
path3b: StringProperty(
name="3B Path",
subtype="FILE_PATH"
)
export_on = BoolProperty(
)
export_on: BoolProperty(
name="Export_On",
description="Add Modifiers and export",
default=False
)
dime = FloatVectorProperty(
)
dime: FloatVectorProperty(
name="dime",
description="Dimension"
)
loc = FloatVectorProperty(
)
loc: FloatVectorProperty(
name="Location",
description="Location"
)
rot = FloatVectorProperty(
)
rot: FloatVectorProperty(
name="Rotation",
description="Rotation",
subtype='EULER'
)
sca = FloatVectorProperty(
)
sca: FloatVectorProperty(
name="Scale",
description="Scale"
)
)
class SceneCoat3D(PropertyGroup):
defaultfolder = StringProperty(
defaultfolder: StringProperty(
name="FilePath",
subtype="DIR_PATH",
)
cursor_loc = FloatVectorProperty(
)
cursor_loc: FloatVectorProperty(
name="Cursor_loc",
description="location"
)
exchangedir = StringProperty(
)
exchangedir: StringProperty(
name="FilePath",
subtype="DIR_PATH"
)
exchangefolder = StringProperty(
)
exchangefolder: StringProperty(
name="FilePath",
subtype="DIR_PATH"
)
wasactive = StringProperty(
)
wasactive: StringProperty(
name="Pass active object",
)
import_box = BoolProperty(
)
import_box: BoolProperty(
name="Import window",
description="Allows to skip import dialog",
default=True
)
exchange_found = BoolProperty(
)
exchange_found: BoolProperty(
name="Exchange Found",
description="Alert if Exchange folder is not found",
default=True
)
export_box = BoolProperty(
)
export_box: BoolProperty(
name="Export window",
description="Allows to skip export dialog",
default=True
)
export_color = BoolProperty(
)
export_color: BoolProperty(
name="Export color",
description="Export color texture",
default=True
)
export_spec = BoolProperty(
)
export_spec: BoolProperty(
name="Export specular",
description="Export specular texture",
default=True
)
export_normal = BoolProperty(
)
export_normal: BoolProperty(
name="Export Normal",
description="Export normal texture",
default=True
)
export_disp = BoolProperty(
)
export_disp: BoolProperty(
name="Export Displacement",
description="Export displacement texture",
default=True
)
export_position = BoolProperty(
)
export_position: BoolProperty(
name="Export Source Position",
description="Export source position",
default=True
)
export_zero_layer = BoolProperty(
)
export_zero_layer: BoolProperty(
name="Export from Layer 0",
description="Export mesh from Layer 0",
default=True
)
export_coarse = BoolProperty(
)
export_coarse: BoolProperty(
name="Export Coarse",
description="Export Coarse",
default=True
)
exportfile = BoolProperty(
)
exportfile: BoolProperty(
name="No Import File",
description="Add Modifiers and export",
default=False
)
importmod = BoolProperty(
)
importmod: BoolProperty(
name="Remove Modifiers",
description="Import and add modifiers",
default=False
)
exportmod = BoolProperty(
)
exportmod: BoolProperty(
name="Modifiers",
description="Export modifiers",
default=False
)
export_pos = BoolProperty(
)
export_pos: BoolProperty(
name="Remember Position",
description="Remember position",
default=True
)
importtextures = BoolProperty(
)
importtextures: BoolProperty(
name="Bring Textures",
description="Import Textures",
default=True
)
importlevel = BoolProperty(
)
importlevel: BoolProperty(
name="Multires. Level",
description="Bring Specific Multires Level",
default=False
)
exportover = BoolProperty(
)
exportover: BoolProperty(
name="Export Obj",
description="Import Textures",
default=False
)
importmesh = BoolProperty(
)
importmesh: BoolProperty(
name="Mesh",
description="Import Mesh",
default=True
)
)
# copy location
loca = FloatVectorProperty(
loca: FloatVectorProperty(
name="location",
description="Location",
subtype="XYZ",
default=(0.0, 0.0, 0.0)
)
rota = FloatVectorProperty(
)
rota: FloatVectorProperty(
name="location",
description="Location",
subtype="EULER",
default=(0.0, 0.0, 0.0)
)
scal = FloatVectorProperty(
)
scal: FloatVectorProperty(
name="location",
description="Location",
subtype="XYZ",
default=(0.0, 0.0, 0.0)
)
dime = FloatVectorProperty(
)
dime: FloatVectorProperty(
name="dimension",
description="Dimension",
subtype="XYZ",
default=(0.0, 0.0, 0.0)
)
type = EnumProperty(
)
type: EnumProperty(
name="Export Type",
description="Different Export Types",
items=(("ppp", "Per-Pixel Painting", ""),
@ -270,9 +270,9 @@ def register():
("prim", "Mesh As Voxel Primitive", ""),
("curv", "Mesh As a Curve Profile", ""),
("autopo", "Mesh For Auto-retopology", ""),
),
),
default="ppp"
)
)
bpy.utils.register_module(__name__)
@ -280,12 +280,12 @@ def register():
name="Applink Variables",
type=ObjectCoat3D,
description="Applink variables"
)
)
bpy.types.Scene.coat3D = PointerProperty(
name="Applink Variables",
type=SceneCoat3D,
description="Applink variables"
)
)
def unregister():

View File

@ -52,7 +52,7 @@ class ImportSVG(bpy.types.Operator, ImportHelper):
bl_options = {'UNDO'}
filename_ext = ".svg"
filter_glob = StringProperty(default="*.svg", options={'HIDDEN'})
filter_glob: StringProperty(default="*.svg", options={'HIDDEN'})
def execute(self, context):
from . import import_svg
@ -67,13 +67,13 @@ def menu_func_import(self, context):
def register():
bpy.utils.register_module(__name__)
bpy.utils.register_class(ImportSVG)
bpy.types.INFO_MT_file_import.append(menu_func_import)
def unregister():
bpy.utils.unregister_module(__name__)
bpy.utils.unregister_class(ImportSVG)
bpy.types.INFO_MT_file_import.remove(menu_func_import)

View File

@ -31,7 +31,15 @@ bl_info = {
import bpy, blf, bgl
from bpy.types import Operator, Panel, Menu
from bpy.props import FloatProperty, EnumProperty, BoolProperty, IntProperty, StringProperty, FloatVectorProperty, CollectionProperty
from bpy.props import (
FloatProperty,
EnumProperty,
BoolProperty,
IntProperty,
StringProperty,
FloatVectorProperty,
CollectionProperty,
)
from bpy_extras.io_utils import ImportHelper, ExportHelper
from mathutils import Vector
from math import cos, sin, pi, hypot
@ -996,39 +1004,39 @@ def get_nodes_links(context):
# Principled prefs
class NWPrincipledPreferences(bpy.types.PropertyGroup):
base_color = StringProperty(
base_color: StringProperty(
name='Base Color',
default='diffuse diff albedo base col color',
description='Naming Components for Base Color maps')
sss_color = StringProperty(
sss_color: StringProperty(
name='Subsurface Color',
default='sss subsurface',
description='Naming Components for Subsurface Color maps')
metallic = StringProperty(
metallic: StringProperty(
name='Metallic',
default='metallic metalness metal mtl',
description='Naming Components for metallness maps')
specular = StringProperty(
specular: StringProperty(
name='Specular',
default='specularity specular spec spc',
description='Naming Components for Specular maps')
normal = StringProperty(
normal: StringProperty(
name='Normal',
default='normal nor nrm nrml norm',
description='Naming Components for Normal maps')
bump = StringProperty(
bump: StringProperty(
name='Bump',
default='bump bmp',
description='Naming Components for bump maps')
rough = StringProperty(
rough: StringProperty(
name='Roughness',
default='roughness rough rgh',
description='Naming Components for roughness maps')
gloss = StringProperty(
gloss: StringProperty(
name='Gloss',
default='gloss glossy glossyness',
description='Naming Components for glossy maps')
displacement = StringProperty(
displacement: StringProperty(
name='Displacement',
default='displacement displace disp dsp height heightmap',
description='Naming Components for displacement maps')
@ -1037,7 +1045,7 @@ class NWPrincipledPreferences(bpy.types.PropertyGroup):
class NWNodeWrangler(bpy.types.AddonPreferences):
bl_idname = __name__
merge_hide = EnumProperty(
merge_hide: EnumProperty(
name="Hide Mix nodes",
items=(
("ALWAYS", "Always", "Always collapse the new merge nodes"),
@ -1046,7 +1054,7 @@ class NWNodeWrangler(bpy.types.AddonPreferences):
),
default='NON_SHADER',
description="When merging nodes with the Ctrl+Numpad0 hotkey (and similar) specifiy whether to collapse them or show the full node with options expanded")
merge_position = EnumProperty(
merge_position: EnumProperty(
name="Mix Node Position",
items=(
("CENTER", "Center", "Place the Mix node between the two nodes"),
@ -1055,22 +1063,22 @@ class NWNodeWrangler(bpy.types.AddonPreferences):
default='CENTER',
description="When merging nodes with the Ctrl+Numpad0 hotkey (and similar) specifiy the position of the new nodes")
show_hotkey_list = BoolProperty(
show_hotkey_list: BoolProperty(
name="Show Hotkey List",
default=False,
description="Expand this box into a list of all the hotkeys for functions in this addon"
)
hotkey_list_filter = StringProperty(
hotkey_list_filter: StringProperty(
name=" Filter by Name",
default="",
description="Show only hotkeys that have this text in their name"
)
show_principled_lists = BoolProperty(
show_principled_lists: BoolProperty(
name="Show Principled naming tags",
default=False,
description="Expand this box into a list of all naming tags for principled texture setup"
)
principled_tags = bpy.props.PointerProperty(type=NWPrincipledPreferences)
principled_tags: bpy.props.PointerProperty(type=NWPrincipledPreferences)
def draw(self, context):
layout = self.layout
@ -1219,7 +1227,7 @@ class NWLazyConnect(Operator, NWBase):
bl_idname = "node.nw_lazy_connect"
bl_label = "Lazy Connect"
bl_options = {'REGISTER', 'UNDO'}
with_menu = BoolProperty()
with_menu: BoolProperty()
def modal(self, context, event):
context.area.tag_redraw()
@ -1325,8 +1333,8 @@ class NWDeleteUnused(Operator, NWBase):
bl_label = 'Delete Unused Nodes'
bl_options = {'REGISTER', 'UNDO'}
delete_muted = BoolProperty(name="Delete Muted", description="Delete (but reconnect, like Ctrl-X) all muted nodes", default=True)
delete_frames = BoolProperty(name="Delete Empty Frames", description="Delete all frames that have no nodes inside them", default=True)
delete_muted: BoolProperty(name="Delete Muted", description="Delete (but reconnect, like Ctrl-X) all muted nodes", default=True)
delete_frames: BoolProperty(name="Delete Empty Frames", description="Delete all frames that have no nodes inside them", default=True)
def is_unused_node(self, node):
end_types = ['OUTPUT_MATERIAL', 'OUTPUT', 'VIEWER', 'COMPOSITE', \
@ -1791,7 +1799,7 @@ class NWSwitchNodeType(Operator, NWBase):
bl_label = "Switch Node Type"
bl_options = {'REGISTER', 'UNDO'}
to_type = EnumProperty(
to_type: EnumProperty(
name="Switch to type",
items=list(shaders_input_nodes_props) +
list(shaders_output_nodes_props) +
@ -2005,12 +2013,12 @@ class NWMergeNodes(Operator, NWBase):
bl_description = "Merge Selected Nodes"
bl_options = {'REGISTER', 'UNDO'}
mode = EnumProperty(
mode: EnumProperty(
name="mode",
description="All possible blend types and math operations",
items=blend_types + [op for op in operations if op not in blend_types],
)
merge_type = EnumProperty(
merge_type: EnumProperty(
name="merge type",
description="Type of Merge to be used",
items=(
@ -2256,11 +2264,11 @@ class NWBatchChangeNodes(Operator, NWBase):
bl_description = "Batch Change Blend Type and Math Operation"
bl_options = {'REGISTER', 'UNDO'}
blend_type = EnumProperty(
blend_type: EnumProperty(
name="Blend Type",
items=blend_types + navs,
)
operation = EnumProperty(
operation: EnumProperty(
name="Operation",
items=operations + navs,
)
@ -2322,7 +2330,7 @@ class NWChangeMixFactor(Operator, NWBase):
# option: Change factor.
# If option is 1.0 or 0.0 - set to 1.0 or 0.0
# Else - change factor by option value.
option = FloatProperty()
option: FloatProperty()
def execute(self, context):
nodes, links = get_nodes_links(context)
@ -2458,7 +2466,7 @@ class NWCopyLabel(Operator, NWBase):
bl_label = "Copy Label"
bl_options = {'REGISTER', 'UNDO'}
option = EnumProperty(
option: EnumProperty(
name="option",
description="Source of name of label",
items=(
@ -2502,7 +2510,7 @@ class NWClearLabel(Operator, NWBase):
bl_label = "Clear Label"
bl_options = {'REGISTER', 'UNDO'}
option = BoolProperty()
option: BoolProperty()
def execute(self, context):
nodes, links = get_nodes_links(context)
@ -2557,7 +2565,7 @@ class NWAddTextureSetup(Operator, NWBase):
bl_description = "Add Texture Node Setup to Selected Shaders"
bl_options = {'REGISTER', 'UNDO'}
add_mapping = BoolProperty(name="Add Mapping Nodes", description="Create coordinate and mapping nodes for the texture (ignored for selected texture nodes)", default=True)
add_mapping: BoolProperty(name="Add Mapping Nodes", description="Create coordinate and mapping nodes for the texture (ignored for selected texture nodes)", default=True)
@classmethod
def poll(cls, context):
@ -2888,7 +2896,7 @@ class NWAddReroutes(Operator, NWBase):
bl_description = "Add Reroutes to Outputs"
bl_options = {'REGISTER', 'UNDO'}
option = EnumProperty(
option: EnumProperty(
name="option",
items=[
('ALL', 'to all', 'Add to all outputs'),
@ -2988,9 +2996,9 @@ class NWLinkActiveToSelected(Operator, NWBase):
bl_label = "Link Active Node to Selected"
bl_options = {'REGISTER', 'UNDO'}
replace = BoolProperty()
use_node_name = BoolProperty()
use_outputs_names = BoolProperty()
replace: BoolProperty()
use_node_name: BoolProperty()
use_outputs_names: BoolProperty()
@classmethod
def poll(cls, context):
@ -3068,7 +3076,7 @@ class NWAlignNodes(Operator, NWBase):
bl_idname = "node.nw_align_nodes"
bl_label = "Align Nodes"
bl_options = {'REGISTER', 'UNDO'}
margin = IntProperty(name='Margin', default=50, description='The amount of space between nodes')
margin: IntProperty(name='Margin', default=50, description='The amount of space between nodes')
def execute(self, context):
nodes, links = get_nodes_links(context)
@ -3138,7 +3146,7 @@ class NWSelectParentChildren(Operator, NWBase):
bl_label = "Select Parent or Children"
bl_options = {'REGISTER', 'UNDO'}
option = EnumProperty(
option: EnumProperty(
name="option",
items=(
('PARENT', 'Select Parent', 'Select Parent Frame'),
@ -3259,8 +3267,8 @@ class NWMakeLink(Operator, NWBase):
bl_idname = 'node.nw_make_link'
bl_label = 'Make Link'
bl_options = {'REGISTER', 'UNDO'}
from_socket = IntProperty()
to_socket = IntProperty()
from_socket: IntProperty()
to_socket: IntProperty()
def execute(self, context):
nodes, links = get_nodes_links(context)
@ -3280,7 +3288,7 @@ class NWCallInputsMenu(Operator, NWBase):
bl_idname = 'node.nw_call_inputs_menu'
bl_label = 'Make Link'
bl_options = {'REGISTER', 'UNDO'}
from_socket = IntProperty()
from_socket: IntProperty()
def execute(self, context):
nodes, links = get_nodes_links(context)
@ -3443,8 +3451,8 @@ class NWViewerFocus(bpy.types.Operator):
bl_idname = "node.nw_viewer_focus"
bl_label = "Viewer Focus"
x = bpy.props.IntProperty()
y = bpy.props.IntProperty()
x: bpy.props.IntProperty()
y: bpy.props.IntProperty()
@classmethod
def poll(cls, context):
@ -3498,8 +3506,8 @@ class NWSaveViewer(bpy.types.Operator, ExportHelper):
"""Save the current viewer node to an image file"""
bl_idname = "node.nw_save_viewer"
bl_label = "Save This Image"
filepath = StringProperty(subtype="FILE_PATH")
filename_ext = EnumProperty(
filepath: StringProperty(subtype="FILE_PATH")
filename_ext: EnumProperty(
name="Format",
description="Choose the file format to save to",
items=(('.bmp', "PNG", ""),
@ -3733,11 +3741,11 @@ class NodeWranglerPanel(Panel, NWBase):
bl_region_type = "TOOLS"
bl_category = "Node Wrangler"
prepend = StringProperty(
prepend: StringProperty(
name='prepend',
)
append = StringProperty()
remove = StringProperty()
append: StringProperty()
remove: StringProperty()
def draw(self, context):
self.layout.label(text="(Quick access: Ctrl+Space)")

View File

@ -21,13 +21,13 @@
import bpy
from bpy.props import (
BoolProperty,
PointerProperty,
)
BoolProperty,
PointerProperty,
)
from bpy.types import (
PropertyGroup,
AddonPreferences,
)
PropertyGroup,
AddonPreferences,
)
bl_info = {
@ -149,18 +149,18 @@ def disable_all_modules(self, context):
class PieToolsPreferences(AddonPreferences):
bl_idname = __name__
enable_all = BoolProperty(
name="Enable all",
description="Enable all Pie Modules",
default=False,
update=enable_all_modules
)
disable_all = BoolProperty(
name="Disable all",
description="Disable all Pie Modules",
default=False,
update=disable_all_modules
)
enable_all: BoolProperty(
name="Enable all",
description="Enable all Pie Modules",
default=False,
update=enable_all_modules
)
disable_all: BoolProperty(
name="Disable all",
description="Disable all Pie Modules",
default=False,
update=disable_all_modules
)
def draw(self, context):
layout = self.layout
@ -274,17 +274,17 @@ for mod in sub_modules:
return update
prop = BoolProperty(
name=info['name'],
description=info.get('description', ''),
update=gen_update(mod),
)
name=info['name'],
description=info.get('description', ''),
update=gen_update(mod),
)
setattr(PieToolsPreferences, 'use_' + mod_name, prop)
prop = BoolProperty()
setattr(PieToolsPreferences, 'show_expanded_' + mod_name, prop)
classes = (
PieToolsPreferences,
)
)
def register():