Model fixer utility

BeigeAlertBeigeAlert Texas Join Date: 2013-08-08 Member: 186657Members, Super Administrators, Forum Admins, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, NS2 Map Tester, Reinforced - Diamond, Reinforced - Shadow, Subnautica Playtester, Pistachionauts
edited November 2013 in Modding
Hey everybody!

I'm working on a utility that fixes Collada (.DAE) model files so they can be used in Spark, particularly ones exported from Blender.

Straight from Blender, there are a couple of problems:
1) very small values that *should* be zero are sometimes written with negative exponents (ie 0.0000002 would be 2e-7) The problem is, builder doesn't seem to like it when numbers have that 'e' in there, so your model basically explodes in a cyclone of random triangles pointing out every which way.
2) Blender has no way of exporting the physics objects required for proper collision mesh generation in Spark. In fact, the ONLY way to get this to work right now is to use a copy of 3DSmax 2009 with the UWE export tools. In the DAE file itself, if I'm not mistaken, this is just some extra data added into a couple of additional nodes in the file, and I believe with some investigation, I can figure out how to replicate this with a simple utility.

I have only tried this with non-animated objects. I have no idea how this will work with animated collada files.

Anyways, I'm still working on #2, but in the mean time, I've created a little Java utility that takes your DAE file, and changes all the really small negative exponents into 0.0 so it will work with builder.

Just run the JAR, and it'll ask you to open your DAE, then it'll ask you where you want to save it. I wouldn't recommend overwriting the original file, just in case. :)

Comments

  • BeigeAlertBeigeAlert Texas Join Date: 2013-08-08 Member: 186657Members, Super Administrators, Forum Admins, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, NS2 Map Tester, Reinforced - Diamond, Reinforced - Shadow, Subnautica Playtester, Pistachionauts
    Okay I've finished it so that it will create the "library_physics_scenes" and "library_physics_models" nodes, but for whatever reason it still automatically creates the ugly convex mesh when run through builder.

    I'd love some insight from the devs on this.
  • Evil_IceEvil_Ice Join Date: 2004-07-09 Member: 29827Members, Squad Five Blue
    This is a very very admirable and long overdue project. This should have been done back in the Beta days of NS2, and honestly UWE should have been on top of this prior to that... sadly this isn't the case, and very select few (self included) are capable of creating assets that work within Spark. That coupled with the complete lack of white-listing and otherwise hardcore consistency checking (can't even test my own models as mods on my OWN server!) leads to a pretty unrewarding time when creating models and assets for NS2 unless they are going into something server-side... Oh well, keep at it, and I hope you make some progress!
  • McGlaspieMcGlaspie www.team156.com Join Date: 2010-07-26 Member: 73044Members, Super Administrators, Forum Admins, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, Squad Five Gold, Reinforced - Onos, WC 2013 - Gold, Subnautica Playtester
    Thanks for doing this BeigeAlert! As Evil_Ice said, the modding community has been missing this for far too long.
    Try shooting brian@unknownworlds.com (Chops) and email. He's the guy that typically handles getting art assets in-game.
  • BeigeAlertBeigeAlert Texas Join Date: 2013-08-08 Member: 186657Members, Super Administrators, Forum Admins, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, NS2 Map Tester, Reinforced - Diamond, Reinforced - Shadow, Subnautica Playtester, Pistachionauts
    McGlaspie wrote: »
    Thanks for doing this BeigeAlert! As Evil_Ice said, the modding community has been missing this for far too long.
    Try shooting brian@unknownworlds.com (Chops) and email. He's the guy that typically handles getting art assets in-game.

    I think I'll do that! Thanks.
  • HowserHowser UK Join Date: 2010-02-08 Member: 70488Members, NS2 Playtester, Squad Five Blue, Reinforced - Shadow, WC 2013 - Shadow, Subnautica Playtester, Retired Community Developer
    oh this is awesome! exactly what we need. While I can get models in-game I have no way of getting the physics meshes in. Quite a big problem i'd say.
    While I cant offer any help with developing this, I can certainly say I'll be happy to test it. :)
    Good luck with this project.
  • SamusDroidSamusDroid Colorado Join Date: 2013-05-13 Member: 185219Members, Forum Moderators, NS2 Developer, NS2 Playtester, Squad Five Gold, Subnautica Playtester, NS2 Community Developer, Pistachionauts
    3DS Max changed quite a bit after 2009, if no one has a plugin for after 2009 there is probably a reason for it, not just something here.
  • McGlaspieMcGlaspie www.team156.com Join Date: 2010-07-26 Member: 73044Members, Super Administrators, Forum Admins, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, Squad Five Gold, Reinforced - Onos, WC 2013 - Gold, Subnautica Playtester
    Damn...I really want to see this move forward. Solving this problem let's us consider making Non-NS related games / Total-Conversion, etc. Not too mention adding new content in.

    It's going to be some time, but I'll see what I can do with this. Not sure exactly how, but I'm willing to contribute.

    @BeigeAlert Do you have what you've done on GitHub or similar repo site?
  • Evil_IceEvil_Ice Join Date: 2004-07-09 Member: 29827Members, Squad Five Blue
    @BeigeAlert if only this were the half of it... fortunately after a year I've managed to get a relatively timely response from devs to my questions, and even some requests fulfilled, but even still with almost a year dumped into a single art asset of very very high quality, it will likely never see the light of day for the community due to a lack of modding support... shame really.
  • BeigeAlertBeigeAlert Texas Join Date: 2013-08-08 Member: 186657Members, Super Administrators, Forum Admins, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, NS2 Map Tester, Reinforced - Diamond, Reinforced - Shadow, Subnautica Playtester, Pistachionauts
    edited November 2013
    McGlaspie wrote: »
    Damn...I really want to see this move forward. Solving this problem let's us consider making Non-NS related games / Total-Conversion, etc. Not too mention adding new content in.

    It's going to be some time, but I'll see what I can do with this. Not sure exactly how, but I'm willing to contribute.

    @BeigeAlert Do you have what you've done on GitHub or similar repo site?

    @McGlaspie I don't, but I could definitely send you the workspace if you want. It's Java, btw.

    It's a pretty simple program. Since DAE is really just an XML document, all I had to do was figure out the structure and how to work with that in Java.
    SamusDroid wrote: »
    3DS Max changed quite a bit after 2009, if no one has a plugin for after 2009 there is probably a reason for it, not just something here.

    @SamusDroid Well they're somehow making new art assets for eclipse remake... so I figure they've either got a new plugin they're not sharing, or they've got an ancient copy of 09 on one of their computers.

    All I'm asking for is some Q&A with the devs so I can make this silly tool. I haven't been able to get a hold of any of them and it's really frustrating.
    Evil_Ice wrote: »
    @BeigeAlert if only this were the half of it... fortunately after a year I've managed to get a relatively timely response from devs to my questions, and even some requests fulfilled, but even still with almost a year dumped into a single art asset of very very high quality, it will likely never see the light of day for the community due to a lack of modding support... shame really.

    @Evil_Ice I don't understand, what's not supported?
  • BeigeAlertBeigeAlert Texas Join Date: 2013-08-08 Member: 186657Members, Super Administrators, Forum Admins, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, NS2 Map Tester, Reinforced - Diamond, Reinforced - Shadow, Subnautica Playtester, Pistachionauts
  • SamusDroidSamusDroid Colorado Join Date: 2013-05-13 Member: 185219Members, Forum Moderators, NS2 Developer, NS2 Playtester, Squad Five Gold, Subnautica Playtester, NS2 Community Developer, Pistachionauts
    Consistency...duh...
  • BeigeAlertBeigeAlert Texas Join Date: 2013-08-08 Member: 186657Members, Super Administrators, Forum Admins, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, NS2 Map Tester, Reinforced - Diamond, Reinforced - Shadow, Subnautica Playtester, Pistachionauts
    edited November 2013
    SamusDroid wrote: »
    Consistency...duh...

    wat?

    Well I actually got modelcompile.exe to crash on me... so at least I know it's TRYING to work... don't know why it's crashing, and I'm giving up on this for now.
  • SamusDroidSamusDroid Colorado Join Date: 2013-05-13 Member: 185219Members, Forum Moderators, NS2 Developer, NS2 Playtester, Squad Five Gold, Subnautica Playtester, NS2 Community Developer, Pistachionauts
    @ Evil_Ice I don't understand, what's not supported?
    Consistency...duh...
    The model client side
  • McGlaspieMcGlaspie www.team156.com Join Date: 2010-07-26 Member: 73044Members, Super Administrators, Forum Admins, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, Squad Five Gold, Reinforced - Onos, WC 2013 - Gold, Subnautica Playtester
    @BeigeAlert If you can send me the source you have, I'll take a look and see what I can cook up. I have the nagging suspicion I'll have to break out the ole'HEX editor. Regardless, modding needs a reliable and consistent way to get fully simulated (physics) and animated content in-game. So, I'm game to do what I can.
  • BeigeAlertBeigeAlert Texas Join Date: 2013-08-08 Member: 186657Members, Super Administrators, Forum Admins, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, NS2 Map Tester, Reinforced - Diamond, Reinforced - Shadow, Subnautica Playtester, Pistachionauts
  • MouseMouse The Lighter Side of Pessimism Join Date: 2002-03-02 Member: 263Members, NS1 Playtester, Forum Moderators, Squad Five Blue, Reinforced - Shadow, WC 2013 - Shadow
    edited September 2014
    *bump*
    @BeigeAlert‌ were you able to make any additional progress on this?
  • BeigeAlertBeigeAlert Texas Join Date: 2013-08-08 Member: 186657Members, Super Administrators, Forum Admins, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, NS2 Map Tester, Reinforced - Diamond, Reinforced - Shadow, Subnautica Playtester, Pistachionauts
    Nah never did. The original purpose of this was to fix the DAE output of Blender (not supposed to have exponent values), which is not a problem anymore for more recent builds of Blender.

    As far as getting collision geometry to work properly... no never did. I'm still scratching my head and wondering why it wouldn't work.
Sign In or Register to comment.