Spark addon for Blender

2

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 Posts: 2,818 admin
    nizb0ag wrote: »
    edit, seems to be working now thanks samus, i was using 2.67 it didn't seem to like the textures :|

    t4ubuxk3.3sf.png

    Now stuck with this, is this because blender can't export the textures?

    Make sure your material path is pointing to a material that resides either in an "ns2" or "output" sub-folder. See, what that line of code is trying to do is turn, for example
    C:\Program Files (x86)\Steam\steamapps\common\Natural Selection 2\ns2\materials\biodome\biodome_floor_01.dds
    
    into
    materials\biodome\biodome_floor_01.material
    

    If it doesn't find either "ns2" or "output" as one of the folders in the texture path, it's going to fail, as it should because the spark editor won't be able to open these textures anyways. The list of materials in a spark level consists of the entire path of a .material file right of the "output" or "ns2" folder. This is so it can use either regular "ns2" textures, OR custom textures that are included in a mod.

    So, before you try to export to spark, you need to setup all your .material files, and ensure they've been "built" (ie they exist in your mod's "output" directory)
  • 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 Posts: 2,818 admin
    Soul_Rider wrote: »
    Why would the model not have collision @SamusDroid‌ ? Surely, all I would have to do is make a blueprint for it, and add a collision component...

    @BeigeAlert‌ - Have you seen my GorgeCraft maps? Apart from gc_crevice, and some rock props in the other maps, I don't have any props in the maps..

    What I was questioning was how does FP handle importing collision meshes? Does it make use of every polygon, or does it process it as a convex hull?

    In other words, is it going to use something like this:
    7WaunPk.jpg

    ...or will it do some kind of processing step and turn it into a convex hull (which would look like this):
    3LvwBEk.jpg
  • Soul_RiderSoul_Rider Mod Bean Join Date: 2004-06-19 Member: 29388Members, Constellation, Squad Five Blue Posts: 4,268 Advanced user
    edited December 2014
    I don't know. This is what I am trying to find out. Although I keep getting distracted... I will report back on my findings.

    EDIT

    @BeigeAlert‌

    Can't get the script to work, get the following error:

    beigeerror_zps160f5cc9.png

    These are my settings. The map doesn't use any custom materials, but I included the mod file just in case:

    Beigesettings_zps66246455.png

    I am definitely only selecting geometry, no models, lights or other entities are selected.
    Post edited by Soul_Rider on
    Games:Subnautica Fan Game Mods: GorgeCraft & CTF & Proving Grounds Website: andysoulrider.uk
    Twitter: @AndySoulRider Twitch: Twitch.tv/SoulRider YouTube: Youtube.com/user/IamSoulRider/videos

    Capitalisation is the difference between helping your Uncle Jack off a horse and helping your uncle jack off a horse.
    Knowledge is gained through listening, Understanding is gained through discussion.
  • 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 Posts: 2,818 admin
    edited December 2014
    @Soul_Rider‌ That's odd... Could you send me your .level file so I can narrow down where the problem lies?

    Also, the importer already ignores non-geometry data, so no need to worry about that.

    EDIT: Also, be aware that what you have for "alternate directory 1" is not going to work. It needs to be either an 'ns2' directory, or a mod's 'output' directory, though I imagine this wouldn't cause the error you're getting currently. It seems a bit trivial at first, but it's actually really really important that the game can locate the textures when it imports. In order to ensure the UV coordinates are generated properly, the correct texture must be loaded. For example, a non-square texture is going to yield different UVs than a square texture would.
  • Soul_RiderSoul_Rider Mod Bean Join Date: 2004-06-19 Member: 29388Members, Constellation, Squad Five Blue Posts: 4,268 Advanced user
    edited December 2014
    That is my mod's 'output' folder. I just renamed 'output' to 'GorgeCraft' for the git repository, it is still the *same* folder.

    But I don't have any custom textures anyway, and the level file is gc_pits, so it's easy to get it from the mod. I am just trying to model 1 pit though, not the whole map.

    Edit:

    I should mention I got the same error in 270 and 272b. I will post back if I get the same error with a different map...

    Edit2:

    Same error with different maps. Error also happens if I don't specify the 'output' folder, and just run from steam.

    Also baffles me why people install steam in program files, the Steam path is a decent enough path to install into, and it enables you to keep your 'games' separate from your 'programs'. Maybe I am a bit OCD like that with my filing systems :)
    Post edited by Soul_Rider on
    Games:Subnautica Fan Game Mods: GorgeCraft & CTF & Proving Grounds Website: andysoulrider.uk
    Twitter: @AndySoulRider Twitch: Twitch.tv/SoulRider YouTube: Youtube.com/user/IamSoulRider/videos

    Capitalisation is the difference between helping your Uncle Jack off a horse and helping your uncle jack off a horse.
    Knowledge is gained through listening, Understanding is gained through discussion.
  • 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 Posts: 2,818 admin
    edited December 2014
    Soul_Rider wrote: »
    That is my mod's 'output' folder. I just renamed 'output' to 'GorgeCraft' for the git repository, it is still the *same* folder.

    But I don't have any custom textures anyway, and the level file is gc_pits, so it's easy to get it from the mod. I am just trying to model 1 pit though, not the whole map.

    Edit:

    I should mention I got the same error in 270 and 272b. I will post back if I get the same error with a different map...

    Edit2:

    Same error with different maps. Error also happens if I don't specify the 'output' folder, and just run from steam.

    Also baffles me why people install steam in program files, the Steam path is a decent enough path to install into, and it enables you to keep your 'games' separate from your 'programs'. Maybe I am a bit OCD like that with my filing systems :)

    It looks for the string 'output'.

    I can't fix your problem without seeing the .level file.
  • Soul_RiderSoul_Rider Mod Bean Join Date: 2004-06-19 Member: 29388Members, Constellation, Squad Five Blue Posts: 4,268 Advanced user
    edited December 2014
    You mean to tell me you don't have GorgeCraft Installed!!! I am very disappointed Mr. B Alert.!! ;~)

    Edit:

    Damn, why does it post your comment if the file type is invalid... I obviously want to attach something here...!!!!

    Now need a new post to attach the file, as you can't add an attachment in an edit.. gah!
    Games:Subnautica Fan Game Mods: GorgeCraft & CTF & Proving Grounds Website: andysoulrider.uk
    Twitter: @AndySoulRider Twitch: Twitch.tv/SoulRider YouTube: Youtube.com/user/IamSoulRider/videos

    Capitalisation is the difference between helping your Uncle Jack off a horse and helping your uncle jack off a horse.
    Knowledge is gained through listening, Understanding is gained through discussion.
  • Soul_RiderSoul_Rider Mod Bean Join Date: 2004-06-19 Member: 29388Members, Constellation, Squad Five Blue Posts: 4,268 Advanced user
    Uploading level file..
    Games:Subnautica Fan Game Mods: GorgeCraft & CTF & Proving Grounds Website: andysoulrider.uk
    Twitter: @AndySoulRider Twitch: Twitch.tv/SoulRider YouTube: Youtube.com/user/IamSoulRider/videos

    Capitalisation is the difference between helping your Uncle Jack off a horse and helping your uncle jack off a horse.
    Knowledge is gained through listening, Understanding is gained through discussion.
  • 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 Posts: 2,818 admin
    Okay got it. Found a different bug than the one above that I'm working on now with that level! ;)
  • 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 Posts: 2,818 admin
    edited December 2014
    Just released a new version!

    Fixed the bug where polygons with holes in them would sometimes be flipped around wrong. Also made it so the tool will discard double-faces (only import one-side), rather than giving an error message.

    Still gotta figure out how to reproduce that darned "ValueError: faces.new(...): found the same (BMVERT) used multiple times" error.

    @Soul_Rider, try it out now.

    EDIT: More bug fixes!

    The only outstanding issue at the moment that I know of is that in some cases, the texture alignment is wrong on some polygons -- holes or not. Regretfully, I'm not sure if this is something I can fix any time soon. I believe the problem is due to not knowing exactly how spark maps texture coordinates onto a face. Yes, it certainly uses the face's normal, but therein lies the problem: how EXACTLY does spark calculate a polygon's normal? Does it average up the normals of all the triangles that make up the polygon (no, it does not), or does it simply use the normal of the very first ear clipped (triangle "subtracted" from the rest of the polygon")? I can't know for sure without seeing the source code of the editor, so this may not be fixed for a very long time -- if ever.
    Post edited by BeigeAlert on
  • 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 Posts: 2,818 admin
    @Soul_Rider Is this working for you now?
  • 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 Posts: 2,818 admin
    Guess so...

    Also, bug fixes today! Stupid ones that I'm ashamed stayed in for so long... :(
  • 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 Posts: 2,818 admin
    More bug fixes! Fixed a couple of issues that would cause some faces with holes to not import properly.
  • FlaterectomyFlaterectomy Netherlandistan Join Date: 2005-02-03 Member: 39643Members, NS2 Playtester, Squad Five Blue, Squad Five Silver, NS2 Map Tester, Reinforced - Shadow, WC 2013 - Shadow, Subnautica Playtester, NS2 Community Developer, Pistachionauts Posts: 938 Advanced user
    Dammit, my workflow depended on those faces with holes not importing properly! Now I'm going to have to change how I do things! YOU'VE RUINED IT
    BeigeAlert
  • Soul_RiderSoul_Rider Mod Bean Join Date: 2004-06-19 Member: 29388Members, Constellation, Squad Five Blue Posts: 4,268 Advanced user
    BeigeAlert wrote: »
    @Soul_Rider Is this working for you now?

    Ha sorry @BeigeAlert I completely forgot. I go tdistracted by other projects and haven't got back to testing that idea yet, sorry...
    Games:Subnautica Fan Game Mods: GorgeCraft & CTF & Proving Grounds Website: andysoulrider.uk
    Twitter: @AndySoulRider Twitch: Twitch.tv/SoulRider YouTube: Youtube.com/user/IamSoulRider/videos

    Capitalisation is the difference between helping your Uncle Jack off a horse and helping your uncle jack off a horse.
    Knowledge is gained through listening, Understanding is gained through discussion.
  • 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 Posts: 2,818 admin
    Soul_Rider wrote: »
    BeigeAlert wrote: »
    @Soul_Rider Is this working for you now?

    Ha sorry @BeigeAlert I completely forgot. I go tdistracted by other projects and haven't got back to testing that idea yet, sorry...

    It's okay, I think I've worked out all those bugs.
  • 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 Posts: 2,818 admin
    Another minor bug-fix.
  • UncleCrunchUncleCrunch Mayonnaise land Join Date: 2005-02-16 Member: 41365Members, Reinforced - Onos Posts: 1,542 Advanced user
    Hi,

    I tried to test it on a 2.73. Export to clipboard works but not importing from Spark editor.

    No specific .level file. Make a cube with 3 different textures and try to export.

    I get this error message :
    74373e756e3a3d5c0b08b13a80a5b7.jpg
    ChubbChubbs ???

    Reach me on NS2 forums in :
    Map: Outer Rim Ark and Outer Rim Ark Edge
  • 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 Posts: 2,818 admin
    edited April 2015
    Hi,

    I tried to test it on a 2.73. Export to clipboard works but not importing from Spark editor.

    No specific .level file. Make a cube with 3 different textures and try to export.

    I get this error message :
    74373e756e3a3d5c0b08b13a80a5b7.jpg

    I'm pretty sure I know what's wrong, just gotta add 1 line of code :). Working on it now.

    EDIT: Fixed. :)
    [AwE]Sentinel
  • cabooblecabooble Canada Join Date: 2015-06-24 Member: 205748Members Posts: 21 Fully active user
    Halp! I r scrub;
    UvmMHSV.jpg

    Thank you <3
  • 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 Posts: 2,818 admin
    cabooble wrote: »
    Halp! I r scrub;
    UvmMHSV.jpg

    Thank you <3</div>

    I'd love to help but... this isn't my plugin, so there might not be a lot I can do. What is it you're trying to do with this? Are you trying to import an NS1 level into blender to convert it to NS2?
  • cabooblecabooble Canada Join Date: 2015-06-24 Member: 205748Members Posts: 21 Fully active user
    BeigeAlert wrote: »
    I'd love to help but... this isn't my plugin, so there might not be a lot I can do. What is it you're trying to do with this? Are you trying to import an NS1 level into blender to convert it to NS2?

    Yes, attempting to import ns_metal into blender. Will post to SamusDroid's thread.
  • 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 Posts: 2,818 admin
    cabooble wrote: »
    BeigeAlert wrote: »
    I'd love to help but... this isn't my plugin, so there might not be a lot I can do. What is it you're trying to do with this? Are you trying to import an NS1 level into blender to convert it to NS2?

    Yes, attempting to import ns_metal into blender. Will post to SamusDroid's thread.

    Try turning off texture import with the bsp importer. It doesn't work anyways. You always have to completely re-texture the level when converting an ns1 map to ns2.
  • 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 Posts: 2,818 admin
    edited January 2016
    Hey everybody! Substantial bugfix update. This tool stopped working with Windows 10... God knows why, it just wouldn't access the clipboard data.
    I have successfully tested this with Blender 2.76b 64-bit Other versions might work (NOT 32-bit). The determining factor here is the version of Python that Blender uses. If it uses version 3.4.x, you're golden. If not, it won't work. :(

    Convenient .zip link: https://github.com/BeigeAlert/Blender_Spark_Tools/archive/master.zip

    I've replaced the python functions that were writing/reading the clipboard and replaced that with a DLL. Upside is, it works with Windows 10 now! Downside is... whenever blender moves on to the next python version, I'll have to recompile and put out a new version of that PYD file that's included now. Not a big deal. I'll be around. In case I'm not though... I've created a GitHub repo for public access! Master branch is simply the download with the compiled library. The "DLLSource" branch has the C++ source files for the clipboard library. Only needed if you want to recompile it, not needed to simply run the tool.

    https://github.com/BeigeAlert/Blender_Spark_Tools

    If you have any improvements you'd like to make to the tool, feel free to send me a merge request!

    I've also tweaked the inches to meters scaling value to the value Spark uses internally: a more precise 39.3700787 (was 39.37).
    Saffron_baker
  • ZavaroZavaro Tucson, Arizona Join Date: 2005-02-14 Member: 41174Members, Super Administrators, NS2 Playtester, Squad Five Blue, Squad Five Silver, NS2 Map Tester, Reinforced - Shadow, WC 2013 - Silver, Subnautica Playtester, NS2 Community Developer, Pistachionauts Posts: 751 admin
    Great job! That nasty copy-paste stuff is fixed!
    CDT Map Testing Lead and NA Playtesting Whip
    Steam / Watch live video from zavaro on Twitch / Twitter
    Have a bug in NS2? Report it in the thread! If you can, post how to reproduce it, or private message me on the forum!
  • 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 Posts: 2,818 admin
    Zavaro wrote: »
    Great job! That nasty copy-paste stuff is fixed!

    There there Zavaro, the nasty clipboard can't hurt you anymore.
  • UncleCrunchUncleCrunch Mayonnaise land Join Date: 2005-02-16 Member: 41365Members, Reinforced - Onos Posts: 1,542 Advanced user
    I wished you posted here.
    ChubbChubbs ???

    Reach me on NS2 forums in :
    Map: Outer Rim Ark and Outer Rim Ark Edge
  • 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 Posts: 2,818 admin
    That's a different plugin.
  • UncleCrunchUncleCrunch Mayonnaise land Join Date: 2005-02-16 Member: 41365Members, Reinforced - Onos Posts: 1,542 Advanced user
    edited January 2016
    I know...
    The only one that can save the game.
    (wait for it... wait for it... waiiit....)
    ChubbChubbs ???

    Reach me on NS2 forums in :
    Map: Outer Rim Ark and Outer Rim Ark Edge
  • 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 Posts: 2,818 admin
    Updated to work with Python 3.5 (which blender 2.77 uses).
2
Sign In or Register to comment.