2009-11-01 15:21:20 +00:00
|
|
|
# ##### 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 2
|
|
|
|
# of the License, or (at your option) any later version.
|
2009-11-03 07:23:02 +00:00
|
|
|
#
|
2009-11-01 15:21:20 +00:00
|
|
|
# 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.
|
2009-11-03 07:23:02 +00:00
|
|
|
#
|
2009-11-01 15:21:20 +00:00
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2009-11-01 15:21:20 +00:00
|
|
|
#
|
|
|
|
# ##### END GPL LICENSE BLOCK #####
|
2009-10-31 20:16:59 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
# <pep8 compliant>
|
2009-08-18 12:58:51 +00:00
|
|
|
import bpy
|
2010-01-31 14:46:28 +00:00
|
|
|
import os
|
|
|
|
import re
|
|
|
|
import shutil
|
|
|
|
|
2009-08-18 12:58:51 +00:00
|
|
|
|
2010-01-09 18:17:40 +00:00
|
|
|
def ui_items_general(col, context):
|
2010-01-31 14:46:28 +00:00
|
|
|
""" General UI Theme Settings (User Interface)
|
|
|
|
"""
|
2010-01-09 18:17:40 +00:00
|
|
|
row = col.row()
|
2010-01-09 12:05:30 +00:00
|
|
|
sub = row.column()
|
|
|
|
sub.prop(context, "outline")
|
|
|
|
sub.prop(context, "item", slider=True)
|
|
|
|
sub = row.column()
|
|
|
|
sub.prop(context, "inner", slider=True)
|
|
|
|
sub.prop(context, "inner_sel", slider=True)
|
|
|
|
sub = row.column()
|
|
|
|
sub.prop(context, "text")
|
|
|
|
sub.prop(context, "text_sel")
|
|
|
|
sub = row.column()
|
|
|
|
sub.prop(context, "shaded")
|
|
|
|
subsub = sub.column(align=True)
|
|
|
|
subsub.active = context.shaded
|
|
|
|
subsub.prop(context, "shadetop")
|
|
|
|
subsub.prop(context, "shadedown")
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-09 18:17:40 +00:00
|
|
|
col.separator()
|
2010-01-31 14:46:28 +00:00
|
|
|
|
|
|
|
|
2010-01-09 15:49:27 +00:00
|
|
|
def opengl_lamp_buttons(column, lamp):
|
|
|
|
split = column.split(percentage=0.1)
|
|
|
|
|
|
|
|
if lamp.enabled == True:
|
|
|
|
split.prop(lamp, "enabled", text="", icon='OUTLINER_OB_LAMP')
|
|
|
|
else:
|
|
|
|
split.prop(lamp, "enabled", text="", icon='LAMP_DATA')
|
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
col.active = lamp.enabled
|
|
|
|
row = col.row()
|
|
|
|
row.label(text="Diffuse:")
|
|
|
|
row.prop(lamp, "diffuse_color", text="")
|
|
|
|
row = col.row()
|
|
|
|
row.label(text="Specular:")
|
|
|
|
row.prop(lamp, "specular_color", text="")
|
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
col.active = lamp.enabled
|
|
|
|
col.prop(lamp, "direction", text="")
|
2010-01-09 12:05:30 +00:00
|
|
|
|
2009-12-16 10:13:26 +00:00
|
|
|
KM_HIERARCHY = [
|
|
|
|
('Window', 'EMPTY', 'WINDOW', []), # file save, window change, exit
|
2009-12-24 09:26:06 +00:00
|
|
|
('Screen', 'EMPTY', 'WINDOW', [ # full screen, undo, screenshot
|
|
|
|
('Screen Editing', 'EMPTY', 'WINDOW', []), # resizing, action corners
|
2009-12-26 09:36:50 +00:00
|
|
|
]),
|
2009-12-16 10:13:26 +00:00
|
|
|
|
|
|
|
('View2D', 'EMPTY', 'WINDOW', []), # view 2d navigation (per region)
|
2009-12-24 09:26:06 +00:00
|
|
|
('View2D Buttons List', 'EMPTY', 'WINDOW', []), # view 2d with buttons navigation
|
2009-12-16 10:13:26 +00:00
|
|
|
('Header', 'EMPTY', 'WINDOW', []), # header stuff (per region)
|
|
|
|
('Grease Pencil', 'EMPTY', 'WINDOW', []), # grease pencil stuff (per region)
|
2009-12-26 09:36:50 +00:00
|
|
|
|
2009-12-24 09:26:06 +00:00
|
|
|
('3D View', 'VIEW_3D', 'WINDOW', [ # view 3d navigation and generic stuff (select, transform)
|
2009-12-16 10:13:26 +00:00
|
|
|
('Object Mode', 'EMPTY', 'WINDOW', []),
|
2009-12-24 09:26:06 +00:00
|
|
|
('Mesh', 'EMPTY', 'WINDOW', []),
|
2009-12-16 10:13:26 +00:00
|
|
|
('Curve', 'EMPTY', 'WINDOW', []),
|
|
|
|
('Armature', 'EMPTY', 'WINDOW', []),
|
|
|
|
('Metaball', 'EMPTY', 'WINDOW', []),
|
|
|
|
('Lattice', 'EMPTY', 'WINDOW', []),
|
|
|
|
('Font', 'EMPTY', 'WINDOW', []),
|
2009-12-26 09:36:50 +00:00
|
|
|
|
2009-12-24 09:26:06 +00:00
|
|
|
('Pose', 'EMPTY', 'WINDOW', []),
|
2009-12-26 09:36:50 +00:00
|
|
|
|
2009-12-24 09:26:06 +00:00
|
|
|
('Vertex Paint', 'EMPTY', 'WINDOW', []),
|
|
|
|
('Weight Paint', 'EMPTY', 'WINDOW', []),
|
|
|
|
('Face Mask', 'EMPTY', 'WINDOW', []),
|
2009-12-16 10:13:26 +00:00
|
|
|
('Image Paint', 'EMPTY', 'WINDOW', []), # image and view3d
|
2009-12-24 09:26:06 +00:00
|
|
|
('Sculpt', 'EMPTY', 'WINDOW', []),
|
2009-12-26 09:36:50 +00:00
|
|
|
|
2009-12-24 09:26:06 +00:00
|
|
|
('Armature Sketch', 'EMPTY', 'WINDOW', []),
|
|
|
|
('Particle', 'EMPTY', 'WINDOW', []),
|
2009-12-26 09:36:50 +00:00
|
|
|
|
2009-12-24 09:26:06 +00:00
|
|
|
('Object Non-modal', 'EMPTY', 'WINDOW', []), # mode change
|
2009-12-26 09:36:50 +00:00
|
|
|
|
2009-12-24 09:26:06 +00:00
|
|
|
('3D View Generic', 'VIEW_3D', 'WINDOW', []) # toolbar and properties
|
|
|
|
]),
|
2009-12-26 09:36:50 +00:00
|
|
|
|
2009-12-24 09:26:06 +00:00
|
|
|
('Frames', 'EMPTY', 'WINDOW', []), # frame navigation (per region)
|
|
|
|
('Markers', 'EMPTY', 'WINDOW', []), # markers (per region)
|
|
|
|
('Animation', 'EMPTY', 'WINDOW', []), # frame change on click, preview range (per region)
|
|
|
|
('Animation Channels', 'EMPTY', 'WINDOW', []),
|
|
|
|
('Graph Editor', 'GRAPH_EDITOR', 'WINDOW', [
|
|
|
|
('Graph Editor Generic', 'GRAPH_EDITOR', 'WINDOW', [])
|
2009-12-16 10:13:26 +00:00
|
|
|
]),
|
2009-12-24 09:26:06 +00:00
|
|
|
('Dopesheet', 'DOPESHEET_EDITOR', 'WINDOW', []),
|
|
|
|
('NLA Editor', 'NLA_EDITOR', 'WINDOW', [
|
|
|
|
('NLA Channels', 'NLA_EDITOR', 'WINDOW', []),
|
|
|
|
('NLA Generic', 'NLA_EDITOR', 'WINDOW', [])
|
2009-12-16 10:13:26 +00:00
|
|
|
]),
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2009-12-16 10:13:26 +00:00
|
|
|
('Image', 'IMAGE_EDITOR', 'WINDOW', [
|
2009-12-24 09:26:06 +00:00
|
|
|
('UV Editor', 'EMPTY', 'WINDOW', []), # image (reverse order, UVEdit before Image
|
2009-12-16 10:13:26 +00:00
|
|
|
('Image Paint', 'EMPTY', 'WINDOW', []), # image and view3d
|
|
|
|
('Image Generic', 'IMAGE_EDITOR', 'WINDOW', [])
|
|
|
|
]),
|
2009-12-26 09:36:50 +00:00
|
|
|
|
2009-12-24 09:26:06 +00:00
|
|
|
('Timeline', 'TIMELINE', 'WINDOW', []),
|
|
|
|
('Outliner', 'OUTLINER', 'WINDOW', []),
|
2009-12-26 09:36:50 +00:00
|
|
|
|
2009-12-24 09:26:06 +00:00
|
|
|
('Node Editor', 'NODE_EDITOR', 'WINDOW', [
|
|
|
|
('Node Generic', 'NODE_EDITOR', 'WINDOW', [])
|
2009-12-16 10:13:26 +00:00
|
|
|
]),
|
2009-12-24 09:26:06 +00:00
|
|
|
('Sequencer', 'SEQUENCE_EDITOR', 'WINDOW', []),
|
|
|
|
('Logic Editor', 'LOGIC_EDITOR', 'WINDOW', []),
|
2009-12-26 09:36:50 +00:00
|
|
|
|
2009-12-24 09:26:06 +00:00
|
|
|
('File Browser', 'FILE_BROWSER', 'WINDOW', [
|
|
|
|
('File Browser Main', 'FILE_BROWSER', 'WINDOW', []),
|
|
|
|
('File Browser Buttons', 'FILE_BROWSER', 'WINDOW', [])
|
2009-12-16 10:13:26 +00:00
|
|
|
]),
|
2009-12-24 09:26:06 +00:00
|
|
|
|
|
|
|
('Property Editor', 'PROPERTIES', 'WINDOW', []), # align context menu
|
|
|
|
|
2009-12-16 10:13:26 +00:00
|
|
|
('Script', 'SCRIPTS_WINDOW', 'WINDOW', []),
|
|
|
|
('Text', 'TEXT_EDITOR', 'WINDOW', []),
|
|
|
|
('Console', 'CONSOLE', 'WINDOW', []),
|
2009-12-26 09:36:50 +00:00
|
|
|
|
2009-12-16 10:13:26 +00:00
|
|
|
('View3D Gesture Circle', 'EMPTY', 'WINDOW', []),
|
|
|
|
('Gesture Border', 'EMPTY', 'WINDOW', []),
|
|
|
|
('Standard Modal Map', 'EMPTY', 'WINDOW', []),
|
|
|
|
('Transform Modal Map', 'EMPTY', 'WINDOW', []),
|
|
|
|
('View3D Fly Modal', 'EMPTY', 'WINDOW', []),
|
|
|
|
('View3D Rotate Modal', 'EMPTY', 'WINDOW', []),
|
|
|
|
('View3D Move Modal', 'EMPTY', 'WINDOW', []),
|
|
|
|
('View3D Zoom Modal', 'EMPTY', 'WINDOW', []),
|
|
|
|
]
|
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-08-18 12:58:51 +00:00
|
|
|
class USERPREF_HT_header(bpy.types.Header):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_space_type = 'USER_PREFERENCES'
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
layout.template_header(menus=False)
|
|
|
|
|
|
|
|
userpref = context.user_preferences
|
|
|
|
|
2009-11-16 13:59:27 +00:00
|
|
|
layout.operator_context = 'EXEC_AREA'
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.operator("wm.save_homefile", text="Save As Default")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
if userpref.active_section == 'INPUT':
|
2009-11-16 13:59:27 +00:00
|
|
|
layout.operator_context = 'INVOKE_DEFAULT'
|
2010-01-21 21:58:40 +00:00
|
|
|
op = layout.operator("wm.keyconfig_export", "Export Key Configuration...")
|
|
|
|
op.path = "keymap.py"
|
2010-01-28 19:54:06 +00:00
|
|
|
op = layout.operator("wm.keyconfig_import", "Import Key Configuration...")
|
|
|
|
op.path = "keymap.py"
|
2010-02-26 14:28:29 +00:00
|
|
|
elif userpref.active_section == 'ADDONS':
|
2010-02-16 19:22:37 +00:00
|
|
|
layout.operator_context = 'INVOKE_DEFAULT'
|
2010-02-26 14:28:29 +00:00
|
|
|
op = layout.operator("wm.addon_install", "Install Add-On...")
|
2010-02-16 19:22:37 +00:00
|
|
|
op.path = "*.py"
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-08-18 12:58:51 +00:00
|
|
|
class USERPREF_PT_tabs(bpy.types.Panel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = ""
|
|
|
|
bl_space_type = 'USER_PREFERENCES'
|
|
|
|
bl_region_type = 'WINDOW'
|
|
|
|
bl_show_header = False
|
2009-08-18 12:58:51 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2009-08-18 12:58:51 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
userpref = context.user_preferences
|
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.prop(userpref, "active_section", expand=True)
|
2009-08-18 12:58:51 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
Key Configuration
Keymaps are now saveable and configurable from the user preferences, note
that editing one item in a keymap means the whole keymap is now defined by
the user and will not be updated by Blender, an option for syncing might be
added later. The outliner interface is still there, but I will probably
remove it.
There's actually 3 levels now:
* Default builtin key configuration.
* Key configuration loaded from .py file, for configs like Blender 2.4x
or other 3D applications.
* Keymaps edited by the user and saved in .B.blend. These can be saved
to .py files as well to make creating distributable configurations
easier.
Also, user preferences sections were reorganized a bit, now there is:
Interface, Editing, Input, Files and System.
Implementation notes:
* wmKeyConfig was added which represents a key configuration containing
keymaps.
* wmKeymapItem was renamed to wmKeyMapItem for consistency with wmKeyMap.
* Modal maps are not wrapped yet.
* User preferences DNA file reading did not support newdataadr() yet,
added this now for reading keymaps.
* Key configuration related settings are now RNA wrapped.
* is_property_set and is_property_hidden python methods were added.
2009-10-08 18:40:03 +00:00
|
|
|
class USERPREF_PT_interface(bpy.types.Panel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_space_type = 'USER_PREFERENCES'
|
|
|
|
bl_label = "Interface"
|
|
|
|
bl_region_type = 'WINDOW'
|
|
|
|
bl_show_header = False
|
|
|
|
|
|
|
|
def poll(self, context):
|
|
|
|
userpref = context.user_preferences
|
|
|
|
return (userpref.active_section == 'INTERFACE')
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
userpref = context.user_preferences
|
|
|
|
view = userpref.view
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2009-12-15 14:22:34 +00:00
|
|
|
row = layout.row()
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2009-12-15 14:22:34 +00:00
|
|
|
col = row.column()
|
2009-12-08 19:08:35 +00:00
|
|
|
col.label(text="Display:")
|
|
|
|
col.prop(view, "tooltips")
|
|
|
|
col.prop(view, "display_object_info", text="Object Info")
|
|
|
|
col.prop(view, "use_large_cursors")
|
|
|
|
col.prop(view, "show_view_name", text="View Name")
|
|
|
|
col.prop(view, "show_playback_fps", text="Playback FPS")
|
|
|
|
col.prop(view, "global_scene")
|
|
|
|
col.prop(view, "pin_floating_panels")
|
|
|
|
col.prop(view, "object_origin_size")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-12-08 19:08:35 +00:00
|
|
|
col.separator()
|
|
|
|
col.separator()
|
|
|
|
col.separator()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-12-08 19:08:35 +00:00
|
|
|
col.prop(view, "show_mini_axis", text="Display Mini Axis")
|
|
|
|
sub = col.column()
|
|
|
|
sub.enabled = view.show_mini_axis
|
|
|
|
sub.prop(view, "mini_axis_size", text="Size")
|
|
|
|
sub.prop(view, "mini_axis_brightness", text="Brightness")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-12-15 14:22:34 +00:00
|
|
|
row.separator()
|
|
|
|
row.separator()
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2009-12-15 14:22:34 +00:00
|
|
|
col = row.column()
|
2009-12-08 19:08:35 +00:00
|
|
|
col.label(text="View Manipulation:")
|
|
|
|
col.prop(view, "auto_depth")
|
|
|
|
col.prop(view, "zoom_to_mouse")
|
|
|
|
col.prop(view, "rotate_around_selection")
|
2010-01-06 22:38:51 +00:00
|
|
|
col.prop(view, "global_pivot")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-12-08 19:08:35 +00:00
|
|
|
col.separator()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-12-08 19:08:35 +00:00
|
|
|
col.prop(view, "auto_perspective")
|
|
|
|
col.prop(view, "smooth_view")
|
|
|
|
col.prop(view, "rotation_angle")
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-30 04:43:36 +00:00
|
|
|
col.separator()
|
|
|
|
col.separator()
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-30 04:43:36 +00:00
|
|
|
col.label(text="2D Viewports:")
|
|
|
|
col.prop(view, "view2d_grid_minimum_spacing", text="Minimum Grid Spacing")
|
|
|
|
col.prop(view, "timecode_style")
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2009-12-15 14:22:34 +00:00
|
|
|
row.separator()
|
|
|
|
row.separator()
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2009-12-15 14:22:34 +00:00
|
|
|
col = row.column()
|
2009-12-08 19:08:35 +00:00
|
|
|
#Toolbox doesn't exist yet
|
|
|
|
#col.label(text="Toolbox:")
|
|
|
|
#col.prop(view, "use_column_layout")
|
|
|
|
#col.label(text="Open Toolbox Delay:")
|
|
|
|
#col.prop(view, "open_left_mouse_delay", text="Hold LMB")
|
|
|
|
#col.prop(view, "open_right_mouse_delay", text="Hold RMB")
|
|
|
|
col.prop(view, "use_manipulator")
|
|
|
|
sub = col.column()
|
|
|
|
sub.enabled = view.use_manipulator
|
|
|
|
sub.prop(view, "manipulator_size", text="Size")
|
|
|
|
sub.prop(view, "manipulator_handle_size", text="Handle Size")
|
|
|
|
sub.prop(view, "manipulator_hotspot", text="Hotspot")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-12-08 19:08:35 +00:00
|
|
|
col.separator()
|
|
|
|
col.separator()
|
|
|
|
col.separator()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-12-08 19:08:35 +00:00
|
|
|
col.label(text="Menus:")
|
|
|
|
col.prop(view, "open_mouse_over")
|
|
|
|
col.label(text="Menu Open Delay:")
|
|
|
|
col.prop(view, "open_toplevel_delay", text="Top Level")
|
|
|
|
col.prop(view, "open_sublevel_delay", text="Sub Level")
|
2010-03-14 23:26:17 +00:00
|
|
|
|
2010-03-14 18:08:12 +00:00
|
|
|
col.separator()
|
2010-03-14 23:26:17 +00:00
|
|
|
|
2010-03-14 18:08:12 +00:00
|
|
|
col.prop(view, "show_splash")
|
2009-08-18 12:58:51 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-08-18 12:58:51 +00:00
|
|
|
class USERPREF_PT_edit(bpy.types.Panel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_space_type = 'USER_PREFERENCES'
|
|
|
|
bl_label = "Edit"
|
|
|
|
bl_region_type = 'WINDOW'
|
|
|
|
bl_show_header = False
|
|
|
|
|
|
|
|
def poll(self, context):
|
|
|
|
userpref = context.user_preferences
|
|
|
|
return (userpref.active_section == 'EDITING')
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
userpref = context.user_preferences
|
|
|
|
edit = userpref.edit
|
|
|
|
|
2009-12-15 14:22:34 +00:00
|
|
|
row = layout.row()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-12-15 14:22:34 +00:00
|
|
|
col = row.column()
|
2009-12-08 19:08:35 +00:00
|
|
|
col.label(text="Link Materials To:")
|
2010-01-09 15:49:27 +00:00
|
|
|
col.prop(edit, "material_link", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-12-08 19:08:35 +00:00
|
|
|
col.separator()
|
|
|
|
col.separator()
|
|
|
|
col.separator()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-12-08 19:08:35 +00:00
|
|
|
col.label(text="New Objects:")
|
|
|
|
col.prop(edit, "enter_edit_mode")
|
|
|
|
col.label(text="Align To:")
|
2010-01-09 15:49:27 +00:00
|
|
|
col.prop(edit, "object_align", text="")
|
2009-12-13 13:59:16 +00:00
|
|
|
|
2009-12-08 19:08:35 +00:00
|
|
|
col.separator()
|
|
|
|
col.separator()
|
|
|
|
col.separator()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-12-08 19:08:35 +00:00
|
|
|
col.label(text="Undo:")
|
|
|
|
col.prop(edit, "global_undo")
|
|
|
|
col.prop(edit, "undo_steps", text="Steps")
|
|
|
|
col.prop(edit, "undo_memory_limit", text="Memory Limit")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-12-15 14:22:34 +00:00
|
|
|
row.separator()
|
|
|
|
row.separator()
|
|
|
|
|
|
|
|
col = row.column()
|
2009-12-08 19:08:35 +00:00
|
|
|
col.label(text="Snap:")
|
|
|
|
col.prop(edit, "snap_translate", text="Translate")
|
|
|
|
col.prop(edit, "snap_rotate", text="Rotate")
|
|
|
|
col.prop(edit, "snap_scale", text="Scale")
|
|
|
|
col.separator()
|
|
|
|
col.separator()
|
|
|
|
col.separator()
|
|
|
|
col.label(text="Grease Pencil:")
|
|
|
|
col.prop(edit, "grease_pencil_manhattan_distance", text="Manhattan Distance")
|
|
|
|
col.prop(edit, "grease_pencil_euclidean_distance", text="Euclidean Distance")
|
|
|
|
#col.prop(edit, "grease_pencil_simplify_stroke", text="Simplify Stroke")
|
|
|
|
col.prop(edit, "grease_pencil_eraser_radius", text="Eraser Radius")
|
|
|
|
col.prop(edit, "grease_pencil_smooth_stroke", text="Smooth Stroke")
|
2010-02-18 00:29:08 +00:00
|
|
|
col.separator()
|
|
|
|
col.separator()
|
|
|
|
col.separator()
|
|
|
|
col.label(text="Playback:")
|
|
|
|
col.prop(edit, "use_negative_frames")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-12-15 14:22:34 +00:00
|
|
|
row.separator()
|
|
|
|
row.separator()
|
|
|
|
|
|
|
|
col = row.column()
|
2009-12-08 19:08:35 +00:00
|
|
|
col.label(text="Keyframing:")
|
|
|
|
col.prop(edit, "use_visual_keying")
|
|
|
|
col.prop(edit, "keyframe_insert_needed", text="Only Insert Needed")
|
|
|
|
|
|
|
|
col.separator()
|
|
|
|
|
2010-02-17 15:14:09 +00:00
|
|
|
col.prop(edit, "use_auto_keying", text="Auto Keyframing:")
|
2009-12-08 19:08:35 +00:00
|
|
|
|
|
|
|
sub = col.column()
|
|
|
|
|
2010-02-17 15:14:09 +00:00
|
|
|
# sub.active = edit.use_auto_keying # incorrect, timeline can enable
|
2009-12-08 19:08:35 +00:00
|
|
|
sub.prop(edit, "auto_keyframe_insert_keyingset", text="Only Insert for Keying Set")
|
|
|
|
sub.prop(edit, "auto_keyframe_insert_available", text="Only Insert Available")
|
|
|
|
|
2010-02-17 15:14:09 +00:00
|
|
|
col.separator()
|
|
|
|
|
|
|
|
col.label(text="New F-Curve Defaults:")
|
|
|
|
col.prop(edit, "new_interpolation_type", text="Interpolation")
|
|
|
|
col.prop(edit, "insertkey_xyz_to_rgb", text="XYZ to RGB")
|
|
|
|
|
2009-12-08 19:08:35 +00:00
|
|
|
col.separator()
|
|
|
|
col.separator()
|
|
|
|
col.separator()
|
|
|
|
|
|
|
|
col.label(text="Transform:")
|
|
|
|
col.prop(edit, "drag_immediately")
|
|
|
|
|
2009-12-15 14:22:34 +00:00
|
|
|
row.separator()
|
|
|
|
row.separator()
|
2009-12-08 19:08:35 +00:00
|
|
|
|
2009-12-15 14:22:34 +00:00
|
|
|
col = row.column()
|
2009-12-08 19:08:35 +00:00
|
|
|
col.label(text="Duplicate Data:")
|
|
|
|
col.prop(edit, "duplicate_mesh", text="Mesh")
|
|
|
|
col.prop(edit, "duplicate_surface", text="Surface")
|
|
|
|
col.prop(edit, "duplicate_curve", text="Curve")
|
|
|
|
col.prop(edit, "duplicate_text", text="Text")
|
|
|
|
col.prop(edit, "duplicate_metaball", text="Metaball")
|
|
|
|
col.prop(edit, "duplicate_armature", text="Armature")
|
|
|
|
col.prop(edit, "duplicate_lamp", text="Lamp")
|
|
|
|
col.prop(edit, "duplicate_material", text="Material")
|
|
|
|
col.prop(edit, "duplicate_texture", text="Texture")
|
|
|
|
col.prop(edit, "duplicate_fcurve", text="F-Curve")
|
|
|
|
col.prop(edit, "duplicate_action", text="Action")
|
|
|
|
col.prop(edit, "duplicate_particle", text="Particle")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2009-08-18 12:58:51 +00:00
|
|
|
class USERPREF_PT_system(bpy.types.Panel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_space_type = 'USER_PREFERENCES'
|
|
|
|
bl_label = "System"
|
|
|
|
bl_region_type = 'WINDOW'
|
|
|
|
bl_show_header = False
|
|
|
|
|
|
|
|
def poll(self, context):
|
|
|
|
userpref = context.user_preferences
|
|
|
|
return (userpref.active_section == 'SYSTEM')
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
userpref = context.user_preferences
|
|
|
|
system = userpref.system
|
|
|
|
|
|
|
|
split = layout.split()
|
|
|
|
|
2010-01-09 15:49:27 +00:00
|
|
|
|
|
|
|
# 1. Column
|
2009-12-08 19:08:35 +00:00
|
|
|
column = split.column()
|
|
|
|
colsplit = column.split(percentage=0.85)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-12-08 19:08:35 +00:00
|
|
|
col = colsplit.column()
|
|
|
|
col.label(text="General:")
|
|
|
|
col.prop(system, "dpi")
|
|
|
|
col.prop(system, "frame_server_port")
|
|
|
|
col.prop(system, "scrollback", text="Console Scrollback")
|
2010-02-27 01:47:46 +00:00
|
|
|
col.prop(system, "auto_execute_scripts")
|
2010-03-06 21:45:46 +00:00
|
|
|
col.prop(system, "tabs_as_spaces")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-12-08 19:08:35 +00:00
|
|
|
col.separator()
|
|
|
|
col.separator()
|
|
|
|
col.separator()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-12-08 19:08:35 +00:00
|
|
|
col.label(text="Sound:")
|
|
|
|
col.row().prop(system, "audio_device", expand=True)
|
|
|
|
sub = col.column()
|
|
|
|
sub.active = system.audio_device != 'NONE'
|
|
|
|
#sub.prop(system, "enable_all_codecs")
|
|
|
|
sub.prop(system, "audio_channels", text="Channels")
|
|
|
|
sub.prop(system, "audio_mixing_buffer", text="Mixing Buffer")
|
|
|
|
sub.prop(system, "audio_sample_rate", text="Sample Rate")
|
|
|
|
sub.prop(system, "audio_sample_format", text="Sample Format")
|
2009-12-13 13:59:16 +00:00
|
|
|
|
2009-12-08 19:08:35 +00:00
|
|
|
col.separator()
|
|
|
|
col.separator()
|
|
|
|
col.separator()
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-21 10:28:19 +00:00
|
|
|
col.label(text="Screencast:")
|
|
|
|
col.prop(system, "screencast_fps")
|
2010-01-31 14:46:28 +00:00
|
|
|
col.prop(system, "screencast_wait_time")
|
2010-01-21 10:28:19 +00:00
|
|
|
col.separator()
|
|
|
|
col.separator()
|
|
|
|
col.separator()
|
2009-12-13 13:59:16 +00:00
|
|
|
|
2009-12-08 19:08:35 +00:00
|
|
|
#column = split.column()
|
|
|
|
#colsplit = column.split(percentage=0.85)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-12-08 19:08:35 +00:00
|
|
|
# No translation in 2.5 yet
|
|
|
|
#col.prop(system, "language")
|
|
|
|
#col.label(text="Translate:")
|
|
|
|
#col.prop(system, "translate_tooltips", text="Tooltips")
|
|
|
|
#col.prop(system, "translate_buttons", text="Labels")
|
|
|
|
#col.prop(system, "translate_toolbox", text="Toolbox")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-12-08 19:08:35 +00:00
|
|
|
#col.separator()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-12-08 19:08:35 +00:00
|
|
|
#col.prop(system, "use_textured_fonts")
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2010-01-09 15:49:27 +00:00
|
|
|
# 2. Column
|
2009-12-08 19:08:35 +00:00
|
|
|
column = split.column()
|
|
|
|
colsplit = column.split(percentage=0.85)
|
|
|
|
|
|
|
|
col = colsplit.column()
|
|
|
|
col.label(text="OpenGL:")
|
|
|
|
col.prop(system, "clip_alpha", slider=True)
|
|
|
|
col.prop(system, "use_mipmaps")
|
|
|
|
col.prop(system, "use_vbos")
|
2010-01-08 14:40:47 +00:00
|
|
|
#Anti-aliasing is disabled as it breaks broder/lasso select
|
|
|
|
#col.prop(system, "use_antialiasing")
|
2009-12-08 19:08:35 +00:00
|
|
|
col.label(text="Window Draw Method:")
|
2010-01-31 23:45:51 +00:00
|
|
|
col.prop(system, "window_draw_method", text="")
|
2009-12-08 19:08:35 +00:00
|
|
|
col.label(text="Textures:")
|
|
|
|
col.prop(system, "gl_texture_limit", text="Limit Size")
|
|
|
|
col.prop(system, "texture_time_out", text="Time Out")
|
|
|
|
col.prop(system, "texture_collection_rate", text="Collection Rate")
|
|
|
|
|
|
|
|
col.separator()
|
|
|
|
col.separator()
|
|
|
|
col.separator()
|
|
|
|
|
|
|
|
col.label(text="Sequencer:")
|
|
|
|
col.prop(system, "prefetch_frames")
|
|
|
|
col.prop(system, "memory_cache_limit")
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-01-09 15:49:27 +00:00
|
|
|
# 3. Column
|
2009-12-15 14:22:34 +00:00
|
|
|
column = split.column()
|
|
|
|
|
|
|
|
column.label(text="Solid OpenGL lights:")
|
|
|
|
|
|
|
|
split = column.split(percentage=0.1)
|
|
|
|
split.label()
|
|
|
|
split.label(text="Colors:")
|
|
|
|
split.label(text="Direction:")
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-09 15:49:27 +00:00
|
|
|
lamp = system.solid_lights[0]
|
|
|
|
opengl_lamp_buttons(column, lamp)
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-09 15:49:27 +00:00
|
|
|
lamp = system.solid_lights[1]
|
|
|
|
opengl_lamp_buttons(column, lamp)
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-09 15:49:27 +00:00
|
|
|
lamp = system.solid_lights[2]
|
|
|
|
opengl_lamp_buttons(column, lamp)
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2009-12-15 14:22:34 +00:00
|
|
|
column.separator()
|
|
|
|
column.separator()
|
|
|
|
column.separator()
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-09 15:49:27 +00:00
|
|
|
column.label(text="Color Picker Type:")
|
|
|
|
column.row().prop(system, "color_picker_type", text="")
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-09 15:49:27 +00:00
|
|
|
column.separator()
|
|
|
|
column.separator()
|
2010-01-09 06:44:54 +00:00
|
|
|
column.separator()
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-09 15:49:27 +00:00
|
|
|
column.prop(system, "use_weight_color_range", text="Custom Weight Paint Range")
|
|
|
|
sub = column.column()
|
2009-12-15 14:22:34 +00:00
|
|
|
sub.active = system.use_weight_color_range
|
|
|
|
sub.template_color_ramp(system, "weight_color_range", expand=True)
|
|
|
|
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
class USERPREF_PT_theme(bpy.types.Panel):
|
|
|
|
bl_space_type = 'USER_PREFERENCES'
|
|
|
|
bl_label = "Themes"
|
|
|
|
bl_region_type = 'WINDOW'
|
|
|
|
bl_show_header = False
|
|
|
|
|
|
|
|
def poll(self, context):
|
|
|
|
userpref = context.user_preferences
|
|
|
|
return (userpref.active_section == 'THEMES')
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
theme = context.user_preferences.themes[0]
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2010-01-09 18:17:40 +00:00
|
|
|
split_themes = layout.split(percentage=0.2)
|
|
|
|
split_themes.prop(theme, "theme_area", expand=True)
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2010-01-09 18:17:40 +00:00
|
|
|
split = split_themes.split()
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-09 18:17:40 +00:00
|
|
|
if theme.theme_area == 'USER_INTERFACE':
|
2009-11-03 07:23:02 +00:00
|
|
|
col = split.column()
|
|
|
|
|
2010-01-09 18:17:40 +00:00
|
|
|
ui = theme.user_interface.wcol_regular
|
|
|
|
col.label(text="Regular:")
|
|
|
|
ui_items_general(col, ui)
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2010-01-09 18:17:40 +00:00
|
|
|
ui = theme.user_interface.wcol_tool
|
|
|
|
col.label(text="Tool:")
|
|
|
|
ui_items_general(col, ui)
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2010-01-09 18:17:40 +00:00
|
|
|
ui = theme.user_interface.wcol_radio
|
|
|
|
col.label(text="Radio Buttons:")
|
|
|
|
ui_items_general(col, ui)
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2010-01-09 18:17:40 +00:00
|
|
|
ui = theme.user_interface.wcol_text
|
|
|
|
col.label(text="Text:")
|
|
|
|
ui_items_general(col, ui)
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2010-01-09 18:17:40 +00:00
|
|
|
ui = theme.user_interface.wcol_option
|
|
|
|
col.label(text="Option:")
|
|
|
|
ui_items_general(col, ui)
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2010-01-09 18:17:40 +00:00
|
|
|
ui = theme.user_interface.wcol_toggle
|
|
|
|
col.label(text="Toggle:")
|
|
|
|
ui_items_general(col, ui)
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2010-01-09 18:17:40 +00:00
|
|
|
ui = theme.user_interface.wcol_num
|
|
|
|
col.label(text="Number Field:")
|
|
|
|
ui_items_general(col, ui)
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2010-01-09 18:17:40 +00:00
|
|
|
ui = theme.user_interface.wcol_numslider
|
|
|
|
col.label(text="Value Slider:")
|
|
|
|
ui_items_general(col, ui)
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2010-01-09 18:17:40 +00:00
|
|
|
ui = theme.user_interface.wcol_box
|
|
|
|
col.label(text="Box:")
|
|
|
|
ui_items_general(col, ui)
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2010-01-09 18:17:40 +00:00
|
|
|
ui = theme.user_interface.wcol_menu
|
|
|
|
col.label(text="Menu:")
|
|
|
|
ui_items_general(col, ui)
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2010-01-09 18:17:40 +00:00
|
|
|
ui = theme.user_interface.wcol_pulldown
|
|
|
|
col.label(text="Pulldown:")
|
|
|
|
ui_items_general(col, ui)
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2010-01-09 18:17:40 +00:00
|
|
|
ui = theme.user_interface.wcol_menu_back
|
|
|
|
col.label(text="Menu Back:")
|
|
|
|
ui_items_general(col, ui)
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2010-01-09 18:17:40 +00:00
|
|
|
ui = theme.user_interface.wcol_menu_item
|
|
|
|
col.label(text="Menu Item:")
|
|
|
|
ui_items_general(col, ui)
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2010-01-09 18:17:40 +00:00
|
|
|
ui = theme.user_interface.wcol_scroll
|
|
|
|
col.label(text="Scroll Bar:")
|
|
|
|
ui_items_general(col, ui)
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2010-01-09 18:17:40 +00:00
|
|
|
ui = theme.user_interface.wcol_list_item
|
|
|
|
col.label(text="List Item:")
|
|
|
|
ui_items_general(col, ui)
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
ui = theme.user_interface.wcol_state
|
2010-01-09 18:17:40 +00:00
|
|
|
col.label(text="State:")
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2010-01-09 18:17:40 +00:00
|
|
|
row = col.row()
|
2009-12-08 19:08:35 +00:00
|
|
|
sub = row.column()
|
|
|
|
sub.prop(ui, "inner_anim")
|
|
|
|
sub.prop(ui, "inner_anim_sel")
|
|
|
|
sub = row.column()
|
|
|
|
sub.prop(ui, "inner_driven")
|
|
|
|
sub.prop(ui, "inner_driven_sel")
|
|
|
|
sub = row.column()
|
|
|
|
sub.prop(ui, "inner_key")
|
|
|
|
sub.prop(ui, "inner_key_sel")
|
|
|
|
sub = row.column()
|
|
|
|
sub.prop(ui, "blend")
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
ui = theme.user_interface
|
2010-01-09 18:17:40 +00:00
|
|
|
col.separator()
|
|
|
|
col.separator()
|
|
|
|
col.prop(ui, "icon_file")
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
layout.separator()
|
|
|
|
layout.separator()
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
|
2010-01-09 18:17:40 +00:00
|
|
|
elif theme.theme_area == 'VIEW_3D':
|
|
|
|
v3d = theme.view_3d
|
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
col.prop(v3d, "back")
|
|
|
|
col.prop(v3d, "button")
|
|
|
|
col.prop(v3d, "button_title")
|
|
|
|
col.prop(v3d, "button_text")
|
|
|
|
col.prop(v3d, "header")
|
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
col.prop(v3d, "grid")
|
|
|
|
col.prop(v3d, "wire")
|
|
|
|
col.prop(v3d, "lamp", slider=True)
|
|
|
|
col.prop(v3d, "editmesh_active", slider=True)
|
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
col.prop(v3d, "object_selected")
|
|
|
|
col.prop(v3d, "object_active")
|
|
|
|
col.prop(v3d, "object_grouped")
|
|
|
|
col.prop(v3d, "object_grouped_active")
|
|
|
|
col.prop(v3d, "transform")
|
2010-03-12 16:43:04 +00:00
|
|
|
col.prop(v3d, "nurb_uline")
|
|
|
|
col.prop(v3d, "nurb_vline")
|
|
|
|
col.prop(v3d, "nurb_sel_uline")
|
|
|
|
col.prop(v3d, "nurb_sel_vline")
|
|
|
|
col.prop(v3d, "handle_free")
|
|
|
|
col.prop(v3d, "handle_auto")
|
|
|
|
col.prop(v3d, "handle_vect")
|
|
|
|
col.prop(v3d, "handle_align")
|
|
|
|
col.prop(v3d, "handle_sel_free")
|
|
|
|
col.prop(v3d, "handle_sel_auto")
|
|
|
|
col.prop(v3d, "handle_sel_vect")
|
|
|
|
col.prop(v3d, "handle_sel_align")
|
|
|
|
col.prop(v3d, "act_spline")
|
2010-01-09 18:17:40 +00:00
|
|
|
|
|
|
|
col = split.column()
|
|
|
|
col.prop(v3d, "vertex")
|
|
|
|
col.prop(v3d, "face", slider=True)
|
|
|
|
col.prop(v3d, "normal")
|
2010-02-11 03:37:51 +00:00
|
|
|
col.prop(v3d, "vertex_normal")
|
2010-01-09 18:17:40 +00:00
|
|
|
col.prop(v3d, "bone_solid")
|
|
|
|
col.prop(v3d, "bone_pose")
|
2010-03-12 16:43:04 +00:00
|
|
|
col.prop(v3d, "edge_seam")
|
2010-01-09 18:17:40 +00:00
|
|
|
#col.prop(v3d, "edge") Doesn't seem to work
|
|
|
|
|
|
|
|
elif theme.theme_area == 'GRAPH_EDITOR':
|
2009-11-02 17:18:17 +00:00
|
|
|
graph = theme.graph_editor
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(graph, "back")
|
|
|
|
col.prop(graph, "button")
|
|
|
|
col.prop(graph, "button_title")
|
|
|
|
col.prop(graph, "button_text")
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(graph, "header")
|
|
|
|
col.prop(graph, "grid")
|
|
|
|
col.prop(graph, "list")
|
|
|
|
col.prop(graph, "channel_group")
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(graph, "active_channels_group")
|
|
|
|
col.prop(graph, "dopesheet_channel")
|
|
|
|
col.prop(graph, "dopesheet_subchannel")
|
|
|
|
col.prop(graph, "vertex")
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2009-11-11 16:27:00 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(graph, "current_frame")
|
|
|
|
col.prop(graph, "handle_vertex")
|
|
|
|
col.prop(graph, "handle_vertex_select")
|
|
|
|
col.separator()
|
|
|
|
col.prop(graph, "handle_vertex_size")
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2010-01-09 18:17:40 +00:00
|
|
|
elif theme.theme_area == 'FILE_BROWSER':
|
2009-11-14 13:35:44 +00:00
|
|
|
file_browse = theme.file_browser
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(file_browse, "back")
|
|
|
|
col.prop(file_browse, "text")
|
|
|
|
col.prop(file_browse, "text_hi")
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(file_browse, "header")
|
|
|
|
col.prop(file_browse, "list")
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(file_browse, "selected_file")
|
|
|
|
col.prop(file_browse, "tiles")
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(file_browse, "active_file")
|
|
|
|
col.prop(file_browse, "active_file_text")
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2010-01-09 18:17:40 +00:00
|
|
|
elif theme.theme_area == 'NLA_EDITOR':
|
2009-11-02 17:18:17 +00:00
|
|
|
nla = theme.nla_editor
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(nla, "back")
|
|
|
|
col.prop(nla, "button")
|
|
|
|
col.prop(nla, "button_title")
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(nla, "button_text")
|
|
|
|
col.prop(nla, "text")
|
|
|
|
col.prop(nla, "header")
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(nla, "grid")
|
|
|
|
col.prop(nla, "bars")
|
|
|
|
col.prop(nla, "bars_selected")
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(nla, "strips")
|
|
|
|
col.prop(nla, "strips_selected")
|
|
|
|
col.prop(nla, "current_frame")
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2010-01-09 18:17:40 +00:00
|
|
|
elif theme.theme_area == 'DOPESHEET_EDITOR':
|
2009-11-02 17:18:17 +00:00
|
|
|
dope = theme.dopesheet_editor
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(dope, "back")
|
|
|
|
col.prop(dope, "list")
|
|
|
|
col.prop(dope, "text")
|
|
|
|
col.prop(dope, "header")
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(dope, "grid")
|
|
|
|
col.prop(dope, "channels")
|
|
|
|
col.prop(dope, "channels_selected")
|
|
|
|
col.prop(dope, "channel_group")
|
2009-11-11 16:27:00 +00:00
|
|
|
|
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(dope, "active_channels_group")
|
|
|
|
col.prop(dope, "long_key")
|
|
|
|
col.prop(dope, "long_key_selected")
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(dope, "current_frame")
|
|
|
|
col.prop(dope, "dopesheet_channel")
|
|
|
|
col.prop(dope, "dopesheet_subchannel")
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2010-01-09 18:17:40 +00:00
|
|
|
elif theme.theme_area == 'IMAGE_EDITOR':
|
2009-11-02 17:18:17 +00:00
|
|
|
image = theme.image_editor
|
|
|
|
|
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(image, "back")
|
2010-01-19 01:32:06 +00:00
|
|
|
col.prop(image, "scope_back")
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(image, "button")
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(image, "button_title")
|
|
|
|
col.prop(image, "button_text")
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(image, "header")
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(image, "editmesh_active", slider=True)
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2010-01-09 18:17:40 +00:00
|
|
|
elif theme.theme_area == 'SEQUENCE_EDITOR':
|
2009-11-02 17:18:17 +00:00
|
|
|
seq = theme.sequence_editor
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(seq, "back")
|
|
|
|
col.prop(seq, "button")
|
|
|
|
col.prop(seq, "button_title")
|
|
|
|
col.prop(seq, "button_text")
|
|
|
|
col.prop(seq, "text")
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(seq, "header")
|
|
|
|
col.prop(seq, "grid")
|
|
|
|
col.prop(seq, "movie_strip")
|
|
|
|
col.prop(seq, "image_strip")
|
|
|
|
col.prop(seq, "scene_strip")
|
2009-11-11 16:27:00 +00:00
|
|
|
|
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(seq, "audio_strip")
|
|
|
|
col.prop(seq, "effect_strip")
|
|
|
|
col.prop(seq, "plugin_strip")
|
|
|
|
col.prop(seq, "transition_strip")
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(seq, "meta_strip")
|
|
|
|
col.prop(seq, "current_frame")
|
|
|
|
col.prop(seq, "keyframe")
|
|
|
|
col.prop(seq, "draw_action")
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2010-01-09 18:17:40 +00:00
|
|
|
elif theme.theme_area == 'PROPERTIES':
|
2009-11-02 17:18:17 +00:00
|
|
|
prop = theme.properties
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(prop, "back")
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2009-11-11 16:27:00 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(prop, "title")
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(prop, "text")
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(prop, "header")
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2010-01-09 18:17:40 +00:00
|
|
|
elif theme.theme_area == 'TEXT_EDITOR':
|
2009-11-02 17:18:17 +00:00
|
|
|
text = theme.text_editor
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(text, "back")
|
|
|
|
col.prop(text, "button")
|
|
|
|
col.prop(text, "button_title")
|
|
|
|
col.prop(text, "button_text")
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2009-11-11 16:27:00 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(text, "text")
|
|
|
|
col.prop(text, "text_hi")
|
|
|
|
col.prop(text, "header")
|
|
|
|
col.prop(text, "line_numbers_background")
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(text, "selected_text")
|
|
|
|
col.prop(text, "cursor")
|
|
|
|
col.prop(text, "syntax_builtin")
|
|
|
|
col.prop(text, "syntax_special")
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(text, "syntax_comment")
|
|
|
|
col.prop(text, "syntax_string")
|
|
|
|
col.prop(text, "syntax_numbers")
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2010-01-09 18:17:40 +00:00
|
|
|
elif theme.theme_area == 'TIMELINE':
|
2009-11-02 17:18:17 +00:00
|
|
|
time = theme.timeline
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(time, "back")
|
|
|
|
col.prop(time, "text")
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(time, "header")
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(time, "grid")
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2009-11-11 16:27:00 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(time, "current_frame")
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2010-01-09 18:17:40 +00:00
|
|
|
elif theme.theme_area == 'NODE_EDITOR':
|
2009-11-02 17:18:17 +00:00
|
|
|
node = theme.node_editor
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(node, "back")
|
|
|
|
col.prop(node, "button")
|
|
|
|
col.prop(node, "button_title")
|
|
|
|
col.prop(node, "button_text")
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(node, "text")
|
|
|
|
col.prop(node, "text_hi")
|
|
|
|
col.prop(node, "header")
|
|
|
|
col.prop(node, "wires")
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(node, "wire_select")
|
|
|
|
col.prop(node, "selected_text")
|
|
|
|
col.prop(node, "node_backdrop", slider=True)
|
|
|
|
col.prop(node, "in_out_node")
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(node, "converter_node")
|
|
|
|
col.prop(node, "operator_node")
|
|
|
|
col.prop(node, "group_node")
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2010-01-09 18:17:40 +00:00
|
|
|
elif theme.theme_area == 'LOGIC_EDITOR':
|
2009-11-02 17:18:17 +00:00
|
|
|
logic = theme.logic_editor
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(logic, "back")
|
|
|
|
col.prop(logic, "button")
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(logic, "button_title")
|
|
|
|
col.prop(logic, "button_text")
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(logic, "text")
|
|
|
|
col.prop(logic, "header")
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(logic, "panel")
|
2009-11-02 17:18:17 +00:00
|
|
|
|
2010-01-09 18:17:40 +00:00
|
|
|
elif theme.theme_area == 'OUTLINER':
|
2009-11-02 17:18:17 +00:00
|
|
|
out = theme.outliner
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(out, "back")
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(out, "text")
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2009-11-11 16:27:00 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(out, "text_hi")
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(out, "header")
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2010-01-09 18:17:40 +00:00
|
|
|
elif theme.theme_area == 'INFO':
|
2009-11-02 17:18:17 +00:00
|
|
|
info = theme.info
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(info, "back")
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(info, "header")
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(info, "header_text")
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
col = split.column()
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2010-01-09 18:17:40 +00:00
|
|
|
elif theme.theme_area == 'USER_PREFERENCES':
|
2009-11-02 17:18:17 +00:00
|
|
|
prefs = theme.user_preferences
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(prefs, "back")
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(prefs, "text")
|
2009-11-14 13:35:44 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(prefs, "header")
|
2009-11-03 07:23:02 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.prop(prefs, "header_text")
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-15 17:00:37 +00:00
|
|
|
elif theme.theme_area == 'CONSOLE':
|
|
|
|
prefs = theme.console
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-15 17:00:37 +00:00
|
|
|
col = split.column()
|
2010-02-11 17:41:17 +00:00
|
|
|
col.prop(prefs, "back")
|
2010-02-11 17:27:43 +00:00
|
|
|
col.prop(prefs, "header")
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-15 17:00:37 +00:00
|
|
|
col = split.column()
|
|
|
|
col.prop(prefs, "line_output")
|
|
|
|
col.prop(prefs, "line_input")
|
|
|
|
col.prop(prefs, "line_info")
|
|
|
|
col.prop(prefs, "line_error")
|
2010-02-15 02:39:40 +00:00
|
|
|
col.prop(prefs, "cursor")
|
2009-11-02 17:18:17 +00:00
|
|
|
|
|
|
|
|
Key Configuration
Keymaps are now saveable and configurable from the user preferences, note
that editing one item in a keymap means the whole keymap is now defined by
the user and will not be updated by Blender, an option for syncing might be
added later. The outliner interface is still there, but I will probably
remove it.
There's actually 3 levels now:
* Default builtin key configuration.
* Key configuration loaded from .py file, for configs like Blender 2.4x
or other 3D applications.
* Keymaps edited by the user and saved in .B.blend. These can be saved
to .py files as well to make creating distributable configurations
easier.
Also, user preferences sections were reorganized a bit, now there is:
Interface, Editing, Input, Files and System.
Implementation notes:
* wmKeyConfig was added which represents a key configuration containing
keymaps.
* wmKeymapItem was renamed to wmKeyMapItem for consistency with wmKeyMap.
* Modal maps are not wrapped yet.
* User preferences DNA file reading did not support newdataadr() yet,
added this now for reading keymaps.
* Key configuration related settings are now RNA wrapped.
* is_property_set and is_property_hidden python methods were added.
2009-10-08 18:40:03 +00:00
|
|
|
class USERPREF_PT_file(bpy.types.Panel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_space_type = 'USER_PREFERENCES'
|
|
|
|
bl_label = "Files"
|
|
|
|
bl_region_type = 'WINDOW'
|
|
|
|
bl_show_header = False
|
|
|
|
|
|
|
|
def poll(self, context):
|
|
|
|
userpref = context.user_preferences
|
|
|
|
return (userpref.active_section == 'FILES')
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
userpref = context.user_preferences
|
|
|
|
paths = userpref.filepaths
|
|
|
|
|
2009-12-08 19:08:35 +00:00
|
|
|
split = layout.split(percentage=0.7)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
col = split.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
col.label(text="File Paths:")
|
2009-12-13 13:59:16 +00:00
|
|
|
|
2009-12-08 19:08:35 +00:00
|
|
|
colsplit = col.split(percentage=0.95)
|
|
|
|
col1 = colsplit.split(percentage=0.3)
|
2009-12-13 13:59:16 +00:00
|
|
|
|
2009-12-08 19:08:35 +00:00
|
|
|
sub = col1.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.label(text="Fonts:")
|
|
|
|
sub.label(text="Textures:")
|
|
|
|
sub.label(text="Texture Plugins:")
|
|
|
|
sub.label(text="Sequence Plugins:")
|
|
|
|
sub.label(text="Render Output:")
|
|
|
|
sub.label(text="Scripts:")
|
|
|
|
sub.label(text="Sounds:")
|
|
|
|
sub.label(text="Temp:")
|
2010-03-07 09:23:57 +00:00
|
|
|
sub.label(text="Image Editor:")
|
2009-12-11 08:05:05 +00:00
|
|
|
sub.label(text="Animation Player:")
|
2009-12-13 13:59:16 +00:00
|
|
|
|
2009-12-08 19:08:35 +00:00
|
|
|
sub = col1.column()
|
|
|
|
sub.prop(paths, "fonts_directory", text="")
|
|
|
|
sub.prop(paths, "textures_directory", text="")
|
|
|
|
sub.prop(paths, "texture_plugin_directory", text="")
|
|
|
|
sub.prop(paths, "sequence_plugin_directory", text="")
|
|
|
|
sub.prop(paths, "render_output_directory", text="")
|
|
|
|
sub.prop(paths, "python_scripts_directory", text="")
|
|
|
|
sub.prop(paths, "sounds_directory", text="")
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.prop(paths, "temporary_directory", text="")
|
2010-03-07 09:23:57 +00:00
|
|
|
sub.prop(paths, "image_editor", text="")
|
2009-12-11 08:05:05 +00:00
|
|
|
subsplit = sub.split(percentage=0.3)
|
|
|
|
subsplit.prop(paths, "animation_player_preset", text="")
|
|
|
|
subsplit.prop(paths, "animation_player", text="")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
col = split.column()
|
2009-12-08 19:08:35 +00:00
|
|
|
col.label(text="Save & Load:")
|
|
|
|
col.prop(paths, "use_relative_paths")
|
|
|
|
col.prop(paths, "compress_file")
|
|
|
|
col.prop(paths, "load_ui")
|
|
|
|
col.prop(paths, "filter_file_extensions")
|
|
|
|
col.prop(paths, "hide_dot_files_datablocks")
|
2009-12-13 13:59:16 +00:00
|
|
|
|
2009-12-08 19:08:35 +00:00
|
|
|
col.separator()
|
|
|
|
col.separator()
|
|
|
|
|
|
|
|
col.label(text="Auto Save:")
|
|
|
|
col.prop(paths, "save_version")
|
|
|
|
col.prop(paths, "recent_files")
|
|
|
|
col.prop(paths, "save_preview_images")
|
|
|
|
col.prop(paths, "auto_save_temporary_files")
|
|
|
|
sub = col.column()
|
|
|
|
sub.enabled = paths.auto_save_temporary_files
|
|
|
|
sub.prop(paths, "auto_save_time", text="Timer (mins)")
|
2009-08-18 12:58:51 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
Key Configuration
Keymaps are now saveable and configurable from the user preferences, note
that editing one item in a keymap means the whole keymap is now defined by
the user and will not be updated by Blender, an option for syncing might be
added later. The outliner interface is still there, but I will probably
remove it.
There's actually 3 levels now:
* Default builtin key configuration.
* Key configuration loaded from .py file, for configs like Blender 2.4x
or other 3D applications.
* Keymaps edited by the user and saved in .B.blend. These can be saved
to .py files as well to make creating distributable configurations
easier.
Also, user preferences sections were reorganized a bit, now there is:
Interface, Editing, Input, Files and System.
Implementation notes:
* wmKeyConfig was added which represents a key configuration containing
keymaps.
* wmKeymapItem was renamed to wmKeyMapItem for consistency with wmKeyMap.
* Modal maps are not wrapped yet.
* User preferences DNA file reading did not support newdataadr() yet,
added this now for reading keymaps.
* Key configuration related settings are now RNA wrapped.
* is_property_set and is_property_hidden python methods were added.
2009-10-08 18:40:03 +00:00
|
|
|
class USERPREF_PT_input(bpy.types.Panel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_space_type = 'USER_PREFERENCES'
|
|
|
|
bl_label = "Input"
|
|
|
|
bl_region_type = 'WINDOW'
|
|
|
|
bl_show_header = False
|
|
|
|
|
|
|
|
def poll(self, context):
|
|
|
|
userpref = context.user_preferences
|
|
|
|
return (userpref.active_section == 'INPUT')
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2009-12-26 09:36:50 +00:00
|
|
|
def draw_entry(self, kc, entry, col, level=0):
|
2009-12-16 10:13:26 +00:00
|
|
|
idname, spaceid, regionid, children = entry
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2009-12-26 09:36:50 +00:00
|
|
|
km = kc.find_keymap(idname, space_type=spaceid, region_type=regionid)
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2009-12-16 10:13:26 +00:00
|
|
|
if km:
|
|
|
|
self.draw_km(kc, km, children, col, level)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-12-16 10:13:26 +00:00
|
|
|
def indented_layout(self, layout, level):
|
|
|
|
indentpx = 16
|
|
|
|
if level == 0:
|
|
|
|
level = 0.0001 # Tweak so that a percentage of 0 won't split by half
|
2009-12-26 09:36:50 +00:00
|
|
|
indent = level * indentpx / bpy.context.region.width
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2009-12-26 09:36:50 +00:00
|
|
|
split = layout.split(percentage=indent)
|
2009-12-16 10:13:26 +00:00
|
|
|
col = split.column()
|
|
|
|
col = split.column()
|
|
|
|
return col
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2009-12-16 10:13:26 +00:00
|
|
|
def draw_km(self, kc, km, children, layout, level):
|
2009-12-17 01:06:12 +00:00
|
|
|
km = km.active()
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2009-12-16 10:13:26 +00:00
|
|
|
layout.set_context_pointer("keymap", km)
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2009-12-16 10:13:26 +00:00
|
|
|
col = self.indented_layout(layout, level)
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2009-12-16 10:13:26 +00:00
|
|
|
row = col.row()
|
|
|
|
row.prop(km, "children_expanded", text="", no_bg=True)
|
|
|
|
row.label(text=km.name)
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2009-12-16 10:13:26 +00:00
|
|
|
row.label()
|
|
|
|
row.label()
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2010-01-25 07:19:28 +00:00
|
|
|
if km.modal:
|
|
|
|
row.label(text="", icon='LINKED')
|
2009-12-16 10:13:26 +00:00
|
|
|
if km.user_defined:
|
2010-01-29 02:01:02 +00:00
|
|
|
op = row.operator("wm.keymap_restore", text="Restore")
|
2009-12-16 10:13:26 +00:00
|
|
|
else:
|
2010-01-29 02:01:02 +00:00
|
|
|
op = row.operator("wm.keymap_edit", text="Edit")
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2009-12-16 10:13:26 +00:00
|
|
|
if km.children_expanded:
|
|
|
|
if children:
|
|
|
|
# Put the Parent key map's entries in a 'global' sub-category
|
|
|
|
# equal in hierarchy to the other children categories
|
|
|
|
subcol = self.indented_layout(col, level + 1)
|
|
|
|
subrow = subcol.row()
|
2009-12-17 01:21:55 +00:00
|
|
|
subrow.prop(km, "items_expanded", text="", no_bg=True)
|
2009-12-16 10:13:26 +00:00
|
|
|
subrow.label(text="%s (Global)" % km.name)
|
|
|
|
else:
|
|
|
|
km.items_expanded = True
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2009-12-16 10:13:26 +00:00
|
|
|
# Key Map items
|
|
|
|
if km.items_expanded:
|
|
|
|
for kmi in km.items:
|
|
|
|
self.draw_kmi(kc, km, kmi, col, level + 1)
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2009-12-16 10:13:26 +00:00
|
|
|
# "Add New" at end of keymap item list
|
2009-12-26 09:36:50 +00:00
|
|
|
col = self.indented_layout(col, level + 1)
|
2009-12-16 10:13:26 +00:00
|
|
|
subcol = col.split(percentage=0.2).column()
|
2010-03-06 00:17:10 +00:00
|
|
|
subcol.enabled = km.user_defined
|
2010-01-29 02:01:02 +00:00
|
|
|
op = subcol.operator("wm.keyitem_add", text="Add New", icon='ZOOMIN')
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2009-12-16 10:13:26 +00:00
|
|
|
col.separator()
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2009-12-16 10:13:26 +00:00
|
|
|
# Child key maps
|
|
|
|
if children:
|
|
|
|
subcol = col.column()
|
|
|
|
row = subcol.row()
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2009-12-16 10:13:26 +00:00
|
|
|
for entry in children:
|
|
|
|
self.draw_entry(kc, entry, col, level + 1)
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2009-12-16 10:13:26 +00:00
|
|
|
def draw_kmi(self, kc, km, kmi, layout, level):
|
2010-01-29 02:01:02 +00:00
|
|
|
map_type = kmi.map_type
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2009-12-16 10:13:26 +00:00
|
|
|
col = self.indented_layout(layout, level)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-12-16 10:13:26 +00:00
|
|
|
if km.user_defined:
|
|
|
|
col = col.column(align=True)
|
|
|
|
box = col.box()
|
|
|
|
else:
|
|
|
|
box = col.column()
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2010-01-29 19:38:56 +00:00
|
|
|
split = box.split(percentage=0.05)
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2009-12-16 10:13:26 +00:00
|
|
|
# header bar
|
2009-10-31 19:31:45 +00:00
|
|
|
row = split.row()
|
2009-12-16 10:13:26 +00:00
|
|
|
row.prop(kmi, "expanded", text="", no_bg=True)
|
2010-01-29 19:38:56 +00:00
|
|
|
|
|
|
|
row = split.row()
|
|
|
|
row.enabled = km.user_defined
|
2009-12-16 10:13:26 +00:00
|
|
|
row.prop(kmi, "active", text="", no_bg=True)
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2009-12-16 10:13:26 +00:00
|
|
|
if km.modal:
|
|
|
|
row.prop(kmi, "propvalue", text="")
|
|
|
|
else:
|
|
|
|
row.label(text=kmi.name)
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2009-12-16 10:13:26 +00:00
|
|
|
row = split.row()
|
2010-01-29 19:38:56 +00:00
|
|
|
row.enabled = km.user_defined
|
2009-12-16 10:13:26 +00:00
|
|
|
row.prop(kmi, "map_type", text="")
|
2010-01-29 02:01:02 +00:00
|
|
|
if map_type == 'KEYBOARD':
|
2009-12-16 10:13:26 +00:00
|
|
|
row.prop(kmi, "type", text="", full_event=True)
|
2010-01-29 02:01:02 +00:00
|
|
|
elif map_type == 'MOUSE':
|
2009-12-16 10:13:26 +00:00
|
|
|
row.prop(kmi, "type", text="", full_event=True)
|
2010-01-29 02:01:02 +00:00
|
|
|
elif map_type == 'TWEAK':
|
2009-12-16 10:13:26 +00:00
|
|
|
subrow = row.row()
|
|
|
|
subrow.prop(kmi, "type", text="")
|
|
|
|
subrow.prop(kmi, "value", text="")
|
2010-01-29 02:01:02 +00:00
|
|
|
elif map_type == 'TIMER':
|
2009-12-16 10:13:26 +00:00
|
|
|
row.prop(kmi, "type", text="")
|
|
|
|
else:
|
|
|
|
row.label()
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2010-01-29 02:01:02 +00:00
|
|
|
if kmi.id:
|
|
|
|
op = row.operator("wm.keyitem_restore", text="", icon='BACK')
|
|
|
|
op.item_id = kmi.id
|
|
|
|
op = row.operator("wm.keyitem_remove", text="", icon='X')
|
|
|
|
op.item_id = kmi.id
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2009-12-16 10:13:26 +00:00
|
|
|
# Expanded, additional event settings
|
|
|
|
if kmi.expanded:
|
|
|
|
box = col.box()
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-29 19:38:56 +00:00
|
|
|
box.enabled = km.user_defined
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2010-01-29 02:01:02 +00:00
|
|
|
if map_type not in ('TEXTINPUT', 'TIMER'):
|
2009-12-16 10:13:26 +00:00
|
|
|
split = box.split(percentage=0.4)
|
|
|
|
sub = split.row()
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2009-12-16 10:13:26 +00:00
|
|
|
if km.modal:
|
|
|
|
sub.prop(kmi, "propvalue", text="")
|
|
|
|
else:
|
|
|
|
sub.prop(kmi, "idname", text="")
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2009-12-16 10:13:26 +00:00
|
|
|
sub = split.column()
|
|
|
|
subrow = sub.row(align=True)
|
|
|
|
|
2010-01-29 02:01:02 +00:00
|
|
|
if map_type == 'KEYBOARD':
|
2009-12-16 10:13:26 +00:00
|
|
|
subrow.prop(kmi, "type", text="", event=True)
|
|
|
|
subrow.prop(kmi, "value", text="")
|
2010-01-29 02:01:02 +00:00
|
|
|
elif map_type == 'MOUSE':
|
2009-12-16 10:13:26 +00:00
|
|
|
subrow.prop(kmi, "type", text="")
|
|
|
|
subrow.prop(kmi, "value", text="")
|
|
|
|
|
|
|
|
subrow = sub.row()
|
|
|
|
subrow.scale_x = 0.75
|
|
|
|
subrow.prop(kmi, "any")
|
|
|
|
subrow.prop(kmi, "shift")
|
|
|
|
subrow.prop(kmi, "ctrl")
|
|
|
|
subrow.prop(kmi, "alt")
|
|
|
|
subrow.prop(kmi, "oskey", text="Cmd")
|
|
|
|
subrow.prop(kmi, "key_modifier", text="", event=True)
|
2010-01-31 14:46:28 +00:00
|
|
|
|
|
|
|
def display_properties(properties, title=None):
|
2010-01-21 21:58:40 +00:00
|
|
|
box.separator()
|
|
|
|
if title:
|
|
|
|
box.label(text=title)
|
|
|
|
flow = box.column_flow(columns=2)
|
|
|
|
for pname in dir(properties):
|
|
|
|
if not properties.is_property_hidden(pname):
|
|
|
|
value = eval("properties." + pname)
|
|
|
|
if isinstance(value, bpy.types.OperatorProperties):
|
2010-01-31 14:46:28 +00:00
|
|
|
display_properties(value, title=pname)
|
2010-01-21 21:58:40 +00:00
|
|
|
else:
|
|
|
|
flow.prop(properties, pname)
|
2009-12-16 10:13:26 +00:00
|
|
|
|
|
|
|
# Operator properties
|
|
|
|
props = kmi.properties
|
|
|
|
if props is not None:
|
2010-01-21 21:58:40 +00:00
|
|
|
display_properties(props)
|
2009-12-17 01:21:55 +00:00
|
|
|
|
|
|
|
# Modal key maps attached to this operator
|
2009-12-16 10:13:26 +00:00
|
|
|
if not km.modal:
|
|
|
|
kmm = kc.find_keymap_modal(kmi.idname)
|
|
|
|
if kmm:
|
|
|
|
self.draw_km(kc, kmm, None, layout, level + 1)
|
2010-01-29 02:01:02 +00:00
|
|
|
layout.set_context_pointer("keymap", km)
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2009-12-16 10:13:26 +00:00
|
|
|
def draw_input_prefs(self, inputs, layout):
|
|
|
|
# General settings
|
|
|
|
row = layout.row()
|
2009-10-31 19:31:45 +00:00
|
|
|
col = row.column()
|
|
|
|
|
|
|
|
sub = col.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.label(text="Mouse:")
|
2009-10-31 19:31:45 +00:00
|
|
|
sub1 = sub.column()
|
|
|
|
sub1.enabled = (inputs.select_mouse == 'RIGHT')
|
2009-11-23 00:27:30 +00:00
|
|
|
sub1.prop(inputs, "emulate_3_button_mouse")
|
|
|
|
sub.prop(inputs, "continuous_mouse")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.label(text="Select With:")
|
|
|
|
sub.row().prop(inputs, "select_mouse", expand=True)
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2009-12-15 14:22:34 +00:00
|
|
|
sub = col.column()
|
|
|
|
sub.label(text="Double Click:")
|
|
|
|
sub.prop(inputs, "double_click_time", text="Speed")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.separator()
|
2009-11-22 16:33:47 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.prop(inputs, "emulate_numpad")
|
2009-11-22 16:33:47 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.separator()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.label(text="Orbit Style:")
|
|
|
|
sub.row().prop(inputs, "view_rotation", expand=True)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.label(text="Zoom Style:")
|
|
|
|
sub.row().prop(inputs, "viewport_zoom_style", expand=True)
|
2009-11-28 04:43:15 +00:00
|
|
|
if inputs.viewport_zoom_style == 'DOLLY':
|
|
|
|
sub.row().prop(inputs, "zoom_axis", expand=True)
|
|
|
|
sub.prop(inputs, "invert_zoom_direction")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
#sub.prop(inputs, "use_middle_mouse_paste")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
#col.separator()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
#sub = col.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
#sub.label(text="Mouse Wheel:")
|
|
|
|
#sub.prop(view, "wheel_scroll_lines", text="Scroll Lines")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
col.separator()
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
sub = col.column()
|
2009-11-23 00:27:30 +00:00
|
|
|
sub.label(text="NDOF Device:")
|
|
|
|
sub.prop(inputs, "ndof_pan_speed", text="Pan Speed")
|
|
|
|
sub.prop(inputs, "ndof_rotate_speed", text="Orbit Speed")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
row.separator()
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2009-12-17 01:06:12 +00:00
|
|
|
def draw_filtered(self, kc, layout):
|
Keymap conflict detection operator.
Takes into account the hierarchical structures of keymaps as well as wildcards (KM_ANY) in event definitions, user remaps (emulate numpad, action/select mouse buttons, ...) and event values that overlap (click, press and release)
For now, doesn't do anything other than print conflicts in the console.
As a result, I cleaned up a lot of keymaps that had double definitions, moved some keymap items in more appropriate places, fixed wrong definitions and removed kmi that were added for testing a long long time ago.
Out of all the remaining conflicts, after removing obvious non-issues, here's what remains: http://www.pasteall.org/9898
2009-12-17 22:14:43 +00:00
|
|
|
filter = kc.filter.lower()
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2009-12-17 01:06:12 +00:00
|
|
|
for km in kc.keymaps:
|
2010-01-04 16:48:14 +00:00
|
|
|
km = km.active()
|
2010-01-30 21:48:07 +00:00
|
|
|
layout.set_context_pointer("keymap", km)
|
2010-01-04 16:48:14 +00:00
|
|
|
|
Keymap conflict detection operator.
Takes into account the hierarchical structures of keymaps as well as wildcards (KM_ANY) in event definitions, user remaps (emulate numpad, action/select mouse buttons, ...) and event values that overlap (click, press and release)
For now, doesn't do anything other than print conflicts in the console.
As a result, I cleaned up a lot of keymaps that had double definitions, moved some keymap items in more appropriate places, fixed wrong definitions and removed kmi that were added for testing a long long time ago.
Out of all the remaining conflicts, after removing obvious non-issues, here's what remains: http://www.pasteall.org/9898
2009-12-17 22:14:43 +00:00
|
|
|
filtered_items = [kmi for kmi in km.items if filter in kmi.name.lower()]
|
2009-12-29 00:04:57 +00:00
|
|
|
|
2009-12-17 01:06:12 +00:00
|
|
|
if len(filtered_items) != 0:
|
|
|
|
col = layout.column()
|
2009-12-29 00:04:57 +00:00
|
|
|
|
2009-12-17 01:06:12 +00:00
|
|
|
row = col.row()
|
|
|
|
row.label(text=km.name, icon="DOT")
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2009-12-17 01:06:12 +00:00
|
|
|
row.label()
|
|
|
|
row.label()
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2009-12-17 01:06:12 +00:00
|
|
|
if km.user_defined:
|
2010-01-29 02:01:02 +00:00
|
|
|
op = row.operator("wm.keymap_restore", text="Restore")
|
2009-12-17 01:06:12 +00:00
|
|
|
else:
|
2010-01-29 02:01:02 +00:00
|
|
|
op = row.operator("wm.keymap_edit", text="Edit")
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2009-12-17 01:06:12 +00:00
|
|
|
for kmi in filtered_items:
|
|
|
|
self.draw_kmi(kc, km, kmi, col, 1)
|
2009-12-29 00:04:57 +00:00
|
|
|
|
2009-12-28 09:19:32 +00:00
|
|
|
# "Add New" at end of keymap item list
|
|
|
|
col = self.indented_layout(layout, 1)
|
|
|
|
subcol = col.split(percentage=0.2).column()
|
2010-03-06 00:17:10 +00:00
|
|
|
subcol.enabled = km.user_defined
|
2010-01-29 02:01:02 +00:00
|
|
|
op = subcol.operator("wm.keyitem_add", text="Add New", icon='ZOOMIN')
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2009-12-17 01:06:12 +00:00
|
|
|
def draw_hierarchy(self, defkc, layout):
|
|
|
|
for entry in KM_HIERARCHY:
|
|
|
|
self.draw_entry(defkc, entry, layout)
|
|
|
|
|
2009-12-16 10:13:26 +00:00
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-29 02:01:02 +00:00
|
|
|
#import time
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-29 02:01:02 +00:00
|
|
|
#start = time.time()
|
2009-12-16 10:13:26 +00:00
|
|
|
|
|
|
|
userpref = context.user_preferences
|
|
|
|
wm = context.manager
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-12-16 10:13:26 +00:00
|
|
|
inputs = userpref.inputs
|
|
|
|
|
|
|
|
split = layout.split(percentage=0.25)
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2009-12-16 10:13:26 +00:00
|
|
|
# Input settings
|
|
|
|
self.draw_input_prefs(inputs, split)
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
# Keymap Settings
|
|
|
|
col = split.column()
|
2009-11-14 13:35:44 +00:00
|
|
|
# kc = wm.active_keyconfig
|
2009-12-17 01:06:12 +00:00
|
|
|
kc = wm.default_keyconfig
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2009-12-16 10:13:26 +00:00
|
|
|
sub = col.column()
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2009-12-17 01:06:12 +00:00
|
|
|
subsplit = sub.split()
|
|
|
|
subcol = subsplit.column()
|
2010-01-28 19:54:06 +00:00
|
|
|
row = subcol.row()
|
|
|
|
row.prop_object(wm, "active_keyconfig", wm, "keyconfigs", text="Configuration:")
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2010-01-31 14:46:28 +00:00
|
|
|
layout.set_context_pointer("keyconfig", wm.active_keyconfig)
|
2010-01-28 19:54:06 +00:00
|
|
|
row.operator("wm.keyconfig_remove", text="", icon='X')
|
|
|
|
|
|
|
|
row.prop(kc, "filter", icon="VIEWZOOM")
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2009-11-23 00:27:30 +00:00
|
|
|
col.separator()
|
2009-12-17 01:21:55 +00:00
|
|
|
|
2009-12-17 01:06:12 +00:00
|
|
|
if kc.filter != "":
|
|
|
|
self.draw_filtered(kc, col)
|
|
|
|
else:
|
|
|
|
self.draw_hierarchy(kc, col)
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-29 02:01:02 +00:00
|
|
|
#print("runtime", time.time() - start)
|
Key Configuration
Keymaps are now saveable and configurable from the user preferences, note
that editing one item in a keymap means the whole keymap is now defined by
the user and will not be updated by Blender, an option for syncing might be
added later. The outliner interface is still there, but I will probably
remove it.
There's actually 3 levels now:
* Default builtin key configuration.
* Key configuration loaded from .py file, for configs like Blender 2.4x
or other 3D applications.
* Keymaps edited by the user and saved in .B.blend. These can be saved
to .py files as well to make creating distributable configurations
easier.
Also, user preferences sections were reorganized a bit, now there is:
Interface, Editing, Input, Files and System.
Implementation notes:
* wmKeyConfig was added which represents a key configuration containing
keymaps.
* wmKeymapItem was renamed to wmKeyMapItem for consistency with wmKeyMap.
* Modal maps are not wrapped yet.
* User preferences DNA file reading did not support newdataadr() yet,
added this now for reading keymaps.
* Key configuration related settings are now RNA wrapped.
* is_property_set and is_property_hidden python methods were added.
2009-10-08 18:40:03 +00:00
|
|
|
|
|
|
|
|
2010-02-26 14:28:29 +00:00
|
|
|
class USERPREF_PT_addons(bpy.types.Panel):
|
2010-02-14 23:33:18 +00:00
|
|
|
bl_space_type = 'USER_PREFERENCES'
|
2010-02-26 14:28:29 +00:00
|
|
|
bl_label = "Addons"
|
2010-02-14 23:33:18 +00:00
|
|
|
bl_region_type = 'WINDOW'
|
|
|
|
bl_show_header = False
|
|
|
|
|
|
|
|
def poll(self, context):
|
|
|
|
userpref = context.user_preferences
|
2010-02-26 14:28:29 +00:00
|
|
|
return (userpref.active_section == 'ADDONS')
|
2010-02-14 23:33:18 +00:00
|
|
|
|
2010-02-26 14:28:29 +00:00
|
|
|
def _addon_list(self):
|
2010-02-14 23:33:18 +00:00
|
|
|
import sys
|
|
|
|
modules = []
|
|
|
|
loaded_modules = set()
|
2010-02-26 14:28:29 +00:00
|
|
|
paths = bpy.utils.script_paths("addons")
|
2010-02-14 23:33:18 +00:00
|
|
|
# sys.path.insert(0, None)
|
|
|
|
for path in paths:
|
|
|
|
# sys.path[0] = path
|
|
|
|
modules.extend(bpy.utils.modules_from_path(path, loaded_modules))
|
|
|
|
|
|
|
|
# del sys.path[0]
|
|
|
|
return modules
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
|
|
|
|
userpref = context.user_preferences
|
2010-02-26 14:28:29 +00:00
|
|
|
used_ext = {ext.module for ext in userpref.addons}
|
2010-03-14 23:26:17 +00:00
|
|
|
|
2010-03-13 00:14:36 +00:00
|
|
|
# collect the categories that can be filtered on
|
2010-03-14 23:19:44 +00:00
|
|
|
addons = [(mod, addon_info_get(mod)) for mod in self._addon_list()]
|
2010-03-14 20:07:15 +00:00
|
|
|
|
|
|
|
cats = {info["category"] for mod, info in addons}
|
|
|
|
cats.add("")
|
|
|
|
cats.remove("")
|
|
|
|
|
|
|
|
cats = ['All', 'Disabled', 'Enabled'] + sorted(cats)
|
2010-03-14 23:26:17 +00:00
|
|
|
|
2010-03-14 23:19:44 +00:00
|
|
|
bpy.types.Scene.EnumProperty(items=[(cats[i], cats[i], str(i)) for i in range(len(cats))],
|
2010-03-13 00:14:36 +00:00
|
|
|
name="Category", attr="addon_filter", description="Filter add-ons by category")
|
|
|
|
bpy.types.Scene.StringProperty(name="Search", attr="addon_search",
|
|
|
|
description="Search within the selected filter")
|
2010-02-14 23:33:18 +00:00
|
|
|
|
2010-03-13 00:14:36 +00:00
|
|
|
row = layout.row()
|
|
|
|
row.prop(context.scene, "addon_filter", text="Filter")
|
|
|
|
row.prop(context.scene, "addon_search", text="Search", icon='VIEWZOOM')
|
|
|
|
layout.separator()
|
2010-02-14 23:33:18 +00:00
|
|
|
|
2010-03-13 00:14:36 +00:00
|
|
|
filter = context.scene.addon_filter
|
2010-03-14 20:07:15 +00:00
|
|
|
search = context.scene.addon_search.lower()
|
|
|
|
|
2010-03-14 23:19:44 +00:00
|
|
|
for mod, info in addons:
|
2010-03-14 20:07:15 +00:00
|
|
|
module_name = mod.__name__
|
2010-03-14 23:19:44 +00:00
|
|
|
|
2010-03-13 00:14:36 +00:00
|
|
|
# check if add-on should be visible with current filters
|
2010-03-14 20:07:15 +00:00
|
|
|
if filter != "All" and \
|
|
|
|
filter != info["category"] and \
|
|
|
|
not (module_name not in used_ext and filter == "Disabled"):
|
|
|
|
|
2010-03-13 00:14:36 +00:00
|
|
|
continue
|
2010-03-14 20:07:15 +00:00
|
|
|
|
|
|
|
if search and search not in info["name"].lower():
|
|
|
|
if info["author"]:
|
|
|
|
if search not in info["author"].lower():
|
2010-03-13 00:14:36 +00:00
|
|
|
continue
|
|
|
|
else:
|
|
|
|
continue
|
2010-03-14 23:26:17 +00:00
|
|
|
|
2010-03-13 00:14:36 +00:00
|
|
|
# Addon UI Code
|
|
|
|
box = layout.column().box()
|
2010-03-14 17:32:35 +00:00
|
|
|
column = box.column()
|
2010-03-13 00:14:36 +00:00
|
|
|
row = column.row()
|
2010-03-14 23:26:17 +00:00
|
|
|
|
2010-03-13 00:14:36 +00:00
|
|
|
# Arrow #
|
|
|
|
# If there are Infos or UI is expanded
|
2010-03-14 23:19:44 +00:00
|
|
|
if info["expanded"]:
|
2010-03-13 00:14:36 +00:00
|
|
|
row.operator("wm.addon_expand", icon="TRIA_DOWN").module = module_name
|
2010-03-14 20:07:15 +00:00
|
|
|
elif info["author"] or info["version"] or info["url"] or info["location"]:
|
2010-03-13 00:14:36 +00:00
|
|
|
row.operator("wm.addon_expand", icon="TRIA_RIGHT").module = module_name
|
|
|
|
else:
|
|
|
|
# Else, block UI
|
|
|
|
arrow = row.column()
|
|
|
|
arrow.enabled = False
|
|
|
|
arrow.operator("wm.addon_expand", icon="TRIA_RIGHT").module = module_name
|
2010-03-14 20:07:15 +00:00
|
|
|
|
|
|
|
row.label(text=info["name"])
|
2010-02-26 14:28:29 +00:00
|
|
|
row.operator("wm.addon_disable" if module_name in used_ext else "wm.addon_enable").module = module_name
|
2010-03-14 23:19:44 +00:00
|
|
|
|
2010-03-13 00:14:36 +00:00
|
|
|
# Expanded UI (only if additional infos are available)
|
2010-03-14 23:19:44 +00:00
|
|
|
if info["expanded"]:
|
2010-03-14 20:07:15 +00:00
|
|
|
if info["author"]:
|
2010-03-13 00:14:36 +00:00
|
|
|
split = column.row().split(percentage=0.15)
|
|
|
|
split.label(text='Author:')
|
2010-03-14 20:07:15 +00:00
|
|
|
split.label(text=info["author"])
|
|
|
|
if info["version"]:
|
2010-03-13 00:14:36 +00:00
|
|
|
split = column.row().split(percentage=0.15)
|
|
|
|
split.label(text='Version:')
|
2010-03-14 20:07:15 +00:00
|
|
|
split.label(text=info["version"])
|
|
|
|
if info["location"]:
|
2010-03-13 00:44:09 +00:00
|
|
|
split = column.row().split(percentage=0.15)
|
|
|
|
split.label(text='Location:')
|
2010-03-14 20:07:15 +00:00
|
|
|
split.label(text=info["location"])
|
|
|
|
if info["url"]:
|
2010-03-13 00:14:36 +00:00
|
|
|
split = column.row().split(percentage=0.15)
|
2010-03-14 17:32:35 +00:00
|
|
|
split.label(text="Internet:")
|
2010-03-14 20:07:15 +00:00
|
|
|
split.operator("wm.addon_links", text="Link to the Wiki").link = info["url"]
|
2010-03-14 17:32:35 +00:00
|
|
|
split.separator()
|
|
|
|
split.separator()
|
2010-02-14 23:33:18 +00:00
|
|
|
|
2010-03-14 23:19:44 +00:00
|
|
|
|
define operator properties in the class, similar to django fields
# Before
[
bpy.props.StringProperty(attr="path", name="File Path", description="File path used for exporting the PLY file", maxlen= 1024, default= ""),
bpy.props.BoolProperty(attr="use_modifiers", name="Apply Modifiers", description="Apply Modifiers to the exported mesh", default= True),
bpy.props.BoolProperty(attr="use_normals", name="Export Normals", description="Export Normals for smooth and hard shaded faces", default= True),
bpy.props.BoolProperty(attr="use_uvs", name="Export UVs", description="Exort the active UV layer", default= True),
bpy.props.BoolProperty(attr="use_colors", name="Export Vertex Colors", description="Exort the active vertex color layer", default= True)
]
# After
path = StringProperty(attr="", name="File Path", description="File path used for exporting the PLY file", maxlen= 1024, default= "")
use_modifiers = BoolProperty(attr="", name="Apply Modifiers", description="Apply Modifiers to the exported mesh", default= True)
use_normals = BoolProperty(attr="", name="Export Normals", description="Export Normals for smooth and hard shaded faces", default= True)
use_uvs = BoolProperty(attr="", name="Export UVs", description="Exort the active UV layer", default= True)
use_colors = BoolProperty(attr="", name="Export Vertex Colors", description="Exort the active vertex color layer", default= True)
2009-10-31 16:40:14 +00:00
|
|
|
from bpy.props import *
|
|
|
|
|
2010-02-22 23:32:58 +00:00
|
|
|
|
2010-03-14 23:19:44 +00:00
|
|
|
def addon_info_get(mod, info_basis={"name": "", "author": "", "version": "", "blender": "", "location": "", "url": "", "category": "", "expanded": False}):
|
|
|
|
addon_info = getattr(mod, "bl_addon_info", {})
|
|
|
|
|
|
|
|
# avoid re-initializing
|
|
|
|
if "_init" in addon_info:
|
|
|
|
return addon_info
|
2010-03-14 23:26:17 +00:00
|
|
|
|
2010-03-14 23:19:44 +00:00
|
|
|
if not addon_info:
|
|
|
|
mod.bl_addon_info = addon_info
|
|
|
|
|
|
|
|
for key, value in info_basis.items():
|
|
|
|
addon_info.setdefault(key, value)
|
|
|
|
|
|
|
|
if not addon_info["name"]:
|
|
|
|
addon_info["name"] = mod.__name__
|
|
|
|
|
|
|
|
addon_info["_init"] = None
|
|
|
|
return addon_info
|
|
|
|
|
|
|
|
|
2010-02-26 14:28:29 +00:00
|
|
|
class WM_OT_addon_enable(bpy.types.Operator):
|
|
|
|
"Enable an addon"
|
|
|
|
bl_idname = "wm.addon_enable"
|
|
|
|
bl_label = "Enable Add-On"
|
2010-02-14 23:33:18 +00:00
|
|
|
|
2010-02-26 14:28:29 +00:00
|
|
|
module = StringProperty(name="Module", description="Module name of the addon to enable")
|
2010-02-14 23:33:18 +00:00
|
|
|
|
|
|
|
def execute(self, context):
|
|
|
|
module_name = self.properties.module
|
2010-02-22 23:32:58 +00:00
|
|
|
|
2010-02-14 23:33:18 +00:00
|
|
|
try:
|
|
|
|
mod = __import__(module_name)
|
|
|
|
mod.register()
|
|
|
|
except:
|
2010-03-14 23:19:44 +00:00
|
|
|
import traceback
|
2010-02-14 23:33:18 +00:00
|
|
|
traceback.print_exc()
|
2010-03-14 23:19:44 +00:00
|
|
|
return {'CANCELLED'}
|
|
|
|
|
|
|
|
ext = context.user_preferences.addons.new()
|
|
|
|
ext.module = module_name
|
|
|
|
|
2010-03-13 00:14:36 +00:00
|
|
|
# check if add-on is written for current blender version, or raise a warning
|
2010-03-14 23:19:44 +00:00
|
|
|
info = addon_info_get(mod)
|
|
|
|
|
|
|
|
if info["blender"]:
|
|
|
|
version = info["blender"].split(".", 2)
|
2010-03-13 00:14:36 +00:00
|
|
|
for i in range(len(version)):
|
|
|
|
try:
|
|
|
|
version[i] = int(version[i])
|
|
|
|
except:
|
|
|
|
break
|
2010-03-14 23:19:44 +00:00
|
|
|
|
|
|
|
if version[i] > bpy.app.version[i]:
|
|
|
|
self.report("WARNING','This script was written for a newer version of Blender \
|
|
|
|
and might not function (correctly).\nThe script is enabled though.")
|
|
|
|
elif version[i] == bpy.app.version[i]:
|
2010-03-13 00:14:36 +00:00
|
|
|
continue
|
|
|
|
else:
|
|
|
|
break
|
2010-02-14 23:33:18 +00:00
|
|
|
|
|
|
|
return {'FINISHED'}
|
|
|
|
|
|
|
|
|
2010-02-26 14:28:29 +00:00
|
|
|
class WM_OT_addon_disable(bpy.types.Operator):
|
|
|
|
"Disable an addon"
|
|
|
|
bl_idname = "wm.addon_disable"
|
|
|
|
bl_label = "Disable Add-On"
|
2010-02-14 23:33:18 +00:00
|
|
|
|
2010-02-26 14:28:29 +00:00
|
|
|
module = StringProperty(name="Module", description="Module name of the addon to disable")
|
2010-02-14 23:33:18 +00:00
|
|
|
|
|
|
|
def execute(self, context):
|
|
|
|
import traceback
|
|
|
|
module_name = self.properties.module
|
|
|
|
|
|
|
|
try:
|
|
|
|
mod = __import__(module_name)
|
|
|
|
mod.unregister()
|
|
|
|
except:
|
|
|
|
traceback.print_exc()
|
2010-02-22 23:32:58 +00:00
|
|
|
|
2010-02-26 14:28:29 +00:00
|
|
|
addons = context.user_preferences.addons
|
2010-02-14 23:33:18 +00:00
|
|
|
ok = True
|
|
|
|
while ok: # incase its in more then once.
|
|
|
|
ok = False
|
2010-02-26 14:28:29 +00:00
|
|
|
for ext in addons:
|
2010-02-14 23:33:18 +00:00
|
|
|
if ext.module == module_name:
|
2010-02-26 14:28:29 +00:00
|
|
|
addons.remove(ext)
|
2010-02-14 23:33:18 +00:00
|
|
|
ok = True
|
|
|
|
break
|
|
|
|
|
|
|
|
return {'FINISHED'}
|
|
|
|
|
2009-12-26 09:36:50 +00:00
|
|
|
|
2010-02-26 14:28:29 +00:00
|
|
|
class WM_OT_addon_install(bpy.types.Operator):
|
|
|
|
"Install an addon"
|
|
|
|
bl_idname = "wm.addon_install"
|
|
|
|
bl_label = "Install Add-On"
|
2010-02-16 19:22:37 +00:00
|
|
|
|
2010-02-26 14:28:29 +00:00
|
|
|
module = StringProperty(name="Module", description="Module name of the addon to disable")
|
2010-02-22 23:32:58 +00:00
|
|
|
|
2010-02-16 19:22:37 +00:00
|
|
|
path = StringProperty(name="File Path", description="File path to write file to")
|
|
|
|
filename = StringProperty(name="File Name", description="Name of the file")
|
|
|
|
directory = StringProperty(name="Directory", description="Directory of the file")
|
|
|
|
filter_folder = BoolProperty(name="Filter folders", description="", default=True, options={'HIDDEN'})
|
|
|
|
filter_python = BoolProperty(name="Filter python", description="", default=True, options={'HIDDEN'})
|
|
|
|
|
|
|
|
def execute(self, context):
|
|
|
|
import traceback
|
2010-02-27 22:36:37 +00:00
|
|
|
import zipfile
|
2010-02-16 19:22:37 +00:00
|
|
|
pyfile = self.properties.path
|
|
|
|
|
2010-02-27 22:36:37 +00:00
|
|
|
path_addons = bpy.utils.script_paths("addons")[-1]
|
2010-02-16 19:22:37 +00:00
|
|
|
|
2010-02-27 22:36:37 +00:00
|
|
|
#check to see if the file is in compressed format (.zip)
|
|
|
|
if zipfile.is_zipfile(pyfile):
|
|
|
|
try:
|
|
|
|
file_to_extract = zipfile.ZipFile(pyfile, 'r')
|
2010-02-22 23:32:58 +00:00
|
|
|
|
2010-02-27 22:36:37 +00:00
|
|
|
#extract the file to "addons"
|
|
|
|
file_to_extract.extractall(path_addons)
|
2010-03-06 01:40:29 +00:00
|
|
|
|
2010-02-27 22:36:37 +00:00
|
|
|
except:
|
|
|
|
traceback.print_exc()
|
|
|
|
return {'CANCELLED'}
|
2010-02-16 19:22:37 +00:00
|
|
|
|
2010-02-27 22:36:37 +00:00
|
|
|
else:
|
|
|
|
path_dest = os.path.join(path_addons, os.path.basename(pyfile))
|
|
|
|
|
|
|
|
if os.path.exists(path_dest):
|
|
|
|
self.report({'WARNING'}, "File already installed to '%s'\n" % path_dest)
|
|
|
|
return {'CANCELLED'}
|
|
|
|
|
|
|
|
#if not compressed file just copy into the addon path
|
|
|
|
try:
|
|
|
|
shutil.copyfile(pyfile, path_dest)
|
|
|
|
|
|
|
|
except:
|
|
|
|
traceback.print_exc()
|
|
|
|
return {'CANCELLED'}
|
2010-02-16 19:22:37 +00:00
|
|
|
|
|
|
|
# TODO, should not be a warning.
|
|
|
|
# self.report({'WARNING'}, "File installed to '%s'\n" % path_dest)
|
|
|
|
return {'FINISHED'}
|
|
|
|
|
|
|
|
def invoke(self, context, event):
|
2010-02-26 14:28:29 +00:00
|
|
|
paths = bpy.utils.script_paths("addons")
|
2010-02-16 19:22:37 +00:00
|
|
|
if not paths:
|
2010-02-26 14:28:29 +00:00
|
|
|
self.report({'ERROR'}, "No 'addons' path could be found in " + str(bpy.utils.script_paths()))
|
2010-02-16 19:22:37 +00:00
|
|
|
return {'CANCELLED'}
|
2010-02-22 23:32:58 +00:00
|
|
|
|
2010-02-16 19:22:37 +00:00
|
|
|
wm = context.manager
|
|
|
|
wm.add_fileselect(self)
|
|
|
|
return {'RUNNING_MODAL'}
|
|
|
|
|
|
|
|
|
2010-03-13 00:14:36 +00:00
|
|
|
class WM_OT_addon_expand(bpy.types.Operator):
|
|
|
|
"Display more information on this add-on"
|
|
|
|
bl_idname = "wm.addon_expand"
|
|
|
|
bl_label = ""
|
|
|
|
|
|
|
|
module = StringProperty(name="Module", description="Module name of the addon to expand")
|
|
|
|
|
|
|
|
def execute(self, context):
|
|
|
|
module_name = self.properties.module
|
|
|
|
|
2010-03-14 23:19:44 +00:00
|
|
|
# unlikely to fail, module should have alredy been imported
|
2010-03-13 00:14:36 +00:00
|
|
|
try:
|
|
|
|
mod = __import__(module_name)
|
|
|
|
except:
|
2010-03-14 23:19:44 +00:00
|
|
|
import traceback
|
2010-03-13 00:14:36 +00:00
|
|
|
traceback.print_exc()
|
2010-03-14 23:19:44 +00:00
|
|
|
return {'CANCELLED'}
|
2010-03-13 00:14:36 +00:00
|
|
|
|
2010-03-14 23:19:44 +00:00
|
|
|
info = addon_info_get(mod)
|
|
|
|
info["expanded"] = not info["expanded"]
|
|
|
|
print(info["expanded"])
|
2010-03-13 00:14:36 +00:00
|
|
|
return {'FINISHED'}
|
|
|
|
|
|
|
|
|
|
|
|
class WM_OT_addon_links(bpy.types.Operator):
|
2010-03-14 17:32:35 +00:00
|
|
|
"Open the Blender Wiki in the Webbrowser"
|
2010-03-13 00:14:36 +00:00
|
|
|
bl_idname = "wm.addon_links"
|
|
|
|
bl_label = ""
|
|
|
|
|
|
|
|
link = StringProperty(name="Link", description="Link to open")
|
|
|
|
|
|
|
|
def execute(self, context):
|
|
|
|
import webbrowser
|
|
|
|
webbrowser.open(self.properties.link)
|
|
|
|
return {'FINISHED'}
|
|
|
|
|
|
|
|
|
Keymap conflict detection operator.
Takes into account the hierarchical structures of keymaps as well as wildcards (KM_ANY) in event definitions, user remaps (emulate numpad, action/select mouse buttons, ...) and event values that overlap (click, press and release)
For now, doesn't do anything other than print conflicts in the console.
As a result, I cleaned up a lot of keymaps that had double definitions, moved some keymap items in more appropriate places, fixed wrong definitions and removed kmi that were added for testing a long long time ago.
Out of all the remaining conflicts, after removing obvious non-issues, here's what remains: http://www.pasteall.org/9898
2009-12-17 22:14:43 +00:00
|
|
|
class WM_OT_keyconfig_test(bpy.types.Operator):
|
2010-02-11 02:03:18 +00:00
|
|
|
"Test keyconfig for conflicts"
|
Keymap conflict detection operator.
Takes into account the hierarchical structures of keymaps as well as wildcards (KM_ANY) in event definitions, user remaps (emulate numpad, action/select mouse buttons, ...) and event values that overlap (click, press and release)
For now, doesn't do anything other than print conflicts in the console.
As a result, I cleaned up a lot of keymaps that had double definitions, moved some keymap items in more appropriate places, fixed wrong definitions and removed kmi that were added for testing a long long time ago.
Out of all the remaining conflicts, after removing obvious non-issues, here's what remains: http://www.pasteall.org/9898
2009-12-17 22:14:43 +00:00
|
|
|
bl_idname = "wm.keyconfig_test"
|
|
|
|
bl_label = "Test Key Configuration for Conflicts"
|
2009-12-26 09:36:50 +00:00
|
|
|
|
|
|
|
def testEntry(self, kc, entry, src=None, parent=None):
|
Keymap conflict detection operator.
Takes into account the hierarchical structures of keymaps as well as wildcards (KM_ANY) in event definitions, user remaps (emulate numpad, action/select mouse buttons, ...) and event values that overlap (click, press and release)
For now, doesn't do anything other than print conflicts in the console.
As a result, I cleaned up a lot of keymaps that had double definitions, moved some keymap items in more appropriate places, fixed wrong definitions and removed kmi that were added for testing a long long time ago.
Out of all the remaining conflicts, after removing obvious non-issues, here's what remains: http://www.pasteall.org/9898
2009-12-17 22:14:43 +00:00
|
|
|
result = False
|
2009-12-26 09:36:50 +00:00
|
|
|
|
Keymap conflict detection operator.
Takes into account the hierarchical structures of keymaps as well as wildcards (KM_ANY) in event definitions, user remaps (emulate numpad, action/select mouse buttons, ...) and event values that overlap (click, press and release)
For now, doesn't do anything other than print conflicts in the console.
As a result, I cleaned up a lot of keymaps that had double definitions, moved some keymap items in more appropriate places, fixed wrong definitions and removed kmi that were added for testing a long long time ago.
Out of all the remaining conflicts, after removing obvious non-issues, here's what remains: http://www.pasteall.org/9898
2009-12-17 22:14:43 +00:00
|
|
|
def kmistr(kmi):
|
|
|
|
if km.modal:
|
|
|
|
s = ["kmi = km.add_modal_item(\'%s\', \'%s\', \'%s\'" % (kmi.propvalue, kmi.type, kmi.value)]
|
|
|
|
else:
|
|
|
|
s = ["kmi = km.add_item(\'%s\', \'%s\', \'%s\'" % (kmi.idname, kmi.type, kmi.value)]
|
|
|
|
|
|
|
|
if kmi.any:
|
|
|
|
s.append(", any=True")
|
|
|
|
else:
|
|
|
|
if kmi.shift:
|
|
|
|
s.append(", shift=True")
|
|
|
|
if kmi.ctrl:
|
|
|
|
s.append(", ctrl=True")
|
|
|
|
if kmi.alt:
|
|
|
|
s.append(", alt=True")
|
|
|
|
if kmi.oskey:
|
|
|
|
s.append(", oskey=True")
|
|
|
|
if kmi.key_modifier and kmi.key_modifier != 'NONE':
|
|
|
|
s.append(", key_modifier=\'%s\'" % kmi.key_modifier)
|
2009-12-26 09:36:50 +00:00
|
|
|
|
Keymap conflict detection operator.
Takes into account the hierarchical structures of keymaps as well as wildcards (KM_ANY) in event definitions, user remaps (emulate numpad, action/select mouse buttons, ...) and event values that overlap (click, press and release)
For now, doesn't do anything other than print conflicts in the console.
As a result, I cleaned up a lot of keymaps that had double definitions, moved some keymap items in more appropriate places, fixed wrong definitions and removed kmi that were added for testing a long long time ago.
Out of all the remaining conflicts, after removing obvious non-issues, here's what remains: http://www.pasteall.org/9898
2009-12-17 22:14:43 +00:00
|
|
|
s.append(")\n")
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-21 21:58:40 +00:00
|
|
|
def export_properties(prefix, properties):
|
|
|
|
for pname in dir(properties):
|
|
|
|
if not properties.is_property_hidden(pname):
|
|
|
|
value = eval("properties.%s" % pname)
|
|
|
|
if isinstance(value, bpy.types.OperatorProperties):
|
|
|
|
export_properties(prefix + "." + pname, value)
|
|
|
|
elif properties.is_property_set(pname):
|
|
|
|
value = _string_value(value)
|
|
|
|
if value != "":
|
|
|
|
s.append(prefix + ".%s = %s\n" % (pname, value))
|
2009-12-26 09:36:50 +00:00
|
|
|
|
Keymap conflict detection operator.
Takes into account the hierarchical structures of keymaps as well as wildcards (KM_ANY) in event definitions, user remaps (emulate numpad, action/select mouse buttons, ...) and event values that overlap (click, press and release)
For now, doesn't do anything other than print conflicts in the console.
As a result, I cleaned up a lot of keymaps that had double definitions, moved some keymap items in more appropriate places, fixed wrong definitions and removed kmi that were added for testing a long long time ago.
Out of all the remaining conflicts, after removing obvious non-issues, here's what remains: http://www.pasteall.org/9898
2009-12-17 22:14:43 +00:00
|
|
|
props = kmi.properties
|
|
|
|
|
|
|
|
if props is not None:
|
2010-01-21 21:58:40 +00:00
|
|
|
export_properties("kmi.properties", props)
|
2009-12-26 09:36:50 +00:00
|
|
|
|
Keymap conflict detection operator.
Takes into account the hierarchical structures of keymaps as well as wildcards (KM_ANY) in event definitions, user remaps (emulate numpad, action/select mouse buttons, ...) and event values that overlap (click, press and release)
For now, doesn't do anything other than print conflicts in the console.
As a result, I cleaned up a lot of keymaps that had double definitions, moved some keymap items in more appropriate places, fixed wrong definitions and removed kmi that were added for testing a long long time ago.
Out of all the remaining conflicts, after removing obvious non-issues, here's what remains: http://www.pasteall.org/9898
2009-12-17 22:14:43 +00:00
|
|
|
return "".join(s).strip()
|
2009-12-26 09:36:50 +00:00
|
|
|
|
Keymap conflict detection operator.
Takes into account the hierarchical structures of keymaps as well as wildcards (KM_ANY) in event definitions, user remaps (emulate numpad, action/select mouse buttons, ...) and event values that overlap (click, press and release)
For now, doesn't do anything other than print conflicts in the console.
As a result, I cleaned up a lot of keymaps that had double definitions, moved some keymap items in more appropriate places, fixed wrong definitions and removed kmi that were added for testing a long long time ago.
Out of all the remaining conflicts, after removing obvious non-issues, here's what remains: http://www.pasteall.org/9898
2009-12-17 22:14:43 +00:00
|
|
|
idname, spaceid, regionid, children = entry
|
define operator properties in the class, similar to django fields
# Before
[
bpy.props.StringProperty(attr="path", name="File Path", description="File path used for exporting the PLY file", maxlen= 1024, default= ""),
bpy.props.BoolProperty(attr="use_modifiers", name="Apply Modifiers", description="Apply Modifiers to the exported mesh", default= True),
bpy.props.BoolProperty(attr="use_normals", name="Export Normals", description="Export Normals for smooth and hard shaded faces", default= True),
bpy.props.BoolProperty(attr="use_uvs", name="Export UVs", description="Exort the active UV layer", default= True),
bpy.props.BoolProperty(attr="use_colors", name="Export Vertex Colors", description="Exort the active vertex color layer", default= True)
]
# After
path = StringProperty(attr="", name="File Path", description="File path used for exporting the PLY file", maxlen= 1024, default= "")
use_modifiers = BoolProperty(attr="", name="Apply Modifiers", description="Apply Modifiers to the exported mesh", default= True)
use_normals = BoolProperty(attr="", name="Export Normals", description="Export Normals for smooth and hard shaded faces", default= True)
use_uvs = BoolProperty(attr="", name="Export UVs", description="Exort the active UV layer", default= True)
use_colors = BoolProperty(attr="", name="Export Vertex Colors", description="Exort the active vertex color layer", default= True)
2009-10-31 16:40:14 +00:00
|
|
|
|
2009-12-26 09:36:50 +00:00
|
|
|
km = kc.find_keymap(idname, space_type=spaceid, region_type=regionid)
|
|
|
|
|
Keymap conflict detection operator.
Takes into account the hierarchical structures of keymaps as well as wildcards (KM_ANY) in event definitions, user remaps (emulate numpad, action/select mouse buttons, ...) and event values that overlap (click, press and release)
For now, doesn't do anything other than print conflicts in the console.
As a result, I cleaned up a lot of keymaps that had double definitions, moved some keymap items in more appropriate places, fixed wrong definitions and removed kmi that were added for testing a long long time ago.
Out of all the remaining conflicts, after removing obvious non-issues, here's what remains: http://www.pasteall.org/9898
2009-12-17 22:14:43 +00:00
|
|
|
if km:
|
|
|
|
km = km.active()
|
2009-12-26 09:36:50 +00:00
|
|
|
|
Keymap conflict detection operator.
Takes into account the hierarchical structures of keymaps as well as wildcards (KM_ANY) in event definitions, user remaps (emulate numpad, action/select mouse buttons, ...) and event values that overlap (click, press and release)
For now, doesn't do anything other than print conflicts in the console.
As a result, I cleaned up a lot of keymaps that had double definitions, moved some keymap items in more appropriate places, fixed wrong definitions and removed kmi that were added for testing a long long time ago.
Out of all the remaining conflicts, after removing obvious non-issues, here's what remains: http://www.pasteall.org/9898
2009-12-17 22:14:43 +00:00
|
|
|
if src:
|
|
|
|
for item in km.items:
|
|
|
|
if src.compare(item):
|
|
|
|
print("===========")
|
|
|
|
print(parent.name)
|
|
|
|
print(kmistr(src))
|
|
|
|
print(km.name)
|
|
|
|
print(kmistr(item))
|
|
|
|
result = True
|
2009-12-26 09:36:50 +00:00
|
|
|
|
Keymap conflict detection operator.
Takes into account the hierarchical structures of keymaps as well as wildcards (KM_ANY) in event definitions, user remaps (emulate numpad, action/select mouse buttons, ...) and event values that overlap (click, press and release)
For now, doesn't do anything other than print conflicts in the console.
As a result, I cleaned up a lot of keymaps that had double definitions, moved some keymap items in more appropriate places, fixed wrong definitions and removed kmi that were added for testing a long long time ago.
Out of all the remaining conflicts, after removing obvious non-issues, here's what remains: http://www.pasteall.org/9898
2009-12-17 22:14:43 +00:00
|
|
|
for child in children:
|
|
|
|
if self.testEntry(kc, child, src, parent):
|
|
|
|
result = True
|
|
|
|
else:
|
|
|
|
for i in range(len(km.items)):
|
|
|
|
src = km.items[i]
|
2009-12-26 09:36:50 +00:00
|
|
|
|
Keymap conflict detection operator.
Takes into account the hierarchical structures of keymaps as well as wildcards (KM_ANY) in event definitions, user remaps (emulate numpad, action/select mouse buttons, ...) and event values that overlap (click, press and release)
For now, doesn't do anything other than print conflicts in the console.
As a result, I cleaned up a lot of keymaps that had double definitions, moved some keymap items in more appropriate places, fixed wrong definitions and removed kmi that were added for testing a long long time ago.
Out of all the remaining conflicts, after removing obvious non-issues, here's what remains: http://www.pasteall.org/9898
2009-12-17 22:14:43 +00:00
|
|
|
for child in children:
|
|
|
|
if self.testEntry(kc, child, src, km):
|
|
|
|
result = True
|
|
|
|
|
|
|
|
for j in range(len(km.items) - i - 1):
|
|
|
|
item = km.items[j + i + 1]
|
|
|
|
if src.compare(item):
|
|
|
|
print("===========")
|
|
|
|
print(km.name)
|
|
|
|
print(kmistr(src))
|
|
|
|
print(kmistr(item))
|
|
|
|
result = True
|
2009-12-26 09:36:50 +00:00
|
|
|
|
Keymap conflict detection operator.
Takes into account the hierarchical structures of keymaps as well as wildcards (KM_ANY) in event definitions, user remaps (emulate numpad, action/select mouse buttons, ...) and event values that overlap (click, press and release)
For now, doesn't do anything other than print conflicts in the console.
As a result, I cleaned up a lot of keymaps that had double definitions, moved some keymap items in more appropriate places, fixed wrong definitions and removed kmi that were added for testing a long long time ago.
Out of all the remaining conflicts, after removing obvious non-issues, here's what remains: http://www.pasteall.org/9898
2009-12-17 22:14:43 +00:00
|
|
|
for child in children:
|
|
|
|
if self.testEntry(kc, child):
|
|
|
|
result = True
|
2009-12-26 09:36:50 +00:00
|
|
|
|
Keymap conflict detection operator.
Takes into account the hierarchical structures of keymaps as well as wildcards (KM_ANY) in event definitions, user remaps (emulate numpad, action/select mouse buttons, ...) and event values that overlap (click, press and release)
For now, doesn't do anything other than print conflicts in the console.
As a result, I cleaned up a lot of keymaps that had double definitions, moved some keymap items in more appropriate places, fixed wrong definitions and removed kmi that were added for testing a long long time ago.
Out of all the remaining conflicts, after removing obvious non-issues, here's what remains: http://www.pasteall.org/9898
2009-12-17 22:14:43 +00:00
|
|
|
return result
|
2009-12-26 09:36:50 +00:00
|
|
|
|
Keymap conflict detection operator.
Takes into account the hierarchical structures of keymaps as well as wildcards (KM_ANY) in event definitions, user remaps (emulate numpad, action/select mouse buttons, ...) and event values that overlap (click, press and release)
For now, doesn't do anything other than print conflicts in the console.
As a result, I cleaned up a lot of keymaps that had double definitions, moved some keymap items in more appropriate places, fixed wrong definitions and removed kmi that were added for testing a long long time ago.
Out of all the remaining conflicts, after removing obvious non-issues, here's what remains: http://www.pasteall.org/9898
2009-12-17 22:14:43 +00:00
|
|
|
def testConfig(self, kc):
|
|
|
|
result = False
|
|
|
|
for entry in KM_HIERARCHY:
|
|
|
|
if self.testEntry(kc, entry):
|
|
|
|
result = True
|
|
|
|
return result
|
2009-12-26 09:36:50 +00:00
|
|
|
|
Keymap conflict detection operator.
Takes into account the hierarchical structures of keymaps as well as wildcards (KM_ANY) in event definitions, user remaps (emulate numpad, action/select mouse buttons, ...) and event values that overlap (click, press and release)
For now, doesn't do anything other than print conflicts in the console.
As a result, I cleaned up a lot of keymaps that had double definitions, moved some keymap items in more appropriate places, fixed wrong definitions and removed kmi that were added for testing a long long time ago.
Out of all the remaining conflicts, after removing obvious non-issues, here's what remains: http://www.pasteall.org/9898
2009-12-17 22:14:43 +00:00
|
|
|
def execute(self, context):
|
|
|
|
wm = context.manager
|
|
|
|
kc = wm.default_keyconfig
|
2009-12-26 09:36:50 +00:00
|
|
|
|
Keymap conflict detection operator.
Takes into account the hierarchical structures of keymaps as well as wildcards (KM_ANY) in event definitions, user remaps (emulate numpad, action/select mouse buttons, ...) and event values that overlap (click, press and release)
For now, doesn't do anything other than print conflicts in the console.
As a result, I cleaned up a lot of keymaps that had double definitions, moved some keymap items in more appropriate places, fixed wrong definitions and removed kmi that were added for testing a long long time ago.
Out of all the remaining conflicts, after removing obvious non-issues, here's what remains: http://www.pasteall.org/9898
2009-12-17 22:14:43 +00:00
|
|
|
if self.testConfig(kc):
|
|
|
|
print("CONFLICT")
|
2009-12-26 09:36:50 +00:00
|
|
|
|
2009-12-24 19:50:43 +00:00
|
|
|
return {'FINISHED'}
|
Keymap conflict detection operator.
Takes into account the hierarchical structures of keymaps as well as wildcards (KM_ANY) in event definitions, user remaps (emulate numpad, action/select mouse buttons, ...) and event values that overlap (click, press and release)
For now, doesn't do anything other than print conflicts in the console.
As a result, I cleaned up a lot of keymaps that had double definitions, moved some keymap items in more appropriate places, fixed wrong definitions and removed kmi that were added for testing a long long time ago.
Out of all the remaining conflicts, after removing obvious non-issues, here's what remains: http://www.pasteall.org/9898
2009-12-17 22:14:43 +00:00
|
|
|
|
2009-12-26 09:36:50 +00:00
|
|
|
|
Keymap conflict detection operator.
Takes into account the hierarchical structures of keymaps as well as wildcards (KM_ANY) in event definitions, user remaps (emulate numpad, action/select mouse buttons, ...) and event values that overlap (click, press and release)
For now, doesn't do anything other than print conflicts in the console.
As a result, I cleaned up a lot of keymaps that had double definitions, moved some keymap items in more appropriate places, fixed wrong definitions and removed kmi that were added for testing a long long time ago.
Out of all the remaining conflicts, after removing obvious non-issues, here's what remains: http://www.pasteall.org/9898
2009-12-17 22:14:43 +00:00
|
|
|
def _string_value(value):
|
2010-02-23 19:32:32 +00:00
|
|
|
if isinstance(value, str) or isinstance(value, bool) or isinstance(value, float) or isinstance(value, int):
|
|
|
|
result = repr(value)
|
Keymap conflict detection operator.
Takes into account the hierarchical structures of keymaps as well as wildcards (KM_ANY) in event definitions, user remaps (emulate numpad, action/select mouse buttons, ...) and event values that overlap (click, press and release)
For now, doesn't do anything other than print conflicts in the console.
As a result, I cleaned up a lot of keymaps that had double definitions, moved some keymap items in more appropriate places, fixed wrong definitions and removed kmi that were added for testing a long long time ago.
Out of all the remaining conflicts, after removing obvious non-issues, here's what remains: http://www.pasteall.org/9898
2009-12-17 22:14:43 +00:00
|
|
|
elif getattr(value, '__len__', False):
|
2010-02-23 19:32:32 +00:00
|
|
|
repr(list(value))
|
Keymap conflict detection operator.
Takes into account the hierarchical structures of keymaps as well as wildcards (KM_ANY) in event definitions, user remaps (emulate numpad, action/select mouse buttons, ...) and event values that overlap (click, press and release)
For now, doesn't do anything other than print conflicts in the console.
As a result, I cleaned up a lot of keymaps that had double definitions, moved some keymap items in more appropriate places, fixed wrong definitions and removed kmi that were added for testing a long long time ago.
Out of all the remaining conflicts, after removing obvious non-issues, here's what remains: http://www.pasteall.org/9898
2009-12-17 22:14:43 +00:00
|
|
|
else:
|
|
|
|
print("Export key configuration: can't write ", value)
|
|
|
|
|
|
|
|
return result
|
2009-12-26 09:36:50 +00:00
|
|
|
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-28 19:54:06 +00:00
|
|
|
class WM_OT_keyconfig_import(bpy.types.Operator):
|
2010-02-11 02:03:18 +00:00
|
|
|
"Import key configuration from a python script"
|
2010-01-28 19:54:06 +00:00
|
|
|
bl_idname = "wm.keyconfig_import"
|
|
|
|
bl_label = "Import Key Configuration..."
|
|
|
|
|
2010-02-14 23:33:18 +00:00
|
|
|
path = StringProperty(name="File Path", description="File path to write file to")
|
|
|
|
filename = StringProperty(name="File Name", description="Name of the file")
|
|
|
|
directory = StringProperty(name="Directory", description="Directory of the file")
|
|
|
|
filter_folder = BoolProperty(name="Filter folders", description="", default=True, options={'HIDDEN'})
|
|
|
|
filter_text = BoolProperty(name="Filter text", description="", default=True, options={'HIDDEN'})
|
|
|
|
filter_python = BoolProperty(name="Filter python", description="", default=True, options={'HIDDEN'})
|
2010-01-28 19:54:06 +00:00
|
|
|
|
2010-02-14 23:33:18 +00:00
|
|
|
keep_original = BoolProperty(name="Keep original", description="Keep original file after copying to configuration folder", default=True)
|
2010-01-28 19:54:06 +00:00
|
|
|
|
|
|
|
def execute(self, context):
|
|
|
|
if not self.properties.path:
|
2010-02-11 02:03:18 +00:00
|
|
|
raise Exception("File path not set")
|
2010-01-28 19:54:06 +00:00
|
|
|
|
|
|
|
f = open(self.properties.path, "r")
|
|
|
|
if not f:
|
2010-02-11 02:03:18 +00:00
|
|
|
raise Exception("Could not open file")
|
2010-01-28 19:54:06 +00:00
|
|
|
|
|
|
|
name_pattern = re.compile("^kc = wm.add_keyconfig\('(.*)'\)$")
|
|
|
|
|
|
|
|
for line in f.readlines():
|
|
|
|
match = name_pattern.match(line)
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-28 19:54:06 +00:00
|
|
|
if match:
|
|
|
|
config_name = match.groups()[0]
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-28 19:54:06 +00:00
|
|
|
f.close()
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-28 21:52:07 +00:00
|
|
|
path = os.path.split(os.path.split(__file__)[0])[0] # remove ui/space_userpref.py
|
|
|
|
path = os.path.join(path, "cfg")
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-28 21:52:07 +00:00
|
|
|
# create config folder if needed
|
|
|
|
if not os.path.exists(path):
|
2010-01-31 14:46:28 +00:00
|
|
|
os.mkdir(path)
|
|
|
|
|
2010-01-28 21:52:07 +00:00
|
|
|
path = os.path.join(path, config_name + ".py")
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-28 19:54:06 +00:00
|
|
|
if self.properties.keep_original:
|
|
|
|
shutil.copy(self.properties.path, path)
|
|
|
|
else:
|
|
|
|
shutil.move(self.properties.path, path)
|
2010-01-31 14:46:28 +00:00
|
|
|
|
|
|
|
__import__(config_name)
|
|
|
|
|
2010-02-23 16:40:55 +00:00
|
|
|
wm = bpy.context.manager
|
2010-01-28 19:54:06 +00:00
|
|
|
wm.active_keyconfig = wm.keyconfigs[config_name]
|
|
|
|
|
|
|
|
return {'FINISHED'}
|
2009-12-26 09:36:50 +00:00
|
|
|
|
2010-01-28 19:54:06 +00:00
|
|
|
def invoke(self, context, event):
|
|
|
|
wm = context.manager
|
|
|
|
wm.add_fileselect(self)
|
|
|
|
return {'RUNNING_MODAL'}
|
2010-01-31 14:46:28 +00:00
|
|
|
|
|
|
|
|
2009-10-20 08:47:28 +00:00
|
|
|
class WM_OT_keyconfig_export(bpy.types.Operator):
|
2010-02-11 02:03:18 +00:00
|
|
|
"Export key configuration to a python script"
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_idname = "wm.keyconfig_export"
|
|
|
|
bl_label = "Export Key Configuration..."
|
|
|
|
|
2010-02-14 23:33:18 +00:00
|
|
|
path = StringProperty(name="File Path", description="File path to write file to")
|
|
|
|
filename = StringProperty(name="File Name", description="Name of the file")
|
|
|
|
directory = StringProperty(name="Directory", description="Directory of the file")
|
|
|
|
filter_folder = BoolProperty(name="Filter folders", description="", default=True, options={'HIDDEN'})
|
|
|
|
filter_text = BoolProperty(name="Filter text", description="", default=True, options={'HIDDEN'})
|
|
|
|
filter_python = BoolProperty(name="Filter python", description="", default=True, options={'HIDDEN'})
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def execute(self, context):
|
2009-11-19 17:12:08 +00:00
|
|
|
if not self.properties.path:
|
2010-02-11 02:03:18 +00:00
|
|
|
raise Exception("File path not set")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-11-19 17:12:08 +00:00
|
|
|
f = open(self.properties.path, "w")
|
2009-10-31 19:31:45 +00:00
|
|
|
if not f:
|
2010-02-11 02:03:18 +00:00
|
|
|
raise Exception("Could not open file")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
wm = context.manager
|
|
|
|
kc = wm.active_keyconfig
|
|
|
|
|
2010-01-21 21:58:40 +00:00
|
|
|
if kc.name == 'Blender':
|
|
|
|
name = os.path.splitext(os.path.basename(self.properties.path))[0]
|
|
|
|
else:
|
|
|
|
name = kc.name
|
|
|
|
|
2010-01-28 19:54:06 +00:00
|
|
|
f.write("# Configuration %s\n" % name)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-01-28 19:54:06 +00:00
|
|
|
f.write("import bpy\n\n")
|
2010-02-23 16:40:55 +00:00
|
|
|
f.write("wm = bpy.context.manager\n")
|
2010-01-28 19:54:06 +00:00
|
|
|
f.write("kc = wm.add_keyconfig('%s')\n\n" % name)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
for km in kc.keymaps:
|
2009-11-16 20:50:02 +00:00
|
|
|
km = km.active()
|
2009-10-31 19:31:45 +00:00
|
|
|
f.write("# Map %s\n" % km.name)
|
2010-01-28 19:54:06 +00:00
|
|
|
f.write("km = kc.add_keymap('%s', space_type='%s', region_type='%s', modal=%s)\n\n" % (km.name, km.space_type, km.region_type, km.modal))
|
2009-10-31 19:31:45 +00:00
|
|
|
for kmi in km.items:
|
2009-11-16 20:50:02 +00:00
|
|
|
if km.modal:
|
2010-01-28 19:54:06 +00:00
|
|
|
f.write("kmi = km.add_modal_item('%s', '%s', '%s'" % (kmi.propvalue, kmi.type, kmi.value))
|
2009-11-16 20:50:02 +00:00
|
|
|
else:
|
2010-01-28 19:54:06 +00:00
|
|
|
f.write("kmi = km.add_item('%s', '%s', '%s'" % (kmi.idname, kmi.type, kmi.value))
|
2009-11-16 20:50:02 +00:00
|
|
|
if kmi.any:
|
|
|
|
f.write(", any=True")
|
|
|
|
else:
|
|
|
|
if kmi.shift:
|
|
|
|
f.write(", shift=True")
|
|
|
|
if kmi.ctrl:
|
|
|
|
f.write(", ctrl=True")
|
|
|
|
if kmi.alt:
|
|
|
|
f.write(", alt=True")
|
|
|
|
if kmi.oskey:
|
|
|
|
f.write(", oskey=True")
|
2009-10-31 19:31:45 +00:00
|
|
|
if kmi.key_modifier and kmi.key_modifier != 'NONE':
|
2010-01-28 19:54:06 +00:00
|
|
|
f.write(", key_modifier='%s'" % kmi.key_modifier)
|
2009-10-31 19:31:45 +00:00
|
|
|
f.write(")\n")
|
|
|
|
|
2010-01-21 21:58:40 +00:00
|
|
|
def export_properties(prefix, properties):
|
|
|
|
for pname in dir(properties):
|
|
|
|
if not properties.is_property_hidden(pname):
|
|
|
|
value = eval("properties.%s" % pname)
|
|
|
|
if isinstance(value, bpy.types.OperatorProperties):
|
|
|
|
export_properties(prefix + "." + pname, value)
|
|
|
|
elif properties.is_property_set(pname):
|
|
|
|
value = _string_value(value)
|
|
|
|
if value != "":
|
|
|
|
f.write(prefix + ".%s = %s\n" % (pname, value))
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
props = kmi.properties
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2009-11-22 17:41:35 +00:00
|
|
|
if props is not None:
|
2010-01-21 21:58:40 +00:00
|
|
|
export_properties("kmi.properties", props)
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
f.write("\n")
|
|
|
|
|
|
|
|
f.close()
|
|
|
|
|
2009-12-24 19:50:43 +00:00
|
|
|
return {'FINISHED'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def invoke(self, context, event):
|
|
|
|
wm = context.manager
|
2009-11-02 08:32:00 +00:00
|
|
|
wm.add_fileselect(self)
|
2009-12-24 21:17:14 +00:00
|
|
|
return {'RUNNING_MODAL'}
|
Key Configuration
Keymaps are now saveable and configurable from the user preferences, note
that editing one item in a keymap means the whole keymap is now defined by
the user and will not be updated by Blender, an option for syncing might be
added later. The outliner interface is still there, but I will probably
remove it.
There's actually 3 levels now:
* Default builtin key configuration.
* Key configuration loaded from .py file, for configs like Blender 2.4x
or other 3D applications.
* Keymaps edited by the user and saved in .B.blend. These can be saved
to .py files as well to make creating distributable configurations
easier.
Also, user preferences sections were reorganized a bit, now there is:
Interface, Editing, Input, Files and System.
Implementation notes:
* wmKeyConfig was added which represents a key configuration containing
keymaps.
* wmKeymapItem was renamed to wmKeyMapItem for consistency with wmKeyMap.
* Modal maps are not wrapped yet.
* User preferences DNA file reading did not support newdataadr() yet,
added this now for reading keymaps.
* Key configuration related settings are now RNA wrapped.
* is_property_set and is_property_hidden python methods were added.
2009-10-08 18:40:03 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
Key Configuration
Keymaps are now saveable and configurable from the user preferences, note
that editing one item in a keymap means the whole keymap is now defined by
the user and will not be updated by Blender, an option for syncing might be
added later. The outliner interface is still there, but I will probably
remove it.
There's actually 3 levels now:
* Default builtin key configuration.
* Key configuration loaded from .py file, for configs like Blender 2.4x
or other 3D applications.
* Keymaps edited by the user and saved in .B.blend. These can be saved
to .py files as well to make creating distributable configurations
easier.
Also, user preferences sections were reorganized a bit, now there is:
Interface, Editing, Input, Files and System.
Implementation notes:
* wmKeyConfig was added which represents a key configuration containing
keymaps.
* wmKeymapItem was renamed to wmKeyMapItem for consistency with wmKeyMap.
* Modal maps are not wrapped yet.
* User preferences DNA file reading did not support newdataadr() yet,
added this now for reading keymaps.
* Key configuration related settings are now RNA wrapped.
* is_property_set and is_property_hidden python methods were added.
2009-10-08 18:40:03 +00:00
|
|
|
class WM_OT_keymap_edit(bpy.types.Operator):
|
2010-02-11 02:03:18 +00:00
|
|
|
"Edit key map"
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_idname = "wm.keymap_edit"
|
|
|
|
bl_label = "Edit Key Map"
|
Key Configuration
Keymaps are now saveable and configurable from the user preferences, note
that editing one item in a keymap means the whole keymap is now defined by
the user and will not be updated by Blender, an option for syncing might be
added later. The outliner interface is still there, but I will probably
remove it.
There's actually 3 levels now:
* Default builtin key configuration.
* Key configuration loaded from .py file, for configs like Blender 2.4x
or other 3D applications.
* Keymaps edited by the user and saved in .B.blend. These can be saved
to .py files as well to make creating distributable configurations
easier.
Also, user preferences sections were reorganized a bit, now there is:
Interface, Editing, Input, Files and System.
Implementation notes:
* wmKeyConfig was added which represents a key configuration containing
keymaps.
* wmKeymapItem was renamed to wmKeyMapItem for consistency with wmKeyMap.
* Modal maps are not wrapped yet.
* User preferences DNA file reading did not support newdataadr() yet,
added this now for reading keymaps.
* Key configuration related settings are now RNA wrapped.
* is_property_set and is_property_hidden python methods were added.
2009-10-08 18:40:03 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def execute(self, context):
|
|
|
|
wm = context.manager
|
2009-12-17 01:06:12 +00:00
|
|
|
km = context.keymap
|
2009-10-31 19:31:45 +00:00
|
|
|
km.copy_to_user()
|
2009-12-24 19:50:43 +00:00
|
|
|
return {'FINISHED'}
|
Key Configuration
Keymaps are now saveable and configurable from the user preferences, note
that editing one item in a keymap means the whole keymap is now defined by
the user and will not be updated by Blender, an option for syncing might be
added later. The outliner interface is still there, but I will probably
remove it.
There's actually 3 levels now:
* Default builtin key configuration.
* Key configuration loaded from .py file, for configs like Blender 2.4x
or other 3D applications.
* Keymaps edited by the user and saved in .B.blend. These can be saved
to .py files as well to make creating distributable configurations
easier.
Also, user preferences sections were reorganized a bit, now there is:
Interface, Editing, Input, Files and System.
Implementation notes:
* wmKeyConfig was added which represents a key configuration containing
keymaps.
* wmKeymapItem was renamed to wmKeyMapItem for consistency with wmKeyMap.
* Modal maps are not wrapped yet.
* User preferences DNA file reading did not support newdataadr() yet,
added this now for reading keymaps.
* Key configuration related settings are now RNA wrapped.
* is_property_set and is_property_hidden python methods were added.
2009-10-08 18:40:03 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
Key Configuration
Keymaps are now saveable and configurable from the user preferences, note
that editing one item in a keymap means the whole keymap is now defined by
the user and will not be updated by Blender, an option for syncing might be
added later. The outliner interface is still there, but I will probably
remove it.
There's actually 3 levels now:
* Default builtin key configuration.
* Key configuration loaded from .py file, for configs like Blender 2.4x
or other 3D applications.
* Keymaps edited by the user and saved in .B.blend. These can be saved
to .py files as well to make creating distributable configurations
easier.
Also, user preferences sections were reorganized a bit, now there is:
Interface, Editing, Input, Files and System.
Implementation notes:
* wmKeyConfig was added which represents a key configuration containing
keymaps.
* wmKeymapItem was renamed to wmKeyMapItem for consistency with wmKeyMap.
* Modal maps are not wrapped yet.
* User preferences DNA file reading did not support newdataadr() yet,
added this now for reading keymaps.
* Key configuration related settings are now RNA wrapped.
* is_property_set and is_property_hidden python methods were added.
2009-10-08 18:40:03 +00:00
|
|
|
class WM_OT_keymap_restore(bpy.types.Operator):
|
2010-02-11 02:03:18 +00:00
|
|
|
"Restore key map(s)"
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_idname = "wm.keymap_restore"
|
2009-12-04 17:54:48 +00:00
|
|
|
bl_label = "Restore Key Map(s)"
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-02-11 02:03:18 +00:00
|
|
|
all = BoolProperty(attr="all", name="All Keymaps", description="Restore all keymaps to default")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
|
|
|
def execute(self, context):
|
|
|
|
wm = context.manager
|
|
|
|
|
2009-11-19 17:12:08 +00:00
|
|
|
if self.properties.all:
|
2009-10-31 19:31:45 +00:00
|
|
|
for km in wm.default_keyconfig.keymaps:
|
|
|
|
km.restore_to_default()
|
|
|
|
else:
|
2009-12-17 01:06:12 +00:00
|
|
|
km = context.keymap
|
2009-10-31 19:31:45 +00:00
|
|
|
km.restore_to_default()
|
|
|
|
|
2009-12-24 19:50:43 +00:00
|
|
|
return {'FINISHED'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-12-26 09:36:50 +00:00
|
|
|
|
2009-12-17 03:32:33 +00:00
|
|
|
class WM_OT_keyitem_restore(bpy.types.Operator):
|
2010-02-11 02:03:18 +00:00
|
|
|
"Restore key map item"
|
2009-12-17 03:32:33 +00:00
|
|
|
bl_idname = "wm.keyitem_restore"
|
|
|
|
bl_label = "Restore Key Map Item"
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2010-01-31 14:46:28 +00:00
|
|
|
item_id = IntProperty(attr="item_id", name="Item Identifier", description="Identifier of the item to remove")
|
2009-12-17 03:32:33 +00:00
|
|
|
|
|
|
|
def execute(self, context):
|
|
|
|
wm = context.manager
|
|
|
|
km = context.keymap
|
2010-01-29 02:01:02 +00:00
|
|
|
kmi = km.item_from_id(self.properties.item_id)
|
2009-12-17 03:32:33 +00:00
|
|
|
|
|
|
|
km.restore_item_to_default(kmi)
|
|
|
|
|
2009-12-24 19:50:43 +00:00
|
|
|
return {'FINISHED'}
|
2009-12-26 09:36:50 +00:00
|
|
|
|
|
|
|
|
Key Configuration
Keymaps are now saveable and configurable from the user preferences, note
that editing one item in a keymap means the whole keymap is now defined by
the user and will not be updated by Blender, an option for syncing might be
added later. The outliner interface is still there, but I will probably
remove it.
There's actually 3 levels now:
* Default builtin key configuration.
* Key configuration loaded from .py file, for configs like Blender 2.4x
or other 3D applications.
* Keymaps edited by the user and saved in .B.blend. These can be saved
to .py files as well to make creating distributable configurations
easier.
Also, user preferences sections were reorganized a bit, now there is:
Interface, Editing, Input, Files and System.
Implementation notes:
* wmKeyConfig was added which represents a key configuration containing
keymaps.
* wmKeymapItem was renamed to wmKeyMapItem for consistency with wmKeyMap.
* Modal maps are not wrapped yet.
* User preferences DNA file reading did not support newdataadr() yet,
added this now for reading keymaps.
* Key configuration related settings are now RNA wrapped.
* is_property_set and is_property_hidden python methods were added.
2009-10-08 18:40:03 +00:00
|
|
|
class WM_OT_keyitem_add(bpy.types.Operator):
|
2010-02-11 02:03:18 +00:00
|
|
|
"Add key map item"
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_idname = "wm.keyitem_add"
|
|
|
|
bl_label = "Add Key Map Item"
|
|
|
|
|
|
|
|
def execute(self, context):
|
|
|
|
wm = context.manager
|
2009-12-17 01:06:12 +00:00
|
|
|
km = context.keymap
|
2009-12-28 09:19:32 +00:00
|
|
|
kc = wm.default_keyconfig
|
2009-12-29 00:04:57 +00:00
|
|
|
|
2009-11-16 20:50:02 +00:00
|
|
|
if km.modal:
|
|
|
|
km.add_modal_item("", 'A', 'PRESS') # kmi
|
|
|
|
else:
|
2009-12-28 09:19:32 +00:00
|
|
|
km.add_item("none", 'A', 'PRESS') # kmi
|
2009-12-29 00:04:57 +00:00
|
|
|
|
2009-12-28 09:19:32 +00:00
|
|
|
# clear filter and expand keymap so we can see the newly added item
|
|
|
|
if kc.filter != '':
|
|
|
|
kc.filter = ''
|
|
|
|
km.items_expanded = True
|
|
|
|
km.children_expanded = True
|
2009-12-29 00:04:57 +00:00
|
|
|
|
2009-12-24 19:50:43 +00:00
|
|
|
return {'FINISHED'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
|
Key Configuration
Keymaps are now saveable and configurable from the user preferences, note
that editing one item in a keymap means the whole keymap is now defined by
the user and will not be updated by Blender, an option for syncing might be
added later. The outliner interface is still there, but I will probably
remove it.
There's actually 3 levels now:
* Default builtin key configuration.
* Key configuration loaded from .py file, for configs like Blender 2.4x
or other 3D applications.
* Keymaps edited by the user and saved in .B.blend. These can be saved
to .py files as well to make creating distributable configurations
easier.
Also, user preferences sections were reorganized a bit, now there is:
Interface, Editing, Input, Files and System.
Implementation notes:
* wmKeyConfig was added which represents a key configuration containing
keymaps.
* wmKeymapItem was renamed to wmKeyMapItem for consistency with wmKeyMap.
* Modal maps are not wrapped yet.
* User preferences DNA file reading did not support newdataadr() yet,
added this now for reading keymaps.
* Key configuration related settings are now RNA wrapped.
* is_property_set and is_property_hidden python methods were added.
2009-10-08 18:40:03 +00:00
|
|
|
class WM_OT_keyitem_remove(bpy.types.Operator):
|
2010-02-11 02:03:18 +00:00
|
|
|
"Remove key map item"
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_idname = "wm.keyitem_remove"
|
|
|
|
bl_label = "Remove Key Map Item"
|
|
|
|
|
2010-01-31 14:46:28 +00:00
|
|
|
item_id = IntProperty(attr="item_id", name="Item Identifier", description="Identifier of the item to remove")
|
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def execute(self, context):
|
|
|
|
wm = context.manager
|
2009-12-17 01:06:12 +00:00
|
|
|
km = context.keymap
|
2010-01-29 02:01:02 +00:00
|
|
|
kmi = km.item_from_id(self.properties.item_id)
|
2009-10-31 19:31:45 +00:00
|
|
|
km.remove_item(kmi)
|
2009-12-24 19:50:43 +00:00
|
|
|
return {'FINISHED'}
|
|
|
|
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-28 19:54:06 +00:00
|
|
|
class WM_OT_keyconfig_remove(bpy.types.Operator):
|
2010-02-11 02:03:18 +00:00
|
|
|
"Remove key config"
|
2010-01-28 19:54:06 +00:00
|
|
|
bl_idname = "wm.keyconfig_remove"
|
|
|
|
bl_label = "Remove Key Config"
|
|
|
|
|
|
|
|
def poll(self, context):
|
|
|
|
wm = context.manager
|
|
|
|
return wm.active_keyconfig.user_defined
|
|
|
|
|
|
|
|
def execute(self, context):
|
|
|
|
wm = context.manager
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-28 19:54:06 +00:00
|
|
|
keyconfig = wm.active_keyconfig
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-28 19:54:06 +00:00
|
|
|
module = __import__(keyconfig.name)
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-28 19:54:06 +00:00
|
|
|
os.remove(module.__file__)
|
2010-01-28 21:52:07 +00:00
|
|
|
|
|
|
|
compiled_path = module.__file__ + "c" # for .pyc
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-28 21:52:07 +00:00
|
|
|
if os.path.exists(compiled_path):
|
|
|
|
os.remove(compiled_path)
|
2010-01-31 14:46:28 +00:00
|
|
|
|
2010-01-28 19:54:06 +00:00
|
|
|
wm.remove_keyconfig(keyconfig)
|
|
|
|
return {'FINISHED'}
|
|
|
|
|
2010-02-14 11:21:21 +00:00
|
|
|
|
|
|
|
classes = [
|
|
|
|
USERPREF_HT_header,
|
|
|
|
USERPREF_PT_tabs,
|
|
|
|
USERPREF_PT_interface,
|
|
|
|
USERPREF_PT_theme,
|
|
|
|
USERPREF_PT_edit,
|
|
|
|
USERPREF_PT_system,
|
|
|
|
USERPREF_PT_file,
|
|
|
|
USERPREF_PT_input,
|
2010-02-26 14:28:29 +00:00
|
|
|
USERPREF_PT_addons,
|
2010-02-22 23:32:58 +00:00
|
|
|
|
2010-02-26 14:28:29 +00:00
|
|
|
WM_OT_addon_enable,
|
|
|
|
WM_OT_addon_disable,
|
|
|
|
WM_OT_addon_install,
|
2010-03-13 00:14:36 +00:00
|
|
|
WM_OT_addon_expand,
|
|
|
|
WM_OT_addon_links,
|
2010-02-14 11:21:21 +00:00
|
|
|
|
|
|
|
WM_OT_keyconfig_export,
|
|
|
|
WM_OT_keyconfig_import,
|
|
|
|
WM_OT_keyconfig_test,
|
|
|
|
WM_OT_keyconfig_remove,
|
|
|
|
WM_OT_keymap_edit,
|
|
|
|
WM_OT_keymap_restore,
|
|
|
|
WM_OT_keyitem_add,
|
|
|
|
WM_OT_keyitem_remove,
|
|
|
|
WM_OT_keyitem_restore]
|
|
|
|
|
|
|
|
|
|
|
|
def register():
|
|
|
|
register = bpy.types.register
|
|
|
|
for cls in classes:
|
|
|
|
register(cls)
|
|
|
|
|
2010-02-22 23:32:58 +00:00
|
|
|
|
2010-02-14 11:21:21 +00:00
|
|
|
def unregister():
|
|
|
|
unregister = bpy.types.unregister
|
|
|
|
for cls in classes:
|
|
|
|
unregister(cls)
|
2010-02-16 09:55:07 +00:00
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
register()
|