From 67f2b907e05b092c66f56cdc06c44f67ca0beead Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Sat, 8 Sep 2018 13:33:51 -0400 Subject: [PATCH] Fix #120 --- korman/nodes/node_deprecated.py | 13 ++++++++++++- korman/nodes/node_responder.py | 4 ++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/korman/nodes/node_deprecated.py b/korman/nodes/node_deprecated.py index 7743cfe..d3d5bdd 100644 --- a/korman/nodes/node_deprecated.py +++ b/korman/nodes/node_deprecated.py @@ -13,6 +13,7 @@ # You should have received a copy of the GNU General Public License # along with Korman. If not, see . +import abc import bpy from bpy.props import * from collections import OrderedDict @@ -20,16 +21,26 @@ from collections import OrderedDict from .node_core import * class PlasmaDeprecatedNode(PlasmaNodeBase): + @abc.abstractmethod def upgrade(self): raise NotImplementedError() class PlasmaVersionedNode(PlasmaNodeBase): + def init(self, context): + self.version = self.latest_version + + @property + @abc.abstractmethod + def latest_version(self): + raise NotImplementedError() + @classmethod def register(cls): cls.version = IntProperty(name="Node Version", default=1, options=set()) - def upgrade(self, from_version): + @abc.abstractmethod + def upgrade(self): raise NotImplementedError() diff --git a/korman/nodes/node_responder.py b/korman/nodes/node_responder.py index b209d4b..b6d8702 100644 --- a/korman/nodes/node_responder.py +++ b/korman/nodes/node_responder.py @@ -135,6 +135,10 @@ class PlasmaResponderNode(PlasmaVersionedNode, bpy.types.Node): stateMgr.register_state(stateNode) stateMgr.convert_states(exporter, so) + @property + def latest_version(self): + return 2 + def upgrade(self): # In version 1 responder nodes, responder states could be linked to the responder # or to subsequent responder state nodes and be exported. The problem with this