Browse Source

Fix node python identifier regression.

pull/162/head
Adam Johnson 5 years ago
parent
commit
fe20fd7bbb
Signed by: Hoikas
GPG Key ID: 0B6515D6FF6F271E
  1. 10
      korman/nodes/node_core.py
  2. 7
      korman/nodes/node_python.py

10
korman/nodes/node_core.py

@ -20,6 +20,7 @@ from PyHSPlasma import *
import time import time
from ..exporter import ExportError from ..exporter import ExportError
from ..korlib import replace_python2_identifier
class PlasmaNodeBase: class PlasmaNodeBase:
def generate_notify_msg(self, exporter, so, socket_id, idname=None): def generate_notify_msg(self, exporter, so, socket_id, idname=None):
@ -44,14 +45,15 @@ class PlasmaNodeBase:
if single: if single:
name = bl.name if bl is not None else so.key.name name = bl.name if bl is not None else so.key.name
if suffix: if suffix:
return "{}_{}_{}_{}".format(name, self.id_data.name, self.name, suffix) working_name = "{}_{}_{}_{}".format(name, self.id_data.name, self.name, suffix)
else: else:
return "{}_{}_{}".format(name, self.id_data.name, self.name) working_name = "{}_{}_{}".format(name, self.id_data.name, self.name)
else: else:
if suffix: if suffix:
return "{}_{}_{}".format(self.id_data.name, self.name, suffix) working_name = "{}_{}_{}".format(self.id_data.name, self.name, suffix)
else: else:
return "{}_{}".format(self.id_data.name, self.name) working_name = "{}_{}".format(self.id_data.name, self.name)
return replace_python2_identifier(working_name)
def draw_label(self): def draw_label(self):
if hasattr(self, "pl_label_attr") and self.hide: if hasattr(self, "pl_label_attr") and self.hide:

7
korman/nodes/node_python.py

@ -19,7 +19,6 @@ from contextlib import contextmanager
from pathlib import Path from pathlib import Path
from PyHSPlasma import * from PyHSPlasma import *
from ..korlib import replace_python2_identifier
from .node_core import * from .node_core import *
from .node_deprecated import PlasmaDeprecatedNode, PlasmaVersionedNode from .node_deprecated import PlasmaDeprecatedNode, PlasmaVersionedNode
from .. import idprops from .. import idprops
@ -400,12 +399,6 @@ class PlasmaPythonFileNode(PlasmaVersionedNode, bpy.types.Node):
if node.target_object is not None: if node.target_object is not None:
yield node.target_object.name yield node.target_object.name
@property
def key_name(self):
# PFM names ***must*** be valid Python identifiers, but Blender likes inserting
# periods into the object names "Foo.001" -- this causes bad internal chaos in PotS
return replace_python2_identifier("{}_{}".format(self.id_data.name, self.name))
def _make_attrib_socket(self, attrib, is_init=False): def _make_attrib_socket(self, attrib, is_init=False):
new_pos = len(self.inputs) new_pos = len(self.inputs)
if not is_init: if not is_init:

Loading…
Cancel
Save