def __getattr__(self, attr):
return getattr(self._medge, attr)
def __getattr__(self, attr):
return getattr(self._medge, attr)
for e in self.edges.itervalues():
e.v1 = self.verts[e.v1.index]
e.v2 = self.verts[e.v2.index]
for e in self.edges.itervalues():
e.v1 = self.verts[e.v1.index]
e.v2 = self.verts[e.v2.index]
def __getattr__(self, attr):
return getattr(self._mesh, attr)
def __getattr__(self, attr):
return getattr(self._mesh, attr)
+ def splice(self, other):
+ offset = len(self.verts)
+ for v in other.verts:
+ v.index += offset
+ self.verts.append(v)
+
+ offset = len(self.faces)
+ for f in other.faces:
+ f.index += offset
+ self.faces.append(f)
+
+ for e in other.edges.itervalues():
+ e.key = make_edge_key(e.v1.index, e.v2.index)
+ self.edges[e.key] = e
+
+ self.lines += other.lines
+
- obj = scene.objects.active
- if obj.getType()!="Mesh":
- raise Exception, "Can only export Mesh data"
+ objs = Blender.Object.GetSelected()
+ if not objs:
+ raise Exception, "Nothing to export"
+ for o in objs:
+ if o.getType()!="Mesh":
+ raise Exception, "Can only export Mesh data"
self.cache_size = Blender.Draw.Create(self.config.get('cache_size', 64))
self.export_lines = Blender.Draw.Create(self.config.get('export_lines', False))
self.tbn_vecs = Blender.Draw.Create(self.config.get('tbn_vecs', False))
self.cache_size = Blender.Draw.Create(self.config.get('cache_size', 64))
self.export_lines = Blender.Draw.Create(self.config.get('export_lines', False))
self.tbn_vecs = Blender.Draw.Create(self.config.get('tbn_vecs', False))
self.debug = Blender.Draw.Create(self.config.get('debug', False))
self.strip_debug = Blender.Draw.Create(self.config.get('strip_debug', False))
self.split_debug = Blender.Draw.Create(self.config.get('split_debug', False))
self.debug = Blender.Draw.Create(self.config.get('debug', False))
self.strip_debug = Blender.Draw.Create(self.config.get('strip_debug', False))
self.split_debug = Blender.Draw.Create(self.config.get('split_debug', False))
("Cache size", self.cache_size, 8, 1024, "Cache size to optimize for"),
("Export lines", self.export_lines, "Export lone edges as lines"),
("Compute T/B vecs", self.tbn_vecs, "Compute tangent/binormal vectors for bumpmapping"),
("Cache size", self.cache_size, 8, 1024, "Cache size to optimize for"),
("Export lines", self.export_lines, "Export lone edges as lines"),
("Compute T/B vecs", self.tbn_vecs, "Compute tangent/binormal vectors for bumpmapping"),
("Debugging options"),
("Debug", self.debug),
("Debug strips", self.strip_debug),
("Debug splitting", self.split_debug)])
if ret:
dirname = self.temp_config.get("dirname", Blender.sys.dirname(Blender.Get("filename")))
("Debugging options"),
("Debug", self.debug),
("Debug strips", self.strip_debug),
("Debug splitting", self.split_debug)])
if ret:
dirname = self.temp_config.get("dirname", Blender.sys.dirname(Blender.Get("filename")))
Blender.Window.FileSelector(self.export, "Export MSP GL mesh", "%s/%s.mesh"%(dirname, obj.name))
def draw(self):
Blender.Window.FileSelector(self.export, "Export MSP GL mesh", "%s/%s.mesh"%(dirname, obj.name))
def draw(self):
self.config['cache_size'] = self.cache_size.val
self.config['export_lines'] = self.export_lines.val
self.config['tbn_vecs'] = self.tbn_vecs.val
self.config['cache_size'] = self.cache_size.val
self.config['export_lines'] = self.export_lines.val
self.config['tbn_vecs'] = self.tbn_vecs.val
self.config['debug'] = self.debug.val
self.config['strip_debug'] = self.strip_debug.val
self.config['split_debug'] = self.split_debug.val
self.config['debug'] = self.debug.val
self.config['strip_debug'] = self.strip_debug.val
self.config['split_debug'] = self.split_debug.val
exp.cache_size = self.cache_size.val
exp.export_lines = self.export_lines.val
exp.tbn_vecs = self.tbn_vecs.val
exp.cache_size = self.cache_size.val
exp.export_lines = self.export_lines.val
exp.tbn_vecs = self.tbn_vecs.val
exp.debug = self.debug.val
exp.strip_debug = self.strip_debug.val
exp.split_debug = self.split_debug.val
exp.debug = self.debug.val
exp.strip_debug = self.strip_debug.val
exp.split_debug = self.split_debug.val