revcompgeek+ wrote:...
Excellent!!
Yeah, Multiwinia is just a modified Darwinia under the hood -- kinda what they wanted to make in the first place, but for lack of money, time, etc. So the shape files should be 100% the same. Imagine being able to make your own "trophy" shapes for the DGs to fight over... that's what people will be wanting most I think. I think TGF is in the beta group, and I expect she would say something non-NDAable if this were'nt the case. She pays attention to details like that.
So here's a couple of links to start. Let me know if you have trrouble finding more. The blender community is pretty good, with lits of wiki and other stuff. The only prob is it tends to be poorly organized, so I usually let google navigate. BlenderArtists.org is a very active forum with lots of very script savvy people -- post your API Qs there and I'm sure you'll get plenty of help.
http://en.wikibooks.org/wiki/Blender_3D ... n/OptimizeI'm pretty sure this is a bit out of date, but here's the relevant bits about doing math on the blender side of the API.
Getting Mesh data (Exporting Only)
Meshes are not just thin wrappers like most of the other Types in Blender so you want to avoid meshObject.getData() and meshObject.data as much as possible, its best practice only calling each mesh data once.
To get the name of the data the object references do not use ob.getData().name simply to get the name of the object. Instead use obj.getData(1) ... meaning obj.getData(1=name_only) this is nice because it works for all data types, its just that
Note, recently (as of 15/10/05) the addition of the Mesh module (a thin wrapper around Blenders mesh data) means that you can do a meshObject.getData(mesh=1) without the problem NMesh has, however this is new and doesn't support all the NMesh functions.
Use new python functionality mesh.transform() (Exporting Only)
As of Blender 2.37 nmesh.transform(ob.matrix) can be used to transform an NMesh by a 4x4 transformation matrix.
On my system it is over 100 times faster than transforming each vert's location and normal by a matrix within python. Though the overall speed gained by using this in my obj exporter was about %5.
make sure that if you are exporting vertex normals add a 1,
mesh.transfrom(matrix, recalc_normals=1) This avoids un-needed vertex normal transforming.
http://www.garagegames.com/blogs/35183/12244This is the DTS exporter (Torque engine) which does triangle strips in python. I'm pretty sure the code is GPL'd so you can lift the stripping stuff once you figure out what the hell he's doing with his feed data (which I couldn't).
Added a new "Geometry Type" section to the general tab to replace the old "triangle strip" section. New buttons allow the user to choose between exporting single triangles, triangle lists, and triangle strips. Defaults to single triangles.
For triangle strips there is also the VTK library. Search for "VTK" and "vtkpython". I've used vtkpythin to transform triangle lists to strips for shapes I've made in blender -- using a perl hack to run the batch ops. It works great, but is a binary lib. Maybe a good choice if you can cleanly interface -- it's fast! But of course this would force export/import users to DL & install another package... I don't think the trophy shapes in MW will be so complex that a python stripper will cough and die for more than a few minutes. No prob as long as there's some progress bar or wait cursor, etc.
There's also a legitimate question of whether strips are faster than lists these days. Supposedly modern cards have deep enough vert caches that lists are almost as good as strips. But Darwinia was coded before Chris was really experienced in OpenGL, so there may be bandwidth / traffic issues with the engine implementation. If stripping looks to be a bear, or if you want to justify the effort up front, you might try some benchmarks with large complex shapes both ways. The "globalworld" shape files could be used as static shapes (replicated many times on a map until FPS starts to show a hit). In the original game data two are lists and the thrid is a strip for unknown reasons.
EDIT: you could also ask one of the beta testers if all the shape files are stripped (or still mixed strips and tris). If they haven't moved everything to strips, then it may not be worth the effort to export them. But that may just be because of time constraints for the Gold master release, with stripped shapes coming with a patch, etc. etc. Hard to tell w/o coming from the horse's mouth. Chris doesn't answer PMs recently, but you could try asking Neothermic -- he seems to be on the inside or have inside info -- are strips worth it? Or IcePick -- he's an IV employee.
If you haven't upgraded to 2.46, do it! it's awesome. A HUGE upgrade to everything blender.
Thanks for your enthusiasm! Let me know if I can be of any help along the way...