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 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-07-05 22:22:22 +00:00
|
|
|
|
2010-01-09 18:17:40 +00:00
|
|
|
row = col.row()
|
2010-06-26 17:06:55 +00:00
|
|
|
|
2010-07-05 22:22:22 +00:00
|
|
|
subsplit = row.split(percentage=0.95)
|
|
|
|
|
2010-06-26 17:06:55 +00:00
|
|
|
padding = subsplit.split(percentage=0.15)
|
|
|
|
colsub = padding.column()
|
|
|
|
colsub = padding.column()
|
|
|
|
colsub.row().prop(context, "outline")
|
|
|
|
colsub.row().prop(context, "item", slider=True)
|
|
|
|
colsub.row().prop(context, "inner", slider=True)
|
|
|
|
colsub.row().prop(context, "inner_sel", slider=True)
|
2010-07-05 22:22:22 +00:00
|
|
|
|
|
|
|
subsplit = row.split(percentage=0.85)
|
|
|
|
|
2010-06-26 17:06:55 +00:00
|
|
|
padding = subsplit.split(percentage=0.15)
|
|
|
|
colsub = padding.column()
|
|
|
|
colsub = padding.column()
|
|
|
|
colsub.row().prop(context, "text")
|
|
|
|
colsub.row().prop(context, "text_sel")
|
|
|
|
colsub.prop(context, "shaded")
|
|
|
|
subsub = colsub.column(align=True)
|
2010-01-09 12:05:30 +00:00
|
|
|
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-07-05 22:22:22 +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
|
|
|
|
2010-04-17 19:05:53 +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")
|
2010-04-04 14:52:15 +00:00
|
|
|
|
2010-03-30 04:27:13 +00:00
|
|
|
layout.operator_context = 'INVOKE_DEFAULT'
|
2010-04-04 14:52:15 +00:00
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
if userpref.active_section == 'INPUT':
|
2010-03-30 04:27:13 +00:00
|
|
|
op = layout.operator("wm.keyconfig_export")
|
2010-06-14 03:52:10 +00:00
|
|
|
op.filepath = "keymap.py"
|
2010-03-30 04:27:13 +00:00
|
|
|
op = layout.operator("wm.keyconfig_import")
|
2010-06-14 03:52:10 +00:00
|
|
|
op.filepath = "keymap.py"
|
2010-02-26 14:28:29 +00:00
|
|
|
elif userpref.active_section == 'ADDONS':
|
2010-03-30 04:27:13 +00:00
|
|
|
op = layout.operator("wm.addon_install")
|
2010-06-14 03:52:10 +00:00
|
|
|
op.filepath = "*.py"
|
2010-04-04 14:52:15 +00:00
|
|
|
elif userpref.active_section == 'THEMES':
|
2010-03-30 04:27:13 +00:00
|
|
|
op = layout.operator("ui.reset_default_theme")
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2010-04-17 19:05:53 +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
|
|
|
|
* Interaction Presets
This adds a new presets menu in the splash screen and the Input section of
User Preferences to choose a preset interaction style, consisting of key configurations
and also other user preferences such as select mouse button, view rotation style, etc.
Currently, just 'Blender' and 'Maya' presets are included, hopefully we can have more
presets contributed (and maintained!) by the community.
It's best to keep these presets minimal to avoid too many key conflicts. In the Maya one
I changed the view manipulation key/mouse combos and also the transform
manipulator keys, not much more than that.
To save an interaction preset, open the user preferences Input section, and press the
[ + ] button next to the presets menu. It will save out a .py file containing any edited key
maps and navigation preferences to the presets/interaction folder in your scripts folder.
---
Part of this commit changes the way that key maps are exported/displayed in
preferences - now partial key configs are allowed. Previously it would export/import the
entire key configuration, regardless of whether individual key maps were edited or not
(which would make them more susceptible to conflicts in unexpected areas).
(note, in blender terminology, a key map is a category of key items, such as
'Object Mode' or 'View 2d'.)
Now, the export and the UI display work in a similar way to how key maps are
processed internally - Locally edited key maps (after pressing the 'Edit' button) are
processed first, falling back to other key maps in the current key config, and then falling
back to the default key config. So it's possible for a key config to only include a few
key maps, and the rest just gets pulled from the default key config. The preferences
UI display works like this too behind the scenes in deciding what to show users,
however using it is just like it was before, the complexity is hidden.
2010-04-14 06:27:50 +00:00
|
|
|
class USERPREF_MT_interaction_presets(bpy.types.Menu):
|
|
|
|
bl_label = "Presets"
|
|
|
|
preset_subdir = "interaction"
|
|
|
|
preset_operator = "script.execute_preset"
|
|
|
|
draw = bpy.types.Menu.draw_preset
|
2010-04-17 19:05:53 +00:00
|
|
|
|
|
|
|
|
* Interaction Presets
This adds a new presets menu in the splash screen and the Input section of
User Preferences to choose a preset interaction style, consisting of key configurations
and also other user preferences such as select mouse button, view rotation style, etc.
Currently, just 'Blender' and 'Maya' presets are included, hopefully we can have more
presets contributed (and maintained!) by the community.
It's best to keep these presets minimal to avoid too many key conflicts. In the Maya one
I changed the view manipulation key/mouse combos and also the transform
manipulator keys, not much more than that.
To save an interaction preset, open the user preferences Input section, and press the
[ + ] button next to the presets menu. It will save out a .py file containing any edited key
maps and navigation preferences to the presets/interaction folder in your scripts folder.
---
Part of this commit changes the way that key maps are exported/displayed in
preferences - now partial key configs are allowed. Previously it would export/import the
entire key configuration, regardless of whether individual key maps were edited or not
(which would make them more susceptible to conflicts in unexpected areas).
(note, in blender terminology, a key map is a category of key items, such as
'Object Mode' or 'View 2d'.)
Now, the export and the UI display work in a similar way to how key maps are
processed internally - Locally edited key maps (after pressing the 'Edit' button) are
processed first, falling back to other key maps in the current key config, and then falling
back to the default key config. So it's possible for a key config to only include a few
key maps, and the rest just gets pulled from the default key config. The preferences
UI display works like this too behind the scenes in deciding what to show users,
however using it is just like it was before, the complexity is hidden.
2010-04-14 06:27:50 +00:00
|
|
|
class USERPREF_MT_splash(bpy.types.Menu):
|
|
|
|
bl_label = "Splash"
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
layout = self.layout
|
|
|
|
split = layout.split()
|
|
|
|
row = split.row()
|
|
|
|
row.label("")
|
|
|
|
row = split.row()
|
|
|
|
row.label("Interaction:")
|
|
|
|
row.menu("USERPREF_MT_interaction_presets", text=bpy.types.USERPREF_MT_interaction_presets.bl_label)
|
2010-04-17 19:05:53 +00:00
|
|
|
|
* Interaction Presets
This adds a new presets menu in the splash screen and the Input section of
User Preferences to choose a preset interaction style, consisting of key configurations
and also other user preferences such as select mouse button, view rotation style, etc.
Currently, just 'Blender' and 'Maya' presets are included, hopefully we can have more
presets contributed (and maintained!) by the community.
It's best to keep these presets minimal to avoid too many key conflicts. In the Maya one
I changed the view manipulation key/mouse combos and also the transform
manipulator keys, not much more than that.
To save an interaction preset, open the user preferences Input section, and press the
[ + ] button next to the presets menu. It will save out a .py file containing any edited key
maps and navigation preferences to the presets/interaction folder in your scripts folder.
---
Part of this commit changes the way that key maps are exported/displayed in
preferences - now partial key configs are allowed. Previously it would export/import the
entire key configuration, regardless of whether individual key maps were edited or not
(which would make them more susceptible to conflicts in unexpected areas).
(note, in blender terminology, a key map is a category of key items, such as
'Object Mode' or 'View 2d'.)
Now, the export and the UI display work in a similar way to how key maps are
processed internally - Locally edited key maps (after pressing the 'Edit' button) are
processed first, falling back to other key maps in the current key config, and then falling
back to the default key config. So it's possible for a key config to only include a few
key maps, and the rest just gets pulled from the default key config. The preferences
UI display works like this too behind the scenes in deciding what to show users,
however using it is just like it was before, the complexity is hidden.
2010-04-14 06:27: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 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")
|
2010-06-09 19:12:03 +00:00
|
|
|
|
2010-05-16 10:21:00 +00:00
|
|
|
col.separator()
|
|
|
|
col.separator()
|
|
|
|
col.separator()
|
2010-06-09 19:12:03 +00:00
|
|
|
|
2010-05-16 10:21:00 +00:00
|
|
|
col.label(text="Properties Window:")
|
|
|
|
col.prop(view, "properties_width_check")
|
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:")
|
Keyframe Defaults and Cleanups:
This commit fixes reports #21638 and #21818, which were both also Durian feature requests.
Cbanges:
* Added new default setting for the type of handles created when creating keyframes. This can be found in the user-preferences, and is used whenever existing keyframes aren't being overwritten (instead of the value being always taken from the keyframes either side, #21638).
* When keyframing over existing keyframes, only the values will be changed. The handles will be offset by the same amount that the value of the keyframe changed, though how well this works in practice still needs to be tested more thoroughly (#21818, already fixed earlier, but this commit is the full fix).
* When 'free' handles are added by default, they are offset to be +/- 1 frame on either side of the keyframe so that it is obvious that they can be moved. However, they just take the same value of the keyframe since this is easiest.
* Properly initialising handle colour defaults for 3D-View and Graph Editor. Graph Editor's theme userprefs also show these settings now, though the layout is really quick hack-style.
2010-04-02 01:03:40 +00:00
|
|
|
col.prop(edit, "keyframe_new_interpolation_type", text="Interpolation")
|
|
|
|
col.prop(edit, "keyframe_new_handle_type", text="Handles")
|
2010-02-17 15:14:09 +00:00
|
|
|
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
|
|
|
|
|
2010-06-26 17:24:01 +00:00
|
|
|
@staticmethod
|
|
|
|
def _theme_generic(split, themedata):
|
|
|
|
|
|
|
|
row = split.row()
|
|
|
|
|
2010-06-26 22:23:54 +00:00
|
|
|
subsplit = row.split(percentage=0.95)
|
|
|
|
|
|
|
|
padding1 = subsplit.split(percentage=0.15)
|
|
|
|
padding1.column()
|
|
|
|
|
2010-07-05 22:22:22 +00:00
|
|
|
subsplit = row.split(percentage=0.85)
|
2010-06-26 17:24:01 +00:00
|
|
|
|
2010-06-26 22:23:54 +00:00
|
|
|
padding2 = subsplit.split(percentage=0.15)
|
|
|
|
padding2.column()
|
|
|
|
|
|
|
|
colsub_pair = padding1.column(), padding2.column()
|
|
|
|
|
|
|
|
props_type = {}
|
2010-06-26 17:24:01 +00:00
|
|
|
|
|
|
|
for i, prop in enumerate(themedata.rna_type.properties):
|
|
|
|
attr = prop.identifier
|
|
|
|
if attr == "rna_type":
|
|
|
|
continue
|
|
|
|
|
2010-06-26 22:23:54 +00:00
|
|
|
props_type.setdefault((prop.type, prop.subtype), []).append(prop.identifier)
|
2010-06-26 17:24:01 +00:00
|
|
|
|
2010-06-26 22:23:54 +00:00
|
|
|
for props_type, props_ls in sorted(props_type.items()):
|
2010-06-26 17:24:01 +00:00
|
|
|
for i, attr in enumerate(props_ls):
|
2010-06-26 22:23:54 +00:00
|
|
|
colsub_pair[i % 2].row().prop(themedata, attr)
|
2010-06-26 17:24:01 +00:00
|
|
|
|
2009-11-02 17:18:17 +00:00
|
|
|
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-06-26 20:00:45 +00:00
|
|
|
split_themes = layout.split(percentage=0.2)
|
|
|
|
split_themes.prop(theme, "theme_area", expand=True)
|
2010-07-05 22:22:22 +00:00
|
|
|
|
2010-06-26 17:06:55 +00:00
|
|
|
split = layout.split(percentage=0.4)
|
2010-07-05 22:22:22 +00:00
|
|
|
|
|
|
|
|
2010-06-26 17:06:55 +00:00
|
|
|
layout.separator()
|
|
|
|
layout.separator()
|
2010-07-05 22:22:22 +00:00
|
|
|
|
2010-06-26 20:00:45 +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)
|
2010-06-09 19:12:03 +00:00
|
|
|
|
2010-05-27 08:22:16 +00:00
|
|
|
ui = theme.user_interface.wcol_progress
|
|
|
|
col.label(text="Progress 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:")
|
2010-07-05 22:22:22 +00:00
|
|
|
|
2010-01-09 18:17:40 +00:00
|
|
|
row = col.row()
|
2010-06-26 17:06:55 +00:00
|
|
|
|
2010-07-05 22:22:22 +00:00
|
|
|
subsplit = row.split(percentage=0.95)
|
|
|
|
|
2010-06-26 17:06:55 +00:00
|
|
|
padding = subsplit.split(percentage=0.15)
|
|
|
|
colsub = padding.column()
|
|
|
|
colsub = padding.column()
|
|
|
|
colsub.row().prop(ui, "inner_anim")
|
|
|
|
colsub.row().prop(ui, "inner_anim_sel")
|
|
|
|
colsub.row().prop(ui, "inner_driven")
|
|
|
|
colsub.row().prop(ui, "inner_driven_sel")
|
2010-07-05 22:22:22 +00:00
|
|
|
|
|
|
|
subsplit = row.split(percentage=0.85)
|
|
|
|
|
2010-06-26 17:06:55 +00:00
|
|
|
padding = subsplit.split(percentage=0.15)
|
|
|
|
colsub = padding.column()
|
|
|
|
colsub = padding.column()
|
|
|
|
colsub.row().prop(ui, "inner_key")
|
|
|
|
colsub.row().prop(ui, "inner_key_sel")
|
|
|
|
colsub.row().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()
|
2010-07-05 22:22:22 +00:00
|
|
|
|
|
|
|
split = col.split(percentage=0.93)
|
2010-06-26 17:06:55 +00:00
|
|
|
split.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
|
|
|
|
2010-06-26 17:24:01 +00:00
|
|
|
else:
|
|
|
|
self._theme_generic(split, getattr(theme, theme.theme_area.lower()))
|
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
|
|
|
|
* Interaction Presets
This adds a new presets menu in the splash screen and the Input section of
User Preferences to choose a preset interaction style, consisting of key configurations
and also other user preferences such as select mouse button, view rotation style, etc.
Currently, just 'Blender' and 'Maya' presets are included, hopefully we can have more
presets contributed (and maintained!) by the community.
It's best to keep these presets minimal to avoid too many key conflicts. In the Maya one
I changed the view manipulation key/mouse combos and also the transform
manipulator keys, not much more than that.
To save an interaction preset, open the user preferences Input section, and press the
[ + ] button next to the presets menu. It will save out a .py file containing any edited key
maps and navigation preferences to the presets/interaction folder in your scripts folder.
---
Part of this commit changes the way that key maps are exported/displayed in
preferences - now partial key configs are allowed. Previously it would export/import the
entire key configuration, regardless of whether individual key maps were edited or not
(which would make them more susceptible to conflicts in unexpected areas).
(note, in blender terminology, a key map is a category of key items, such as
'Object Mode' or 'View 2d'.)
Now, the export and the UI display work in a similar way to how key maps are
processed internally - Locally edited key maps (after pressing the 'Edit' button) are
processed first, falling back to other key maps in the current key config, and then falling
back to the default key config. So it's possible for a key config to only include a few
key maps, and the rest just gets pulled from the default key config. The preferences
UI display works like this too behind the scenes in deciding what to show users,
however using it is just like it was before, the complexity is hidden.
2010-04-14 06:27:50 +00:00
|
|
|
from space_userpref_keymap import InputKeyMapPanel
|
2009-10-31 23:35:56 +00:00
|
|
|
|
2010-04-17 19:05:53 +00:00
|
|
|
|
* Interaction Presets
This adds a new presets menu in the splash screen and the Input section of
User Preferences to choose a preset interaction style, consisting of key configurations
and also other user preferences such as select mouse button, view rotation style, etc.
Currently, just 'Blender' and 'Maya' presets are included, hopefully we can have more
presets contributed (and maintained!) by the community.
It's best to keep these presets minimal to avoid too many key conflicts. In the Maya one
I changed the view manipulation key/mouse combos and also the transform
manipulator keys, not much more than that.
To save an interaction preset, open the user preferences Input section, and press the
[ + ] button next to the presets menu. It will save out a .py file containing any edited key
maps and navigation preferences to the presets/interaction folder in your scripts folder.
---
Part of this commit changes the way that key maps are exported/displayed in
preferences - now partial key configs are allowed. Previously it would export/import the
entire key configuration, regardless of whether individual key maps were edited or not
(which would make them more susceptible to conflicts in unexpected areas).
(note, in blender terminology, a key map is a category of key items, such as
'Object Mode' or 'View 2d'.)
Now, the export and the UI display work in a similar way to how key maps are
processed internally - Locally edited key maps (after pressing the 'Edit' button) are
processed first, falling back to other key maps in the current key config, and then falling
back to the default key config. So it's possible for a key config to only include a few
key maps, and the rest just gets pulled from the default key config. The preferences
UI display works like this too behind the scenes in deciding what to show users,
however using it is just like it was before, the complexity is hidden.
2010-04-14 06:27:50 +00:00
|
|
|
class USERPREF_PT_input(InputKeyMapPanel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_space_type = 'USER_PREFERENCES'
|
|
|
|
bl_label = "Input"
|
|
|
|
|
|
|
|
def poll(self, context):
|
|
|
|
userpref = context.user_preferences
|
|
|
|
return (userpref.active_section == 'INPUT')
|
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()
|
* Interaction Presets
This adds a new presets menu in the splash screen and the Input section of
User Preferences to choose a preset interaction style, consisting of key configurations
and also other user preferences such as select mouse button, view rotation style, etc.
Currently, just 'Blender' and 'Maya' presets are included, hopefully we can have more
presets contributed (and maintained!) by the community.
It's best to keep these presets minimal to avoid too many key conflicts. In the Maya one
I changed the view manipulation key/mouse combos and also the transform
manipulator keys, not much more than that.
To save an interaction preset, open the user preferences Input section, and press the
[ + ] button next to the presets menu. It will save out a .py file containing any edited key
maps and navigation preferences to the presets/interaction folder in your scripts folder.
---
Part of this commit changes the way that key maps are exported/displayed in
preferences - now partial key configs are allowed. Previously it would export/import the
entire key configuration, regardless of whether individual key maps were edited or not
(which would make them more susceptible to conflicts in unexpected areas).
(note, in blender terminology, a key map is a category of key items, such as
'Object Mode' or 'View 2d'.)
Now, the export and the UI display work in a similar way to how key maps are
processed internally - Locally edited key maps (after pressing the 'Edit' button) are
processed first, falling back to other key maps in the current key config, and then falling
back to the default key config. So it's possible for a key config to only include a few
key maps, and the rest just gets pulled from the default key config. The preferences
UI display works like this too behind the scenes in deciding what to show users,
however using it is just like it was before, the complexity is hidden.
2010-04-14 06:27:50 +00:00
|
|
|
sub.label(text="Presets:")
|
|
|
|
subrow = sub.row(align=True)
|
|
|
|
subrow.menu("USERPREF_MT_interaction_presets", text=bpy.types.USERPREF_MT_interaction_presets.bl_label)
|
2010-06-26 20:00:45 +00:00
|
|
|
subrow.operator("wm.interaction_preset_add", text="", icon='ZOOMIN')
|
* Interaction Presets
This adds a new presets menu in the splash screen and the Input section of
User Preferences to choose a preset interaction style, consisting of key configurations
and also other user preferences such as select mouse button, view rotation style, etc.
Currently, just 'Blender' and 'Maya' presets are included, hopefully we can have more
presets contributed (and maintained!) by the community.
It's best to keep these presets minimal to avoid too many key conflicts. In the Maya one
I changed the view manipulation key/mouse combos and also the transform
manipulator keys, not much more than that.
To save an interaction preset, open the user preferences Input section, and press the
[ + ] button next to the presets menu. It will save out a .py file containing any edited key
maps and navigation preferences to the presets/interaction folder in your scripts folder.
---
Part of this commit changes the way that key maps are exported/displayed in
preferences - now partial key configs are allowed. Previously it would export/import the
entire key configuration, regardless of whether individual key maps were edited or not
(which would make them more susceptible to conflicts in unexpected areas).
(note, in blender terminology, a key map is a category of key items, such as
'Object Mode' or 'View 2d'.)
Now, the export and the UI display work in a similar way to how key maps are
processed internally - Locally edited key maps (after pressing the 'Edit' button) are
processed first, falling back to other key maps in the current key config, and then falling
back to the default key config. So it's possible for a key config to only include a few
key maps, and the rest just gets pulled from the default key config. The preferences
UI display works like this too behind the scenes in deciding what to show users,
however using it is just like it was before, the complexity is hidden.
2010-04-14 06:27:50 +00:00
|
|
|
sub.separator()
|
2010-04-17 19:05:53 +00:00
|
|
|
|
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:")
|
2010-04-01 02:28:08 +00:00
|
|
|
sub.row().prop(inputs, "zoom_style", text="")
|
|
|
|
if inputs.zoom_style == 'DOLLY':
|
2009-11-28 04:43:15 +00:00
|
|
|
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()
|
2010-04-01 02:28:08 +00:00
|
|
|
''' not implemented yet
|
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")
|
2010-04-01 02:28:08 +00:00
|
|
|
'''
|
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-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
|
* Interaction Presets
This adds a new presets menu in the splash screen and the Input section of
User Preferences to choose a preset interaction style, consisting of key configurations
and also other user preferences such as select mouse button, view rotation style, etc.
Currently, just 'Blender' and 'Maya' presets are included, hopefully we can have more
presets contributed (and maintained!) by the community.
It's best to keep these presets minimal to avoid too many key conflicts. In the Maya one
I changed the view manipulation key/mouse combos and also the transform
manipulator keys, not much more than that.
To save an interaction preset, open the user preferences Input section, and press the
[ + ] button next to the presets menu. It will save out a .py file containing any edited key
maps and navigation preferences to the presets/interaction folder in your scripts folder.
---
Part of this commit changes the way that key maps are exported/displayed in
preferences - now partial key configs are allowed. Previously it would export/import the
entire key configuration, regardless of whether individual key maps were edited or not
(which would make them more susceptible to conflicts in unexpected areas).
(note, in blender terminology, a key map is a category of key items, such as
'Object Mode' or 'View 2d'.)
Now, the export and the UI display work in a similar way to how key maps are
processed internally - Locally edited key maps (after pressing the 'Edit' button) are
processed first, falling back to other key maps in the current key config, and then falling
back to the default key config. So it's possible for a key config to only include a few
key maps, and the rest just gets pulled from the default key config. The preferences
UI display works like this too behind the scenes in deciding what to show users,
however using it is just like it was before, the complexity is hidden.
2010-04-14 06:27:50 +00:00
|
|
|
self.draw_keymaps(context, split)
|
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-06-27 19:04:44 +00:00
|
|
|
@staticmethod
|
|
|
|
def _addon_list():
|
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}
|
merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
2010-03-20 16:41:01 +00:00
|
|
|
cats.discard("")
|
2010-03-14 20:07:15 +00:00
|
|
|
|
2010-06-27 19:04:44 +00:00
|
|
|
cats = ["All", "Enabled", "Disabled"] + sorted(cats)
|
2010-03-14 23:26:17 +00:00
|
|
|
|
2010-04-21 16:50:51 +00:00
|
|
|
bpy.types.Scene.EnumProperty(items=[(cat, cat, str(i)) for i, cat in enumerate(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-06-27 19:04:44 +00:00
|
|
|
split = layout.split(percentage=0.2)
|
|
|
|
col = split.column()
|
|
|
|
col.prop(context.scene, "addon_filter", text="Filter", expand=True)
|
|
|
|
col.prop(context.scene, "addon_search", text="", icon='VIEWZOOM')
|
|
|
|
|
|
|
|
col = split.column()
|
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-04-21 16:50:51 +00:00
|
|
|
is_enabled = module_name in used_ext
|
|
|
|
|
2010-03-13 00:14:36 +00:00
|
|
|
# check if add-on should be visible with current filters
|
2010-04-21 16:50:51 +00:00
|
|
|
if (filter == "All") or \
|
|
|
|
(filter == info["category"]) or \
|
|
|
|
(filter == "Enabled" and is_enabled) or \
|
|
|
|
(filter == "Disabled" and not is_enabled):
|
2010-03-14 20:07:15 +00:00
|
|
|
|
|
|
|
|
2010-04-21 16:50:51 +00:00
|
|
|
if search and search not in info["name"].lower():
|
|
|
|
if info["author"]:
|
|
|
|
if search not in info["author"].lower():
|
|
|
|
continue
|
|
|
|
else:
|
2010-03-13 00:14:36 +00:00
|
|
|
continue
|
2010-04-21 16:50:51 +00:00
|
|
|
|
|
|
|
# Addon UI Code
|
2010-06-27 19:04:44 +00:00
|
|
|
box = col.column().box()
|
|
|
|
colsub = box.column()
|
|
|
|
row = colsub.row()
|
2010-04-21 16:50:51 +00:00
|
|
|
|
2010-06-26 20:00:45 +00:00
|
|
|
row.operator("wm.addon_expand", icon='TRIA_DOWN' if info["expanded"] else 'TRIA_RIGHT', emboss=False).module = module_name
|
2010-06-17 02:38:49 +00:00
|
|
|
|
2010-06-26 20:00:45 +00:00
|
|
|
rowsub = row.row()
|
|
|
|
rowsub.active = is_enabled
|
|
|
|
rowsub.label(text=info["name"], icon='ERROR' if info["warning"] else 'BLENDER')
|
2010-06-17 02:38:49 +00:00
|
|
|
|
2010-06-26 20:00:45 +00:00
|
|
|
if is_enabled:
|
|
|
|
row.operator("wm.addon_disable", icon='CHECKBOX_HLT', text="", emboss=False).module = module_name
|
|
|
|
else:
|
|
|
|
row.operator("wm.addon_enable", icon='CHECKBOX_DEHLT', text="", emboss=False).module = module_name
|
2010-04-21 16:50:51 +00:00
|
|
|
|
|
|
|
# Expanded UI (only if additional infos are available)
|
|
|
|
if info["expanded"]:
|
2010-06-17 02:38:49 +00:00
|
|
|
if info["description"]:
|
2010-06-27 19:04:44 +00:00
|
|
|
split = colsub.row().split(percentage=0.15)
|
2010-06-17 02:38:49 +00:00
|
|
|
split.label(text='Description:')
|
|
|
|
split.label(text=info["description"])
|
|
|
|
if info["location"]:
|
2010-06-27 19:04:44 +00:00
|
|
|
split = colsub.row().split(percentage=0.15)
|
2010-06-17 02:38:49 +00:00
|
|
|
split.label(text='Location:')
|
|
|
|
split.label(text=info["location"])
|
2010-04-21 16:50:51 +00:00
|
|
|
if info["author"]:
|
2010-06-27 19:04:44 +00:00
|
|
|
split = colsub.row().split(percentage=0.15)
|
2010-04-21 16:50:51 +00:00
|
|
|
split.label(text='Author:')
|
|
|
|
split.label(text=info["author"])
|
|
|
|
if info["version"]:
|
2010-06-27 19:04:44 +00:00
|
|
|
split = colsub.row().split(percentage=0.15)
|
2010-04-21 16:50:51 +00:00
|
|
|
split.label(text='Version:')
|
|
|
|
split.label(text=info["version"])
|
2010-06-17 02:38:49 +00:00
|
|
|
if info["warning"]:
|
2010-06-27 19:04:44 +00:00
|
|
|
split = colsub.row().split(percentage=0.15)
|
2010-06-17 02:38:49 +00:00
|
|
|
split.label(text="Warning:")
|
2010-07-05 22:22:22 +00:00
|
|
|
split.label(text=' ' + info["warning"], icon='ERROR')
|
2010-05-30 20:48:09 +00:00
|
|
|
if info["wiki_url"] or info["tracker_url"]:
|
2010-06-27 19:04:44 +00:00
|
|
|
split = colsub.row().split(percentage=0.15)
|
2010-04-21 16:50:51 +00:00
|
|
|
split.label(text="Internet:")
|
2010-05-30 20:48:09 +00:00
|
|
|
if info["wiki_url"]:
|
2010-05-31 11:38:13 +00:00
|
|
|
split.operator("wm.url_open", text="Link to the Wiki", icon='HELP').url = info["wiki_url"]
|
2010-05-30 20:48:09 +00:00
|
|
|
if info["tracker_url"]:
|
2010-05-31 11:38:13 +00:00
|
|
|
split.operator("wm.url_open", text="Report a Bug", icon='URL').url = info["tracker_url"]
|
2010-06-09 19:12:03 +00:00
|
|
|
|
2010-05-30 20:48:09 +00:00
|
|
|
if info["wiki_url"] and info["tracker_url"]:
|
|
|
|
split.separator()
|
|
|
|
else:
|
|
|
|
split.separator()
|
|
|
|
split.separator()
|
2010-02-14 23:33:18 +00:00
|
|
|
|
merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
2010-03-20 16:41:01 +00:00
|
|
|
# Append missing scripts
|
|
|
|
# First collect scripts that are used but have no script file.
|
|
|
|
module_names = {mod.__name__ for mod, info in addons}
|
|
|
|
missing_modules = {ext for ext in used_ext if ext not in module_names}
|
|
|
|
|
|
|
|
if missing_modules and filter in ("All", "Enabled"):
|
2010-06-27 19:04:44 +00:00
|
|
|
col.column().separator()
|
|
|
|
col.column().label(text="Missing script files")
|
merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
2010-03-20 16:41:01 +00:00
|
|
|
|
|
|
|
module_names = {mod.__name__ for mod, info in addons}
|
|
|
|
for ext in sorted(missing_modules):
|
|
|
|
# Addon UI Code
|
2010-06-27 19:04:44 +00:00
|
|
|
box = col.column().box()
|
|
|
|
colsub = box.column()
|
|
|
|
row = colsub.row()
|
merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
2010-03-20 16:41:01 +00:00
|
|
|
|
2010-06-26 20:00:45 +00:00
|
|
|
row.label(text=ext, icon='ERROR')
|
merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
2010-03-20 16:41:01 +00:00
|
|
|
row.operator("wm.addon_disable").module = ext
|
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-06-17 02:38:49 +00:00
|
|
|
def addon_info_get(mod, info_basis={"name": "", "author": "", "version": "", "blender": "", "location": "", "description": "", "wiki_url": "", "tracker_url": "", "category": "", "warning": "", "expanded": False}):
|
2010-03-14 23:19:44 +00:00
|
|
|
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)
|
|
|
|
|
merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
2010-03-20 16:41:01 +00:00
|
|
|
if info.get("blender", (0, 0, 0)) > bpy.app.version:
|
|
|
|
self.report("WARNING','This script was written for a newer version of Blender and might not function (correctly).\nThe script is enabled though.")
|
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"
|
2010-03-30 04:27:13 +00:00
|
|
|
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-06-14 03:52:10 +00:00
|
|
|
filepath = StringProperty(name="File Path", description="File path to write file to")
|
2010-02-16 19:22:37 +00:00
|
|
|
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-06-14 03:52:10 +00:00
|
|
|
pyfile = self.properties.filepath
|
2010-02-16 19:22:37 +00:00
|
|
|
|
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"]
|
2010-03-13 00:14:36 +00:00
|
|
|
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
|
|
|
|
* Interaction Presets
This adds a new presets menu in the splash screen and the Input section of
User Preferences to choose a preset interaction style, consisting of key configurations
and also other user preferences such as select mouse button, view rotation style, etc.
Currently, just 'Blender' and 'Maya' presets are included, hopefully we can have more
presets contributed (and maintained!) by the community.
It's best to keep these presets minimal to avoid too many key conflicts. In the Maya one
I changed the view manipulation key/mouse combos and also the transform
manipulator keys, not much more than that.
To save an interaction preset, open the user preferences Input section, and press the
[ + ] button next to the presets menu. It will save out a .py file containing any edited key
maps and navigation preferences to the presets/interaction folder in your scripts folder.
---
Part of this commit changes the way that key maps are exported/displayed in
preferences - now partial key configs are allowed. Previously it would export/import the
entire key configuration, regardless of whether individual key maps were edited or not
(which would make them more susceptible to conflicts in unexpected areas).
(note, in blender terminology, a key map is a category of key items, such as
'Object Mode' or 'View 2d'.)
Now, the export and the UI display work in a similar way to how key maps are
processed internally - Locally edited key maps (after pressing the 'Edit' button) are
processed first, falling back to other key maps in the current key config, and then falling
back to the default key config. So it's possible for a key config to only include a few
key maps, and the rest just gets pulled from the default key config. The preferences
UI display works like this too behind the scenes in deciding what to show users,
however using it is just like it was before, the complexity is hidden.
2010-04-14 06:27:50 +00:00
|
|
|
USERPREF_MT_interaction_presets,
|
|
|
|
USERPREF_MT_splash,
|
|
|
|
|
2010-02-26 14:28:29 +00:00
|
|
|
WM_OT_addon_enable,
|
|
|
|
WM_OT_addon_disable,
|
|
|
|
WM_OT_addon_install,
|
2010-05-31 11:38:13 +00:00
|
|
|
WM_OT_addon_expand]
|
2010-02-14 11:21:21 +00:00
|
|
|
|
|
|
|
|
|
|
|
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()
|