Browse Source

Relax restrictions on key names

These rules made sense in 0.01 when we promoted modifier names. However,
these have been disallowed for over a year now. These restrictions are
sneaky and serve no purpose now.
pull/42/head
Adam Johnson 9 years ago
parent
commit
47bd42caa8
  1. 11
      korman/exporter/manager.py

11
korman/exporter/manager.py

@ -77,9 +77,12 @@ class ExportManager:
# This is one of those "sanity" things to ensure we don't suddenly startpassing around the # This is one of those "sanity" things to ensure we don't suddenly startpassing around the
# key of an uninitialized object. # key of an uninitialized object.
if isinstance(pl, type(object)): if isinstance(pl, type(object)):
assert name or bl assert name or bl or so
if name is None: if name is None:
if bl is not None:
name = bl.name name = bl.name
else:
name = so.key.name
pl = pl(name) pl = pl(name)
self.mgr.AddObject(location, pl) self.mgr.AddObject(location, pl)
@ -173,14 +176,18 @@ class ExportManager:
def find_key(self, pClass, bl=None, name=None, so=None): def find_key(self, pClass, bl=None, name=None, so=None):
"""Given a blender Object and a Plasma class, find (or create) an exported plKey""" """Given a blender Object and a Plasma class, find (or create) an exported plKey"""
assert (bl or name) and (bl or so) assert bl or so
if so is None: if so is None:
location = self._pages[bl.plasma_object.page] location = self._pages[bl.plasma_object.page]
else: else:
location = so.key.location location = so.key.location
if name is None: if name is None:
if bl is not None:
name = bl.name name = bl.name
else:
name = so.key.name
index = plFactory.ClassIndex(pClass.__name__) index = plFactory.ClassIndex(pClass.__name__)
for key in self.mgr.getKeys(location, index): for key in self.mgr.getKeys(location, index):

Loading…
Cancel
Save