Game Development Community

Maya integrated MAP+MIS exporter melscript

by Carleton University (#0005) · in Constructor · 06/16/2008 (4:07 pm) · 3 replies


#1
06/16/2008 (4:07 pm)
Did you create a MEL-based exporter, etc????? I'm working on one, but having some issues.

Jaimi .... if you're out there ... I can't figure out Constructors algorithms for vertex placement (exactly). I have two working scripts to import wedge-shapes.... one works with one of my Constructor files and the other with another (and any new) Constructor file. So, my question is this ..... did the creation of verts change somewhere in the versions of Constructor? To explain better, I have to change the vert order when converting to Maya with the two different Constructor files.... it's really weird.

Also, the creation of Cylinders boggles my mind a bit. Basically what is happenning in Constructor is that 4 verts are used to create a face, in the order listed below:

vert0 = bottom of cylinder
vert1 = top vert above vert0
vert2 = bottom, clockwise (if looking from top) from vert 0
vert3 = top, clockwise from vert 1
...and here's where it gets weird...
vert4 = bottom COUNTERclockwise from VERT0
vert5 = top COUTERclockwise from VERT1
vert6-infinity = continues in the bottom-top manner counterclockwise

I probably need a pic, but don't have time now .... any help would be great!
#2
06/17/2008 (6:12 pm)
I don't think the creation order of verts has changed - if you are looking at each face from the outside, they should all be in the same order. However, it appears that constructor isn't exporting triangle fans, it's exporting triangle strips - this can make the vertex order seem kind of goofy if you're not expecting it.
#3
12/12/2008 (10:44 am)
Wow.... been a super-long time since I posted this ... sorry, but busy at work and haven't had much time to work on my MEL script. However, I have made some progress... for the moment I have cubes, wedges, and cylinders importing, but the cylinders needs more work for determination of number of sides, etc. Started working on texture/UV exporting, but haven't had a lot of time to continue ... hopefully in the near future. I was also working on a GUI for it, but again, haven't had time. Maybe I will feel more motivated if there is interest for this out there, but I haven't seen a whole lot from anyone.

Anywho... Jaimi, not quite sure what you mean with the triangle "strips" ... can you please elaborate? Thanks.

So, as of right now my MEL works (and I am working on the process to do it) like this:
* Open GUI
* Click buttons for Cube, Wedge, Cylinder shapes (others in the future after perfecting these 3 basics)
* Enter inputs for size/# of sides/etc (again, once basics done)
* Create Brush/Mesh
* Texturing based on either projection maps, UVs, or both (I'm working out the kinks on this one ... so far have limited UVs working)
* Export to .CSX file
* Open in Constructor (there is currently a bug where I have to open it, resave it, and reopen for geometry to import correctly)

NOTES:
* Can't convert any non-standard primitives (i.e. no meshes that have merged verts, combined geometry, etc), because that is not how "brushes" work
* UV exporting is still going to be very limited and based on the projection-style that BSP editors use... therefore, texturing non-standard geometry won't have any miracle-cure for impossible texturing. However, it *MAY* make it easier to create custom textures by exporting UVs on weird geometry, helping in making custom seamless texturing (in theory)

What I ***DESPERATELY NEED*** is someone to help me with Euler/Quaternion rotation conversions from Maya-to-Constructor and vise versa (was working on a constructor-to-maya MEL before too). This would be a HUGE HUGE HUGE help because as of right now, I can only rotate objects on 1 axis without them being screwed up.

Thanks, Jaimi, and all.

PS--> A side note: A long while ago I had a semi-working MEL that would read a .MIS file and import the maya models (associated with the .dts files) into a Maya scene in their relative Torque World-Space positions ... AWESOME for creating references while working in Maya...... but alas, the main problem was the weird rotation conversions .... once that is fixed I will continue to impove the MEL script.