Browse Source

Fix #120

pull/121/head
Adam Johnson 6 years ago
parent
commit
67f2b907e0
Signed by: Hoikas
GPG Key ID: 0B6515D6FF6F271E
  1. 13
      korman/nodes/node_deprecated.py
  2. 4
      korman/nodes/node_responder.py

13
korman/nodes/node_deprecated.py

@ -13,6 +13,7 @@
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with Korman. If not, see <http://www.gnu.org/licenses/>. # along with Korman. If not, see <http://www.gnu.org/licenses/>.
import abc
import bpy import bpy
from bpy.props import * from bpy.props import *
from collections import OrderedDict from collections import OrderedDict
@ -20,16 +21,26 @@ from collections import OrderedDict
from .node_core import * from .node_core import *
class PlasmaDeprecatedNode(PlasmaNodeBase): class PlasmaDeprecatedNode(PlasmaNodeBase):
@abc.abstractmethod
def upgrade(self): def upgrade(self):
raise NotImplementedError() raise NotImplementedError()
class PlasmaVersionedNode(PlasmaNodeBase): class PlasmaVersionedNode(PlasmaNodeBase):
def init(self, context):
self.version = self.latest_version
@property
@abc.abstractmethod
def latest_version(self):
raise NotImplementedError()
@classmethod @classmethod
def register(cls): def register(cls):
cls.version = IntProperty(name="Node Version", default=1, options=set()) cls.version = IntProperty(name="Node Version", default=1, options=set())
def upgrade(self, from_version): @abc.abstractmethod
def upgrade(self):
raise NotImplementedError() raise NotImplementedError()

4
korman/nodes/node_responder.py

@ -135,6 +135,10 @@ class PlasmaResponderNode(PlasmaVersionedNode, bpy.types.Node):
stateMgr.register_state(stateNode) stateMgr.register_state(stateNode)
stateMgr.convert_states(exporter, so) stateMgr.convert_states(exporter, so)
@property
def latest_version(self):
return 2
def upgrade(self): def upgrade(self):
# In version 1 responder nodes, responder states could be linked to the responder # 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 # or to subsequent responder state nodes and be exported. The problem with this

Loading…
Cancel
Save