[Bf-extensions-cvs] [d967fb99] master: data_overrides: remove: unsupported T63750

meta-androcto noreply at git.blender.org
Sun Sep 15 01:43:29 CEST 2019


Commit: d967fb99c575b89a47d0c1648c5748a0d2035ab5
Author: meta-androcto
Date:   Sun Sep 15 09:43:13 2019 +1000
Branches: master
https://developer.blender.org/rBACd967fb99c575b89a47d0c1648c5748a0d2035ab5

data_overrides: remove: unsupported T63750

===================================================================

D	data_overrides/__init__.py
D	data_overrides/override.py
D	data_overrides/ui.py
D	data_overrides/util.py

===================================================================

diff --git a/data_overrides/__init__.py b/data_overrides/__init__.py
deleted file mode 100644
index fc26a614..00000000
--- a/data_overrides/__init__.py
+++ /dev/null
@@ -1,46 +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 #####
-
-# <pep8 compliant>
-
-bl_info = {
-    "name": "Data Overrides",
-    "author": "Lukas Toenne",
-    "version": (0, 1),
-    "blender": (2, 73, 0),
-    "location": "Scene Properties",
-    "description": "Override settings and caching for linked objects",
-    "warning": "",
-    "wiki_url": "",
-    "tracker_url": "https://developer.blender.org/maniphest/task/edit/form/2/",
-    "category": "Object",
-    }
-
-import bpy
-from data_overrides import override, ui
-
-def register():
-    override.register()
-    ui.register()
-
-def unregister():
-    override.unregister()
-    ui.unregister()
-
-if __name__ == "__main__":
-    register()
diff --git a/data_overrides/override.py b/data_overrides/override.py
deleted file mode 100644
index 0ed7f082..00000000
--- a/data_overrides/override.py
+++ /dev/null
@@ -1,162 +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 #####
-
-# <pep8 compliant>
-
-import bpy, os
-from bpy.types import Operator, PropertyGroup
-from bpy.props import *
-from bpy.utils import escape_identifier
-
-from data_overrides.util import *
-
-# ======================================================================================
-
-class OverrideCustomProperty(PropertyGroup):
-    def _value_get(self):
-        return self['value']
-    def _value_set(self, v):
-        self['value'] = v
-    def _value_del(self):
-        del self['value']
-    value = property(_value_get, _value_set, _value_del)
-
-    def reset(self, target):
-        try:
-            val = eval("target.{}".format(self.name))
-        except:
-            # TODO define exceptions that should be handled gracefully
-            raise
-            return
-        self['value'] = val
-
-    def apply(self, target):
-        val = self['value']
-        try:
-            eval("target.{} = val".format(self.name))
-        except:
-            # TODO define exceptions that should be handled gracefully
-            raise
-            return
-
-class Override(PropertyGroup):
-    id_name: StringProperty(name="ID Name", description="Name of the overridden ID datablock")
-    id_library: StringProperty(name="ID Library", description="Library file path of the overridden ID datablock")
-
-    show_expanded: BoolProperty(name="Show Expanded", description="Expand override details in the interface", default=True)
-
-    def add_custom_property(self, name):
-        prop = self.custom_properties.get(name, None)
-        if not prop:
-            target = self.find_target(bpy.data)
-            if target:
-                prop = self.custom_properties.add()
-                prop.name = name
-                prop.reset(target) # initialize with target value
-
-    def find_target(self, blend_data):
-        return find_id_data(blend_data, self.id_name, self.id_library)
-
-    @property
-    def label(self):
-        return "{}".format(self.id_name)
-
-    def draw_custom_props(self, context, layout):
-        for prop in self.custom_properties:
-            row = layout.row(align=True)
-            row.label(text=prop.name, icon='DOT')
-            row.prop(prop, '["{}"]'.format(escape_identifier("value")), text="")
-
-        row = layout.row()
-        row.operator_context = 'INVOKE_SCREEN'
-        row.context_pointer_set("id_data_override", self)
-        row.operator("scene.override_add_custom_property", text="", icon='ZOOMIN')
-
-    def draw(self, context, layout):
-        target = self.find_target(context.blend_data)
-        if not target:
-            return
-
-        split = layout.split(0.05)
-
-        col = split.column()
-        col.prop(self, "show_expanded", emboss=False, icon_only=True, icon='TRIA_DOWN' if self.show_expanded else 'TRIA_RIGHT')
-
-        col = split.column()
-        icon = bpy.types.UILayout.icon(target)
-        col.label(text=self.label, icon_value=icon)
-
-        self.draw_custom_props(context, layout)
-
-
-def target_library(target):
-    id_data = target.id_data
-    return id_data.library.filepath if id_data.library else ""
-
-# This name is not human-readable, but is unique and avoids issues with escaping
-# when combining file paths and ID names and RNA paths
-# For lookup and display in the UI other name/path properties of the override should be used
-def target_identifier(target):
-    id_data = target.id_data
-    try:
-        path = target.path_from_id()
-    # ValueError is raise when the target type does not support path_from_id
-    except ValueError:
-        path = ""
-    identifier, number = data_uuid(id_data, path)
-    return identifier
-
-def find_override(scene, target):
-    return scene.overrides.get(target_identifier(target), None)
-
-def add_override(scene, target):
-    id_data = target.id_data
-
-    override = scene.overrides.add()
-    override.name = target_identifier(target)
-    override.id_name = id_data.name
-    override.id_library = id_data.library.filepath if id_data.library else ""
-    #override.init(target) # TODO
-
-def remove_override(scene, target):
-    override = scene.overrides.find(target)
-    if override:
-        scene.overrides.remove(override)
-
-# ======================================================================================
-
-def register_property_groups():
-    bpy.utils.register_class(OverrideCustomProperty)
-
-    Override.custom_properties = CollectionProperty(type=OverrideCustomProperty)
-    bpy.utils.register_class(Override)
-
-    bpy.types.Scene.overrides = CollectionProperty(type=Override)
-
-def unregister_property_groups():
-    del bpy.types.Scene.overrides
-    bpy.utils.unregister_class(OverrideCustomProperty)
-    bpy.utils.unregister_class(Override)
-
-# ======================================================================================
-
-def register():
-    register_property_groups()
-
-def unregister():
-    unregister_property_groups()
diff --git a/data_overrides/ui.py b/data_overrides/ui.py
deleted file mode 100644
index 63577856..00000000
--- a/data_overrides/ui.py
+++ /dev/null
@@ -1,181 +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 #####
-
-# <pep8 compliant>
-
-import bpy, os
-from bpy.types import Operator, Panel, UIList
-from bpy.props import *
-
-from data_overrides.util import *
-from data_overrides.override import *
-
-
-'''
-def id_data_children(id_data):
-    if isinstance(id_data, bpy.types.Object):
-        if id_data.instance_type == 'COLLECTION' and id_data.instance_collection:
-            yield id_data.instance_collection
-    elif isinstance(id_data, bpy.types.Group):
-        for ob in id_data.objects:
-            yield ob
-
-
-def template_id_overrides(layout, context, overrides, id_data, max_level):
-    split = layout.split(0.05)
-
-    col = split.column()
-    icon = 'DISCLOSURE_TRI_DOWN' if overrides.show_expanded else 'DISCLOSURE_TRI_RIGHT'
-    col.prop(overrides, "show_expanded", text="", icon=icon, icon_only=True, emboss=False)
-
-    col = split.column()
-
-    for data, override_type in id_override_targets(id_data):
-        col.label(data.path_from_id())
-
-    if max_level <= 0 or max_level > 1:
-        for id_child in id_data_children(id_data):
-            template_id_overrides(col, context, overrides, id_child, max_level-1)
-
-
-def template_overrides(layout, context, localroot, max_level=0):
-    overrides = localroot.overrides
-    for id_child in id_data_children(localroot):
-        template_id_overrides(layout, context, overrides, id_child, max_level)
-
-class OBJECT_PT_SimulationOverrides(Panel):
-    """Simulation Overrides"""
-    bl_label = "Simulation Overrides"
-    bl_idname = "OBJECT_PT_SimulationOverrides"
-    bl_space_type = 'PROPERTIES'
-    bl_region_type = 'WINDOW'
-    bl_context = "object"
-
-    @classmethod
-    def poll(cls

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-extensions-cvs mailing list