edit, seems to be working now thanks samus, i was using 2.67 it didn't seem to like the textures
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
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)
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:
...or will it do some kind of processing step and turn it into a convex hull (which would look like this):
BeigeAlertTexasJoin Date: 2013-08-08Member: 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 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_RiderMod BeanJoin Date: 2004-06-19Member: 29388Members, Constellation, Squad Five Blue
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
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.
BeigeAlertTexasJoin Date: 2013-08-08Member: 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 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.
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.
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?
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?
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?
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.
BeigeAlertTexasJoin Date: 2013-08-08Member: 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 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.
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.
Comments
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 into
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)
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:
...or will it do some kind of processing step and turn it into a convex hull (which would look like this):
EDIT
@BeigeAlert
Can't get the script to work, get the following error:
These are my settings. The map doesn't use any custom materials, but I included the mod file just in case:
I am definitely only selecting geometry, no models, lights or other entities are selected.
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.
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.
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!
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.
Also, bug fixes today! Stupid ones that I'm ashamed stayed in for so long...
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.
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 :
I'm pretty sure I know what's wrong, just gotta add 1 line of code . Working on it now.
EDIT: Fixed.
Thank you
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.
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).
There there Zavaro, the nasty clipboard can't hurt you anymore.
The only one that can save the game.
(wait for it... wait for it... waiiit....)