mirror of
https://github.com/H-uru/korman.git
synced 2025-07-14 22:36:52 +00:00
Fix #2
It appears that we were storing PyHSPlasma objects in class attributes, so they were being held after the plResManager went away--therefore their keys were nuked. We should probably be holding keys and not objects, but this fix works regardless.
This commit is contained in:
@ -24,11 +24,9 @@ from . import mesh
|
||||
from . import utils
|
||||
|
||||
class Exporter:
|
||||
# These are objects that we need to export as plSceneObjects
|
||||
_objects = []
|
||||
|
||||
def __init__(self, op):
|
||||
self._op = op # Blender export operator
|
||||
self._objects = []
|
||||
|
||||
@property
|
||||
def age_name(self):
|
||||
|
@ -43,13 +43,13 @@ _pool_types = (
|
||||
class ExportManager:
|
||||
"""Friendly resource-managing helper class."""
|
||||
|
||||
_nodes = {}
|
||||
_pages = {}
|
||||
|
||||
def __init__(self, version):
|
||||
self.mgr = plResManager()
|
||||
self.mgr.setVer(version)
|
||||
|
||||
self._nodes = {}
|
||||
self._pages = {}
|
||||
|
||||
# cheap inheritance
|
||||
for i in dir(self.mgr):
|
||||
if not hasattr(self, i):
|
||||
|
@ -22,10 +22,9 @@ from . import explosions
|
||||
from . import utils
|
||||
|
||||
class MaterialConverter:
|
||||
_hsbitmaps = {}
|
||||
|
||||
def __init__(self, exporter):
|
||||
self._exporter = weakref.ref(exporter)
|
||||
self._hsbitmaps = {}
|
||||
|
||||
def export_material(self, bo, bm):
|
||||
"""Exports a Blender Material as an hsGMaterial"""
|
||||
|
@ -85,13 +85,13 @@ class _DrawableCriteria:
|
||||
|
||||
|
||||
class MeshConverter:
|
||||
_dspans = {}
|
||||
_mesh_geospans = {}
|
||||
|
||||
def __init__(self, exporter):
|
||||
self._exporter = weakref.ref(exporter)
|
||||
self.material = material.MaterialConverter(exporter)
|
||||
|
||||
self._dspans = {}
|
||||
self._mesh_geospans = {}
|
||||
|
||||
def _create_geospan(self, bo, mesh, bm, hsgmat):
|
||||
"""Initializes a plGeometrySpan from a Blender Object and an hsGMaterial"""
|
||||
geospan = plGeometrySpan()
|
||||
|
Reference in New Issue
Block a user