def invoke(self, context, event):
retval = bpy.ops.view3d.select(
'INVOKE_DEFAULT',
- True, # undo push
+ True, # undo push
extend=self.extend,
deselect=self.deselect,
toggle=self.toggle,
return value_eval
-
def get_default_eval(self):
try:
default_eval = eval(self.default)
return default_eval
-
def execute(self, context):
from rna_prop_ui import (
rna_idprop_ui_prop_get,
# default default value
prop_type = type(self.get_value_eval())
- if prop_type in {int,float}:
+ if prop_type in {int, float}:
self.default = str(prop_type(0))
else:
self.default = ""
layout.prop(self, "value")
row = layout.row()
- row.enabled = type(self.get_value_eval()) in {int,float}
+ row.enabled = type(self.get_value_eval()) in {int, float}
row.prop(self, "default")
row = layout.row(align=True)
if use_toolbar_release_hack:
_key_held = None
+
def invoke(self, context, event):
WM_OT_toolbar._key_held = event.type
return self.execute(context)
except:
traceback.print_exc()
- finalpath = str(path_studiolights.joinpath(self.filename));
+ finalpath = str(path_studiolights.joinpath(self.filename))
if pathlib.Path(finalpath + ".sl").is_file():
if not self.ask_overide:
self.ask_overide = True
#sub = col.split(factor=0.35)
#row = sub.row()
#row.alignment = 'RIGHT'
- #row.label(text="Language:")
+ # row.label(text="Language:")
#userpref = context.user_preferences
#sub.prop(userpref.system, "language", text="")
col.operator("wm.link", text="Link...", icon='LINK_BLEND').filepath = self.filepath
col.operator("wm.append", text="Append...", icon='APPEND_BLEND').filepath = self.filepath
+
classes = (
WM_OT_addon_disable,
WM_OT_addon_enable,
srow = col.row(align=True)
srow.prop(gpl, "opacity", text="Opacity", slider=True)
srow.prop(gpl, "clamp_layer", text="",
- icon='MOD_MASK' if gpl.clamp_layer else 'LAYER_ACTIVE')
+ icon='MOD_MASK' if gpl.clamp_layer else 'LAYER_ACTIVE')
col = row.column()
layout.separator()
col = layout.column()
-
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
col.label(text="Textures:")
col.prop(md, "offset_u")
col.prop(md, "offset_v")
-
def MULTIRES(self, layout, ob, md):
layout.row().prop(md, "subdivision_type", expand=True)
row = layout.row(align=True)
row.prop(gpl, "clamp_layer", text="",
- icon='MOD_MASK' if gpl.clamp_layer else 'LAYER_ACTIVE',
- emboss=False)
+ icon='MOD_MASK' if gpl.clamp_layer else 'LAYER_ACTIVE',
+ emboss=False)
row.prop(gpl, "lock", text="", emboss=False)
row.prop(gpl, "hide", text="", emboss=False)
col.prop(mask_tex_slot, "offset")
col.prop(mask_tex_slot, "scale")
+
classes = (
VIEW3D_MT_tools_projectpaint_clone,
)
col.prop(props, "use_gtao_bent_normals")
col.prop(props, "use_gtao_bounce")
+
class RENDER_PT_eevee_motion_blur(RenderButtonsPanel, Panel):
bl_label = "Motion Blur"
bl_options = {'DEFAULT_CLOSED'}
col.prop(rd, "alpha_mode", text="Alpha")
-
class RENDER_PT_eevee_hair(RenderButtonsPanel, Panel):
bl_label = "Hair"
bl_options = {'DEFAULT_CLOSED'}
#######################################
# Keyframe Editing
+
class DOPESHEET_MT_channel(Menu):
bl_label = "Channel"
layout.template_ID(snode, "node_tree", new="node.new_node_tree")
-
layout.prop(snode, "pin", text="")
layout.separator_spacer()
@classmethod
def poll(cls, context):
snode = context.space_data
- return (context.engine in cls.COMPAT_ENGINES) and \
- snode.tree_type == 'ShaderNodeTree' and snode.id and \
- snode.id.bl_rna.identifier == 'Material'
+ return (
+ (context.engine in cls.COMPAT_ENGINES) and
+ (snode.tree_type == 'ShaderNodeTree' and snode.id) and
+ (snode.id.bl_rna.identifier == 'Material')
+ )
def draw(self, context):
material = context.space_data.id
@classmethod
def poll(cls, context):
snode = context.space_data
- return snode.tree_type == 'ShaderNodeTree' and snode.id and \
- snode.id.bl_rna.identifier == 'Material'
+ return (
+ (snode.tree_type == 'ShaderNodeTree' and snode.id) and
+ (snode.id.bl_rna.identifier == "Material")
+ )
def draw(self, context):
material = context.space_data.id
if st.view_type in {'SEQUENCER', 'SEQUENCER_PREVIEW'}:
layout.separator()
- layout.operator("sequencer.refresh_all", icon="FILE_REFRESH", text="")
+ layout.operator("sequencer.refresh_all", icon='FILE_REFRESH', text="")
if st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}:
layout.prop(st, "display_mode", text="", icon_only=True)
col.operator("sequencer.effect_strip_add", text="Alpha Over").type = 'ALPHA_OVER'
col.operator("sequencer.effect_strip_add", text="Alpha Under").type = 'ALPHA_UNDER'
col.operator("sequencer.effect_strip_add", text="Color Mix").type = 'COLORMIX'
- col.enabled = sel_sequences(context) >=2
+ col.enabled = sel_sequences(context) >= 2
layout.separator()
handle = WindowManager.draw_cursor_add(handle_fn, (context, item, tool), space_type)
handle_map[space_type] = handle
+
_activate_by_item._cursor_draw_handle = {}
ToolDef,
)
+
def generate_from_enum_ex(
context, *,
icon_prefix,
attr="vertex_tool",
)
+
class _defs_texture_paint:
@staticmethod
keymap=(),
)
+
class _defs_gpencil_edit:
@ToolDef.from_fn
def bend():
srow = col.row(align=True)
srow.prop(gpl, "opacity", text="Opacity", slider=True)
srow.prop(gpl, "clamp_layer", text="",
- icon='MOD_MASK' if gpl.clamp_layer else 'LAYER_ACTIVE')
+ icon='MOD_MASK' if gpl.clamp_layer else 'LAYER_ACTIVE')
col = row.column()
row = layout.row()
row.prop(system, "edit_studio_light", toggle=True)
- row.operator("wm.studiolight_new", text="Save as Studio light", icon="FILE_TICK")
+ row.operator("wm.studiolight_new", text="Save as Studio light", icon='FILE_TICK')
layout.separator()
sub.scale_y = 0.6 # smaller studiolight preview
sub.template_icon_view(shading, "studio_light", scale=3)
else:
- sub.prop(system, "edit_studio_light", text="Disable Studio Light Edit", icon="NONE", toggle=True)
+ sub.prop(system, "edit_studio_light", text="Disable Studio Light Edit", icon='NONE', toggle=True)
col = split.column()
col.operator("wm.studiolight_userpref_show", emboss=False, text="", icon='PREFERENCES')
col = split.column()
row = col.row()
- row.prop(shading, "use_world_space_lighting", text="", icon="WORLD", toggle=True)
+ row.prop(shading, "use_world_space_lighting", text="", icon='WORLD', toggle=True)
row = row.row()
row.active = shading.use_world_space_lighting
row.prop(shading, "studiolight_rotate_z", text="Rotation")
if orientation:
row = layout.row(align=False)
- row.prop(orientation, "name", text="", icon="OBJECT_ORIGIN")
+ row.prop(orientation, "name", text="", icon='OBJECT_ORIGIN')
row.operator("transform.delete_orientation", text="", icon='X', emboss=False)
col = layout.column()
-
row = col.row(align=True)
sub = row.row(align=True)
sub.prop(brush, "cursor_overlay_alpha", text="Curve Alpha")
sub.prop(brush, "use_cursor_overlay_override", toggle=True, text="", icon='BRUSH_DATA')
- row.prop(brush,"use_cursor_overlay", text="", toggle=True, icon='HIDE_OFF' if brush.use_cursor_overlay else 'HIDE_ON')
+ row.prop(brush, "use_cursor_overlay", text="", toggle=True, icon='HIDE_OFF' if brush.use_cursor_overlay else 'HIDE_ON')
col.active = brush.brush_capabilities.has_overlay
col.operator("sculpt.detail_flood_fill")
# TODO, move to space_view3d.py
+
+
class VIEW3D_PT_sculpt_options(Panel, View3DPaintPanel):
bl_context = ".sculpt_mode" # dot on purpose (access from topbar)
bl_label = "Options"
self.unified_paint_settings(layout, context)
+
class VIEW3D_PT_sculpt_options_gravity(Panel, View3DPaintPanel):
bl_context = ".sculpt_mode" # dot on purpose (access from topbar)
bl_parent_id = "VIEW3D_PT_sculpt_options"
col = flow.column()
col.prop(ipaint, "use_backface_culling")
+
class VIEW3D_PT_tools_projectpaint_unified(Panel, View3DPaintPanel):
bl_context = ".imagepaint" # dot on purpose (access from topbar)
bl_parent_id = "VIEW3D_PT_tools_projectpaint"
self.unified_paint_settings(layout, context)
+
class VIEW3D_PT_tools_projectpaint_cavity(View3DPaintPanel, Panel):
bl_context = ".imagepaint" # dot on purpose (access from topbar)
bl_label = "Cavity Mask"
# ********** grease pencil object tool panels ****************
# Grease Pencil drawing brushes
+
+
class VIEW3D_PT_tools_grease_pencil_brush(View3DPanel, Panel):
bl_context = ".greasepencil_paint"
bl_label = "Brush"
class VIEW3D_PT_tools_grease_pencil_brushcurves_sensitivity(View3DPanel, Panel):
bl_context = ".greasepencil_paint"
bl_label = "Sensitivity"
- bl_parent_id ="VIEW3D_PT_tools_grease_pencil_brushcurves"
+ bl_parent_id = "VIEW3D_PT_tools_grease_pencil_brushcurves"
@staticmethod
def draw(self, context):
class VIEW3D_PT_tools_grease_pencil_brushcurves_strength(View3DPanel, Panel):
bl_context = ".greasepencil_paint"
bl_label = "Strength"
- bl_parent_id ="VIEW3D_PT_tools_grease_pencil_brushcurves"
+ bl_parent_id = "VIEW3D_PT_tools_grease_pencil_brushcurves"
@staticmethod
def draw(self, context):
class VIEW3D_PT_tools_grease_pencil_brushcurves_jitter(View3DPanel, Panel):
bl_context = ".greasepencil_paint"
bl_label = "Jitter"
- bl_parent_id ="VIEW3D_PT_tools_grease_pencil_brushcurves"
+ bl_parent_id = "VIEW3D_PT_tools_grease_pencil_brushcurves"
@staticmethod
def draw(self, context):