[Bf-extensions-cvs] [97211b2] master: official pie menus: clean up, remove folder structure & unneeded utils.py includes revert: rBA2a290714da05
meta-androcto
noreply at git.blender.org
Fri Aug 26 11:01:14 CEST 2016
Commit: 97211b21de806759e80c864502de6e719994b826
Author: meta-androcto
Date: Fri Aug 26 19:00:45 2016 +1000
Branches: master
https://developer.blender.org/rBA97211b21de806759e80c864502de6e719994b826
official pie menus: clean up, remove folder structure & unneeded utils.py includes revert: rBA2a290714da05
===================================================================
M pie_menus_official/__init__.py
R100 pie_menus_official/pie_clip_marker_of/__init__.py pie_menus_official/pie_clip_marker_of.py
R100 pie_menus_official/pie_manipulator_of/__init__.py pie_menus_official/pie_manipulator_of.py
R100 pie_menus_official/pie_object_modes_of/__init__.py pie_menus_official/pie_object_modes_of.py
R100 pie_menus_official/pie_pivot_of/__init__.py pie_menus_official/pie_pivot_of.py
R100 pie_menus_official/pie_shade_of/__init__.py pie_menus_official/pie_shade_of.py
R100 pie_menus_official/pie_snap_of/__init__.py pie_menus_official/pie_snap_of.py
R100 pie_menus_official/pie_view_of/__init__.py pie_menus_official/pie_view_of.py
D pie_menus_official/utils.py
===================================================================
diff --git a/pie_menus_official/__init__.py b/pie_menus_official/__init__.py
index 100596a..d65e3ba 100644
--- a/pie_menus_official/__init__.py
+++ b/pie_menus_official/__init__.py
@@ -30,10 +30,10 @@ from bpy.types import (
bl_info = {
'name': 'UI Pie Menu Official',
'author': 'Antony Riakiotakis, Sebastian Koenig',
- 'version': (1, 1, 2),
+ 'version': (1, 1, 3),
'blender': (2, 7, 7),
- 'location': 'See preferences for Activation list',
- 'description': 'Pie Menu Activate',
+ 'description': 'Individual Pie Menu Activation List',
+ 'location': 'Addons Preferences',
'warning': '',
'wiki_url': 'https://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/3D_interaction/Pie_Menu',
'category': 'Pie Menu'
@@ -87,7 +87,7 @@ def get_addon_preferences(name=''):
def register_submodule(mod):
if not hasattr(mod, '__addon_enabled__'):
- mod.__addon_enabled__ = True
+ mod.__addon_enabled__ = False
if not mod.__addon_enabled__:
mod.register()
mod.__addon_enabled__ = True
@@ -96,7 +96,7 @@ def register_submodule(mod):
def unregister_submodule(mod):
if mod.__addon_enabled__:
mod.unregister()
- mod.__addon_enabled__ = True
+ mod.__addon_enabled__ = False
prefs = get_addon_preferences()
name = mod.__name__.split('.')[-1]
diff --git a/pie_menus_official/pie_clip_marker_of/__init__.py b/pie_menus_official/pie_clip_marker_of.py
similarity index 100%
rename from pie_menus_official/pie_clip_marker_of/__init__.py
rename to pie_menus_official/pie_clip_marker_of.py
diff --git a/pie_menus_official/pie_manipulator_of/__init__.py b/pie_menus_official/pie_manipulator_of.py
similarity index 100%
rename from pie_menus_official/pie_manipulator_of/__init__.py
rename to pie_menus_official/pie_manipulator_of.py
diff --git a/pie_menus_official/pie_object_modes_of/__init__.py b/pie_menus_official/pie_object_modes_of.py
similarity index 100%
rename from pie_menus_official/pie_object_modes_of/__init__.py
rename to pie_menus_official/pie_object_modes_of.py
diff --git a/pie_menus_official/pie_pivot_of/__init__.py b/pie_menus_official/pie_pivot_of.py
similarity index 100%
rename from pie_menus_official/pie_pivot_of/__init__.py
rename to pie_menus_official/pie_pivot_of.py
diff --git a/pie_menus_official/pie_shade_of/__init__.py b/pie_menus_official/pie_shade_of.py
similarity index 100%
rename from pie_menus_official/pie_shade_of/__init__.py
rename to pie_menus_official/pie_shade_of.py
diff --git a/pie_menus_official/pie_snap_of/__init__.py b/pie_menus_official/pie_snap_of.py
similarity index 100%
rename from pie_menus_official/pie_snap_of/__init__.py
rename to pie_menus_official/pie_snap_of.py
diff --git a/pie_menus_official/pie_view_of/__init__.py b/pie_menus_official/pie_view_of.py
similarity index 100%
rename from pie_menus_official/pie_view_of/__init__.py
rename to pie_menus_official/pie_view_of.py
diff --git a/pie_menus_official/utils.py b/pie_menus_official/utils.py
deleted file mode 100644
index 540e81d..0000000
--- a/pie_menus_official/utils.py
+++ /dev/null
@@ -1,320 +0,0 @@
-# ##### 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.
-#
-# 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.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software Foundation,
-# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-#
-# ##### END GPL LICENSE BLOCK #####
-
-
-import bpy
-
-
-class AddonPreferences:
- _module = {}
-
- @classmethod
- def get_prefs(cls, package=''):
- if not package:
- package = __package__
- if '.' in package:
- pkg, name = package.split('.')
- # key = cls.__qualname__
- if package in cls._module:
- mod = cls._module[package]
- else:
- import importlib
- mod = cls._module[package] = importlib.import_module(pkg)
- return mod.get_addon_preferences(name)
- else:
- context = bpy.context
- return context.user_preferences.addons[package].preferences
-
- @classmethod
- def register(cls):
- if '.' in __package__:
- cls.get_prefs()
-
- @classmethod
- def unregister(cls):
- cls._module.clear()
-
-
-class SpaceProperty:
- """
- bpy.types.Space #Add the virtual property in
-
- # Instantiation
- space_prop = SpaceProperty(
- [[bpy.types.SpaceView3D, 'lock_cursor_location',
- bpy.props.BoolProperty()]])
-
- # When drawing
- def draw(self, context):
- layout = self.layout
- view = context.space_data
- prop = space_prop.get_prop(view, 'lock_cursor_location')
- layout.prop(prop, 'lock_cursor_location')
-
- # register / unregister
- def register():
- space_prop.register()
-
- def unregister():
- space_prop.unregister()
- """
-
- space_types = {
- 'EMPTY': bpy.types.Space,
- 'NONE': bpy.types.Space,
- 'CLIP_EDITOR': bpy.types.SpaceClipEditor,
- 'CONSOLE': bpy.types.SpaceConsole,
- 'DOPESHEET_EDITOR': bpy.types.SpaceDopeSheetEditor,
- 'FILE_BROWSER': bpy.types.SpaceFileBrowser,
- 'GRAPH_EDITOR': bpy.types.SpaceGraphEditor,
- 'IMAGE_EDITOR': bpy.types.SpaceImageEditor,
- 'INFO': bpy.types.SpaceInfo,
- 'LOGIC_EDITOR': bpy.types.SpaceLogicEditor,
- 'NLA_EDITOR': bpy.types.SpaceNLA,
- 'NODE_EDITOR': bpy.types.SpaceNodeEditor,
- 'OUTLINER': bpy.types.SpaceOutliner,
- 'PROPERTIES': bpy.types.SpaceProperties,
- 'SEQUENCE_EDITOR': bpy.types.SpaceSequenceEditor,
- 'TEXT_EDITOR': bpy.types.SpaceTextEditor,
- 'TIMELINE': bpy.types.SpaceTimeline,
- 'USER_PREFERENCES': bpy.types.SpaceUserPreferences,
- 'VIEW_3D': bpy.types.SpaceView3D,
- }
- # space_types_r = {v: k for k, v in space_types.items()}
-
- def __init__(self, *props):
- """
- :param props: [[space_type, attr, prop], ...]
- [[Or string bpy.types.Space, String,
- bpy.props.***()かPropertyGroup], ...]
- bpy.types.PropertyGroup In advance if you use register_class()so
- It is registered
- :type props: list[list]
- """
- self.props = [list(elem) for elem in props]
- for elem in self.props:
- space_type = elem[0]
- if isinstance(space_type, str):
- elem[0] = self.space_types[space_type]
- self.registered = []
- self.save_pre = self.save_post = self.load_post = None
-
- def gen_save_pre(self):
- @bpy.app.handlers.persistent
- def save_pre(dummy):
- wm = bpy.context.window_manager
- for (space_type, attr, prop), (cls, wm_prop_name) in zip(
- self.props, self.registered):
- if wm_prop_name not in wm:
- continue
- d = {p['name']: p for p in wm[wm_prop_name]} # not p.name
- for screen in bpy.data.screens:
- ls = []
- for area in screen.areas:
- for space in area.spaces:
- if isinstance(space, space_type):
- key = str(space.as_pointer())
- if key in d:
- ls.append(d[key])
- else:
- ls.append({})
- screen[wm_prop_name] = ls
- self.save_pre = save_pre
- return save_pre
-
- def gen_save_post(self):
- @bpy.app.handlers.persistent
- def save_post(dummy):
- # clean up
- for cls, wm_prop_name in self.registered:
- for screen in bpy.data.screens:
- if wm_prop_name in screen:
- del screen[wm_prop_name]
- self.save_post = save_post
- return save_post
-
- def gen_load_post(self):
- @bpy.app.handlers.persistent
- def load_post(dummy):
- from collections import OrderedDict
- for (space_type, attr, prop), (cls, wm_prop_name) in zip(
- self.props, self.registered):
- d = OrderedDict()
- for screen in bpy.data.screens:
- if wm_prop_name not in screen:
- continue
-
- spaces = []
- for area in screen.areas:
- for space in area.spaces:
- if isinstance(space, space_type):
- spaces.append(space)
-
- for space, p in zip(spaces, screen[wm_prop_name]):
- key = p['name'] = str(space.as_pointer())
- d[key] = p
- if d:
- bpy.context.window_manager[wm_prop_name] = list(d.values())
-
- # clean up
- for cls, wm_prop_name in self.registered:
- for screen in bpy.data.screens:
- if wm_prop_name in screen:
- del screen[wm_prop_name]
-
- self.load_post = load_post
- return load_post
-
- def get_all(self, space_type=None, attr=''):
- """
- :param space_type: If the property is only only one optional
- :type space_type: bpy.types.Space
- :param attr: If the property is only only one optional
- :type attr: str
- :return:
- :rtype:
- """
- if space_type and isinstance(space_type, str):
- space_type = self.space_types.get(space_type)
- context = b
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-extensions-cvs
mailing list