style cleanup

This commit is contained in:
Campbell Barton 2013-01-15 23:15:32 +00:00
parent 87f8925a76
commit 97d62f0183
32 changed files with 130 additions and 107 deletions

View File

@ -208,9 +208,9 @@ def check(module_name):
if loaded_state is Ellipsis:
print("Warning: addon-module %r found module "
"but without __addon_enabled__ field, "
"possible name collision from file: %r" %
(module_name, getattr(mod, "__file__", "<unknown>")))
"but without __addon_enabled__ field, "
"possible name collision from file: %r" %
(module_name, getattr(mod, "__file__", "<unknown>")))
loaded_state = False

View File

@ -37,7 +37,7 @@ dict_uimsgs = {
"aren", # aren't
"betweens", # yuck! in-betweens!
"boolean", "booleans",
"couldn", #couldn't
"couldn", # couldn't
"decrement",
"derivate",
"doesn", # doesn't

View File

@ -47,6 +47,7 @@ from _bpy_path import (extensions_audio,
extensions_image,
)
def abspath(path, start=None, library=None):
"""
Returns the absolute path relative to the current blend file

View File

@ -237,7 +237,8 @@ def load_scripts(reload_scripts=False, refresh_scripts=False):
_addon_utils.reset_all(reload_scripts)
# run the active integration preset
filepath = preset_find(_user_preferences.inputs.active_keyconfig, "keyconfig")
filepath = preset_find(_user_preferences.inputs.active_keyconfig,
"keyconfig")
if filepath:
keyconfig_set(filepath)

View File

@ -341,7 +341,7 @@ path_reference_mode = EnumProperty(
('COPY', "Copy", "Copy the file to the destination path "
"(or subdirectory)"),
),
default='AUTO'
default='AUTO',
)
@ -480,10 +480,10 @@ def unique_name(key, name, name_dict, name_max=-1, clean_func=None, sep="."):
while name_new in name_dict_values:
count_str = "%03d" % count
name_new = "%.*s%s%s" % (name_max - (len(count_str) + 1),
name_new_orig,
sep,
count_str,
)
name_new_orig,
sep,
count_str,
)
count += 1
name_dict[key] = name_new

View File

@ -247,7 +247,7 @@ def edge_loops_from_tessfaces(mesh, tessfaces=None, seams=()):
break
i = ed_adj.index(context_loop[-2])
context_loop.append(ed_adj[not i])
context_loop.append(ed_adj[not i])
# Dont look at this again
del ed_adj[:]
@ -530,12 +530,12 @@ def face_random_points(num_points, tessfaces):
tris.append((verts[fv[0]].co,
verts[fv[1]].co,
verts[fv[2]].co,
))
))
if len(fv) == 4:
tris.append((verts[fv[0]].co,
verts[fv[3]].co,
verts[fv[2]].co,
))
))
tri_faces.append(tris)
# For each face, generate the required number of random points

View File

@ -123,7 +123,7 @@ def object_data_add(context, obdata, operator=None, use_active_layer=True):
base.layers[scene.active_layer] = True
else:
base.layers = [True if i == scene.active_layer
else False for i in range(len(scene.layers))]
else False for i in range(len(scene.layers))]
if v3d:
base.layers_from_view(context.space_data)

View File

@ -50,7 +50,7 @@ def region_2d_to_vector_3d(region, rv3d, coord):
out = Vector(((2.0 * coord[0] / region.width) - 1.0,
(2.0 * coord[1] / region.height) - 1.0,
-0.5
))
))
w = out.dot(persinv[3].xyz) + persinv[3][3]
@ -89,7 +89,7 @@ def region_2d_to_origin_3d(region, rv3d, coord):
persinv = persmat.inverted()
origin_start = ((persinv.col[0].xyz * dx) +
(persinv.col[1].xyz * dy) +
viewinv.translation)
viewinv.translation)
return origin_start

View File

@ -28,14 +28,17 @@ __all__ = (
import bpy as _bpy
class _RestrictContext():
__slots__ = ()
_real_data = _bpy.data
# safe, the pointer never changes
_real_pref = _bpy.context.user_preferences
@property
def window_manager(self):
return self._real_data.window_managers[0]
@property
def user_preferences(self):
return self._real_pref
@ -51,6 +54,7 @@ _data_restrict = _RestrictData()
class RestrictBlend():
__slots__ = ("context", "data")
def __enter__(self):
self.data = _bpy.data
self.context = _bpy.context

View File

@ -484,13 +484,16 @@ class Text(bpy_types.ID):
if cont.type == 'PYTHON']
)
class NodeSocket(StructRNA): # , metaclass=RNAMeta
__slots__ = ()
@property
def links(self):
"""List of node links from or to this socket"""
return tuple(link for link in self.id_data.links if link.from_socket == self or link.to_socket == self)
return tuple(link for link in self.id_data.links
if (link.from_socket == self or
link.to_socket == self))
# values are module: [(cls, path, line), ...]

View File

@ -22,6 +22,7 @@ import bpy
from bpy.types import Operator
from bpy.props import BoolProperty, EnumProperty, StringProperty
# Base class for node 'Add' operators
class NodeAddOperator():
@staticmethod
@ -78,8 +79,9 @@ class NODE_OT_add_node(NodeAddOperator, Operator):
use_transform = BoolProperty(
name="Use Transform",
description="Start transform operator after inserting the node",
default = False,
default=False,
)
def execute(self, context):
node = self.create_node(context, self.type)

View File

@ -111,10 +111,10 @@ class SelectCamera(Operator):
bl_options = {'REGISTER', 'UNDO'}
extend = BoolProperty(
name="Extend",
description="Extend the selection",
default=False
)
name="Extend",
description="Extend the selection",
default=False
)
def execute(self, context):
scene = context.scene
@ -305,7 +305,7 @@ class ShapeTransfer(Operator):
('RELATIVE_EDGE',
"Relative Edge",
"Calculate relative position (using edges)",
),
),
),
name="Transformation Mode",
description="Relative shape positions to the new shape method",
@ -682,7 +682,7 @@ class TransformsToDeltasAnim(Operator):
"scale" : "delta_scale"
}
DELTA_PATHS = STANDARD_TO_DELTA_PATHS.values()
# try to apply on each selected object
success = False
for obj in context.selected_editable_objects:
@ -692,7 +692,7 @@ class TransformsToDeltasAnim(Operator):
"No animation data to convert on object: %r" %
obj.name)
continue
# first pass over F-Curves: ensure that we don't have conflicting
# transforms already (e.g. if this was applied already) [#29110]
existingFCurves = {}
@ -708,7 +708,7 @@ class TransformsToDeltasAnim(Operator):
else:
# non-transform - ignore
continue
# a delta path like this for the same index shouldn't
# exist already, otherwise we've got a conflict
if dpath in existingFCurves:
@ -716,8 +716,9 @@ class TransformsToDeltasAnim(Operator):
if fcu.array_index in existingFCurves[dpath]:
# conflict
self.report({'ERROR'},
"Object '%r' already has '%r' F-Curve(s). Remove these before trying again" %
(obj.name, dpath))
"Object '%r' already has '%r' F-Curve(s). "
"Remove these before trying again" %
(obj.name, dpath))
return {'CANCELLED'}
else:
# no conflict here
@ -725,8 +726,7 @@ class TransformsToDeltasAnim(Operator):
else:
# no conflict yet
existingFCurves[dpath] = [fcu.array_index]
# if F-Curve uses standard transform path
# just append "delta_" to this path
for fcu in adt.action.fcurves:
@ -766,7 +766,7 @@ class DupliOffsetFromCursor(Operator):
@classmethod
def poll(cls, context):
return context.active_object is not None
return (context.active_object is not None)
def execute(self, context):
scene = context.scene

View File

@ -320,13 +320,13 @@ class AddPresetFluid(AddPresetBase, Operator):
preset_menu = "FLUID_MT_presets"
preset_defines = [
"fluid = bpy.context.fluid"
]
"fluid = bpy.context.fluid"
]
preset_values = [
"fluid.settings.viscosity_base",
"fluid.settings.viscosity_exponent",
]
"fluid.settings.viscosity_base",
"fluid.settings.viscosity_exponent",
]
preset_subdir = "fluid"

View File

@ -26,18 +26,18 @@ from bpy.types import Operator
def extend(obj, operator, EXTEND_MODE):
import bmesh
me = obj.data
# script will fail without UVs
if not me.uv_textures:
me.uv_textures.new()
bm = bmesh.from_edit_mesh(me)
f_act = bm.faces.active
uv_act = bm.loops.layers.uv.active
if f_act is None:
operator.report({'ERROR'}, "No active face")
return
@ -57,7 +57,7 @@ def extend(obj, operator, EXTEND_MODE):
f.tag = False
# tag the active face True since we begin there
f_act.tag = True
def walk_face(f):
# all faces in this list must be tagged
f.tag = True
@ -102,7 +102,6 @@ def extend(obj, operator, EXTEND_MODE):
else:
break
def extrapolate_uv(fac,
l_a_outer, l_a_inner,
l_b_outer, l_b_inner):
@ -112,7 +111,7 @@ def extend(obj, operator, EXTEND_MODE):
def apply_uv(f_prev, l_prev, f_next):
l_a = [None, None, None, None]
l_b = [None, None, None, None]
l_a[0] = l_prev
l_a[1] = l_a[0].link_loop_next
l_a[2] = l_a[1].link_loop_next
@ -133,7 +132,7 @@ def extend(obj, operator, EXTEND_MODE):
# +-----------+
# copy from this face to the one above.
# get the other loops
# get the other loops
l_next = l_prev.link_loop_radial_next
if l_next.vert != l_prev.vert:
l_b[1] = l_next

View File

@ -189,14 +189,14 @@ class prettyface(object):
def lightmap_uvpack(meshes,
PREF_SEL_ONLY=True,
PREF_NEW_UVLAYER=False,
PREF_PACK_IN_ONE=False,
PREF_APPLY_IMAGE=False,
PREF_IMG_PX_SIZE=512,
PREF_BOX_DIV=8,
PREF_MARGIN_DIV=512
):
PREF_SEL_ONLY=True,
PREF_NEW_UVLAYER=False,
PREF_PACK_IN_ONE=False,
PREF_APPLY_IMAGE=False,
PREF_IMG_PX_SIZE=512,
PREF_BOX_DIV=8,
PREF_MARGIN_DIV=512
):
"""
BOX_DIV if the maximum division of the UV map that
a box may be consolidated into.

View File

@ -1584,7 +1584,7 @@ class WM_OT_addon_enable(Operator):
"version %d.%d.%d and might not "
"function (correctly), "
"though it is enabled") %
info_ver)
info_ver)
return {'FINISHED'}
else:
return {'CANCELLED'}

View File

@ -133,6 +133,7 @@ def register():
def unregister():
bpy.utils.unregister_module(__name__)
# Define a default UIList, when a list does not need any custom drawing...
class UI_UL_list(bpy.types.UIList):
pass

View File

@ -194,7 +194,6 @@ class DATA_PT_vertex_groups(MeshButtonsPanel, Panel):
row = layout.row()
row.template_list("MESH_UL_vgroups", "", ob, "vertex_groups", ob.vertex_groups, "active_index", rows=rows)
col = row.column(align=True)
col.operator("object.vertex_group_add", icon='ZOOMIN', text="")
col.operator("object.vertex_group_remove", icon='ZOOMOUT', text="").all = False

View File

@ -333,23 +333,23 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
def LAPLACIANSMOOTH(self, layout, ob, md):
layout.prop(md, "iterations")
split = layout.split(percentage=0.25)
col = split.column()
col.label(text="Axis:")
col.prop(md, "use_x")
col.prop(md, "use_y")
col.prop(md, "use_z")
col = split.column()
col.label(text="Lambda:")
col.prop(md, "lambda_factor", text="Factor")
col.prop(md, "lambda_border", text="Border")
col.separator()
col.prop(md, "use_volume_preserve")
layout.label(text="Vertex Group:")
layout.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
@ -558,7 +558,6 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
col = split.column()
def PARTICLE_INSTANCE(self, layout, ob, md):
layout.prop(md, "object")
layout.prop(md, "particle_system_index", text="Particle System")
@ -1045,12 +1044,12 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
def UV_WARP(self, layout, ob, md):
split = layout.split()
col = split.column()
col.prop(md, "center");
col.prop(md, "center")
col = split.column()
col.label(text="UV Axis:")
col.prop(md, "axis_u", text="");
col.prop(md, "axis_v", text="");
col.prop(md, "axis_u", text="")
col.prop(md, "axis_v", text="")
split = layout.split()
col = split.column()

View File

@ -199,6 +199,7 @@ class PHYSICS_PT_game_physics(PhysicsButtonsPanel, Panel):
col = split.column()
col.prop(game, "collision_mask")
class PHYSICS_PT_game_collision_bounds(PhysicsButtonsPanel, Panel):
bl_label = "Collision Bounds"
COMPAT_ENGINES = {'BLENDER_GAME'}
@ -411,10 +412,10 @@ class RENDER_PT_game_system(RenderButtonsPanel, Panel):
col = row.column()
col.prop(gs, "use_display_lists")
col.active = gs.raster_storage != 'VERTEX_BUFFER_OBJECT'
row = layout.row()
row.prop(gs, "raster_storage")
row = layout.row()
row.label("Exit Key")
row.prop(gs, "exit_key", text="", event=True)

View File

@ -26,7 +26,8 @@ from bpy.types import Menu, UIList
class MASK_UL_layers(UIList):
def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
def draw_item(self, context, layout, data, item, icon,
active_data, active_propname, index):
# assert(isinstance(item, bpy.types.MaskLayer)
mask = item
if self.layout_type in {'DEFAULT', 'COMPACT'}:
@ -86,7 +87,8 @@ class MASK_PT_layers:
rows = 5 if active_layer else 2
row = layout.row()
row.template_list("MASK_UL_layers", "", mask, "layers", mask, "active_layer_index", rows=rows)
row.template_list("MASK_UL_layers", "", mask, "layers",
mask, "active_layer_index", rows=rows)
sub = row.column(align=True)

View File

@ -172,7 +172,6 @@ class ConstraintButtonsPanel():
sub.active = con.use_rotation
sub.prop(con, "orient_weight", text="Rotation", slider=True)
def IK_COPY_POSE(self, context, layout, con):
self.target_template(layout, con)
self.ik_template(layout, con)

View File

@ -133,7 +133,7 @@ def point_cache_ui(self, context, cache, enabled, cachetype):
row.prop(cache, "frame_end")
if cachetype not in {'SMOKE', 'CLOTH', 'DYNAMIC_PAINT'}:
row.prop(cache, "frame_step")
if cachetype != 'SMOKE':
layout.label(text=cache.info)

View File

@ -80,7 +80,7 @@ class PHYSICS_PT_dynamic_paint(PhysicButtonsPanel, Panel):
row = layout.row()
row.template_list("PHYSICS_UL_dynapaint_surfaces", "", canvas, "canvas_surfaces",
canvas.canvas_surfaces, "active_index", rows=2)
canvas.canvas_surfaces, "active_index", rows=2)
col = row.column(align=True)
col.operator("dpaint.surface_slot_add", icon='ZOOMIN', text="")

View File

@ -76,7 +76,7 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel, Panel):
elif md.smoke_type == 'FLOW':
flow = md.flow_settings
layout.prop(flow, "smoke_flow_type", expand=False)
if flow.smoke_flow_type != "OUTFLOW":
@ -118,7 +118,8 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel, Panel):
col = split.column()
col.prop(coll, "collision_type")
class PHYSICS_PT_smoke_flow_advanced(PhysicButtonsPanel, Panel):
bl_label = "Smoke Flow Advanced"
bl_options = {'DEFAULT_CLOSED'}
@ -132,7 +133,7 @@ class PHYSICS_PT_smoke_flow_advanced(PhysicButtonsPanel, Panel):
layout = self.layout
ob = context.object
flow = context.smoke.flow_settings
split = layout.split()
col = split.column()
@ -147,11 +148,12 @@ class PHYSICS_PT_smoke_flow_advanced(PhysicButtonsPanel, Panel):
if flow.texture_map_type == "AUTO":
sub.prop(flow, "texture_size")
sub.prop(flow, "texture_offset")
col = split.column()
col.label(text="Vertex Group:")
col.prop_search(flow, "density_vertex_group", ob, "vertex_groups", text="")
class PHYSICS_PT_smoke_fire(PhysicButtonsPanel, Panel):
bl_label = "Smoke Flames"
bl_options = {'DEFAULT_CLOSED'}
@ -179,7 +181,8 @@ class PHYSICS_PT_smoke_fire(PhysicButtonsPanel, Panel):
col.prop(domain, "flame_ignition")
col.prop(domain, "flame_max_temp")
col.prop(domain, "flame_smoke_color")
class PHYSICS_PT_smoke_adaptive_domain(PhysicButtonsPanel, Panel):
bl_label = "Smoke Adaptive Domain"
bl_options = {'DEFAULT_CLOSED'}
@ -199,10 +202,10 @@ class PHYSICS_PT_smoke_adaptive_domain(PhysicButtonsPanel, Panel):
domain = context.smoke.domain_settings
layout.active = domain.use_adaptive_domain
split = layout.split()
split.enabled = not domain.point_cache.is_baked
split.enabled = (not domain.point_cache.is_baked)
col = split.column(align=True)
col.label(text="Resolution:")
col.prop(domain, "additional_res")
@ -212,6 +215,7 @@ class PHYSICS_PT_smoke_adaptive_domain(PhysicButtonsPanel, Panel):
col.label(text="Advanced:")
col.prop(domain, "adapt_threshold")
class PHYSICS_PT_smoke_highres(PhysicButtonsPanel, Panel):
bl_label = "Smoke High Resolution"
bl_options = {'DEFAULT_CLOSED'}
@ -249,6 +253,7 @@ class PHYSICS_PT_smoke_highres(PhysicButtonsPanel, Panel):
layout.prop(md, "show_high_resolution")
class PHYSICS_PT_smoke_groups(PhysicButtonsPanel, Panel):
bl_label = "Smoke Groups"
bl_options = {'DEFAULT_CLOSED'}
@ -262,7 +267,7 @@ class PHYSICS_PT_smoke_groups(PhysicButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
domain = context.smoke.domain_settings
split = layout.split()
col = split.column()
@ -276,6 +281,7 @@ class PHYSICS_PT_smoke_groups(PhysicButtonsPanel, Panel):
col.label(text="Collision Group:")
col.prop(domain, "collision_group", text="")
class PHYSICS_PT_smoke_cache(PhysicButtonsPanel, Panel):
bl_label = "Smoke Cache"
bl_options = {'DEFAULT_CLOSED'}

View File

@ -60,6 +60,7 @@ class RENDER_UL_renderlayers(UIList):
# uiDefButR(block, OPTION, 0, "", 0, 0, UI_UNIT_X, UI_UNIT_Y, itemptr, "use", 0, 0, 0, 0, 0, NULL);
# }
class RenderButtonsPanel():
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
@ -356,7 +357,7 @@ class RENDER_PT_performance(RenderButtonsPanel, Panel):
subsub = sub.column()
subsub.enabled = rd.threads_mode == 'FIXED'
subsub.prop(rd, "threads")
sub = col.column(align=True)
sub.label(text="Tile Size:")
sub.prop(rd, "tile_x", text="X")

View File

@ -23,14 +23,17 @@ from bpy.types import Panel, Header, Menu, UIList
class CLIP_UL_tracking_objects(UIList):
def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
def draw_item(self, context, layout, data, item, icon,
active_data, active_propname, index):
# assert(isinstance(item, bpy.types.MovieTrackingObject)
tobj = item
if self.layout_type in {'DEFAULT', 'COMPACT'}:
layout.label(tobj.name, icon='CAMERA_DATA' if tobj.is_camera else 'OBJECT_DATA')
layout.label(tobj.name, icon='CAMERA_DATA'
if tobj.is_camera else 'OBJECT_DATA')
elif self.layout_type in {'GRID'}:
layout.alignment = 'CENTER'
layout.label("", icon='CAMERA_DATA' if tobj.is_camera else 'OBJECT_DATA')
layout.label("", icon='CAMERA_DATA'
if tobj.is_camera else 'OBJECT_DATA')
class CLIP_HT_header(Header):
@ -333,7 +336,8 @@ class CLIP_PT_tools_solve(CLIP_PT_tracking_panel, Panel):
col = layout.column(align=True)
col.active = not settings.use_tripod_solver
col.prop(settings, "use_fallback_reconstruction", text="Allow Fallback")
col.prop(settings, "use_fallback_reconstruction",
text="Allow Fallback")
sub = col.column()
sub.active = settings.use_fallback_reconstruction
sub.prop(settings, "reconstruction_success_threshold")
@ -482,7 +486,8 @@ class CLIP_PT_objects(CLIP_PT_clip_view_panel, Panel):
tracking = sc.clip.tracking
row = layout.row()
row.template_list("CLIP_UL_tracking_objects", "", tracking, "objects", tracking, "active_object_index", rows=3)
row.template_list("CLIP_UL_tracking_objects", "", tracking, "objects",
tracking, "active_object_index", rows=3)
sub = row.column(align=True)
@ -738,7 +743,8 @@ class CLIP_PT_stabilization(CLIP_PT_reconstruction_panel, Panel):
layout.active = stab.use_2d_stabilization
row = layout.row()
row.template_list("UI_UL_list", "", stab, "tracks", stab, "active_track_index", rows=3)
row.template_list("UI_UL_list", "", stab, "tracks",
stab, "active_track_index", rows=3)
sub = row.column(align=True)

View File

@ -275,8 +275,8 @@ class DOPESHEET_MT_key(Menu):
layout.operator("action.keyframe_insert")
layout.separator()
layout.operator("action.frame_jump")
layout.operator("action.frame_jump")
layout.separator()
layout.operator("action.duplicate_move")
layout.operator("action.delete")

View File

@ -112,7 +112,7 @@ class INFO_MT_file(Menu):
layout.separator()
layout.operator_context = 'EXEC_AREA' if context.blend_data.is_saved else 'INVOKE_AREA'
layout.operator_context = 'EXEC_AREA' if context.blend_data.is_saved else 'INVOKE_AREA'
layout.operator("wm.save_mainfile", text="Save", icon='FILE_TICK')
layout.operator_context = 'INVOKE_AREA'

View File

@ -152,7 +152,7 @@ class TEXT_MT_view(Menu):
layout = self.layout
layout.operator("text.properties", icon='MENU_PANEL')
layout.separator()
layout.operator("text.move",

View File

@ -24,25 +24,25 @@ import os
def ui_style_items(col, context):
""" UI Style settings """
split = col.split()
col = split.column()
col.label(text="Kerning Style:")
col.row().prop(context, "font_kerning_style", expand=True)
col.prop(context, "points")
col = split.column()
col.label(text="Shadow Offset:")
col.prop(context, "shadow_offset_x", text="X")
col.prop(context, "shadow_offset_y", text="Y")
col = split.column()
col.prop(context, "shadow")
col.prop(context, "shadowalpha")
col.prop(context, "shadowcolor")
def ui_items_general(col, context):
""" General UI Theme Settings (User Interface)
"""
@ -200,7 +200,7 @@ class USERPREF_PT_interface(Panel):
col.prop(view, "show_playback_fps", text="Playback FPS")
col.prop(view, "use_global_scene")
col.prop(view, "object_origin_size")
col.separator()
col.separator()
col.separator()
@ -763,13 +763,13 @@ class USERPREF_PT_theme(Panel):
colsub.row().prop(ui, "axis_x")
colsub.row().prop(ui, "axis_y")
colsub.row().prop(ui, "axis_z")
subsplit = row.split(percentage=0.85)
padding = subsplit.split(percentage=0.15)
colsub = padding.column()
colsub = padding.column()
layout.separator()
layout.separator()
elif theme.theme_area == 'BONE_COLOR_SETS':
@ -797,16 +797,16 @@ class USERPREF_PT_theme(Panel):
colsub.row().prop(ui, "show_colored_constraints")
elif theme.theme_area == 'STYLE':
col = split.column()
style = context.user_preferences.ui_styles[0]
ui = style.widget
col.label(text="Widget:")
ui_style_items(col, ui)
col.separator()
col.separator()
ui = style.widget_label
col.label(text="Widget Label:")
ui_style_items(col, ui)
@ -1100,8 +1100,8 @@ class USERPREF_PT_addons(Panel):
used_ext = {ext.module for ext in userpref.addons}
userpref_addons_folder = os.path.join(userpref.filepaths.script_directory, "addons")
scripts_addons_folder = bpy.utils.user_resource('SCRIPTS', "addons")
scripts_addons_folder = bpy.utils.user_resource('SCRIPTS', "addons")
# collect the categories that can be filtered on
addons = [(mod, addon_utils.module_bl_info(mod)) for mod in addon_utils.modules(addon_utils.addons_fake_modules)]
@ -1152,7 +1152,7 @@ class USERPREF_PT_addons(Panel):
(filter == "Enabled" and is_enabled) or
(filter == "Disabled" and not is_enabled) or
(filter == "User" and (mod.__file__.startswith((scripts_addons_folder, userpref_addons_folder))))
):
):
if search and search not in info["name"].lower():
if info["author"]:
@ -1244,7 +1244,6 @@ class USERPREF_PT_addons(Panel):
box_prefs.label(text="Error (see console)", icon='ERROR')
del addon_preferences_class.layout
# Append missing scripts
# First collect scripts that are used but have no script file.
module_names = {mod.__name__ for mod, info in addons}

View File

@ -1537,7 +1537,7 @@ class VIEW3D_MT_pose_group(Menu):
def draw(self, context):
layout = self.layout
pose = context.active_object.pose
layout.operator_context = 'EXEC_AREA'