I made an OBJ exporter for blueprints. Now you can import your ships to any 3D modeling program.

    Joined
    Jun 24, 2013
    Messages
    81
    Reaction score
    14
    • Purchased!
    • Community Content - Bronze 1
    • Legacy Citizen
    I've noticed a bug, when I try to (I'm assuming its an older version of a ship,not sure) export a ship with docked entities, it will error almost all of them, but then other ships are fine. So what gives?

    Also, what is planned to be added to it?
     
    Joined
    Jun 8, 2015
    Messages
    29
    Reaction score
    32
    • Purchased!
    • Hardware Store
    I've noticed a bug, when I try to (I'm assuming its an older version of a ship,not sure) export a ship with docked entities, it will error almost all of them, but then other ships are fine. So what gives?

    Also, what is planned to be added to it?
    If the ship is older more than one year, it is possible that the ship was exported in older format. You can try to spawn the ship and put it back to the catalog (so it uses the newest format) and then export it to OBJ.

    If the errors appear again, please, send me the ship so I can look at it.

    There is not much planned to be added. If you have suggestion, I am happy to hear it. However, I am starting semester at university so I wont be able to do much work... I will try my best.
     
    Joined
    Jun 24, 2013
    Messages
    81
    Reaction score
    14
    • Purchased!
    • Community Content - Bronze 1
    • Legacy Citizen
    If the ship is older more than one year, it is possible that the ship was exported in older format. You can try to spawn the ship and put it back to the catalog (so it uses the newest format) and then export it to OBJ.

    If the errors appear again, please, send me the ship so I can look at it.

    There is not much planned to be added. If you have suggestion, I am happy to hear it. However, I am starting semester at university so I wont be able to do much work... I will try my best.
    Sorry for the late reply school n all, but umm I am getting a 'Failed to read next attachment path from meta: E:\Program Files (x86)\Steam\SteamApps\common\StarMade\StarMade\blueprints\EFSF StarGazer RC11 19431\meta.smbpm' the ship goes, the turrets do not.

    PS: The docks are part of the old system.

    As for adding, I am thinking maybe some video links on it for how it works. Also maybe have it so you only need to find the starmade folder and from there it connects to the data folder and the blueprints will come down like a drop list. Also, is it possible for you to set the docked entities to go to their actual places instead of all cores at the center?
     
    Last edited:
    Joined
    Jun 8, 2015
    Messages
    29
    Reaction score
    32
    • Purchased!
    • Hardware Store
    Sorry for the late reply school n all, but umm I am getting a 'Failed to read next attachment path from meta: E:\Program Files (x86)\Steam\SteamApps\common\StarMade\StarMade\blueprints\EFSF StarGazer RC11 19431\meta.smbpm' the ship goes, the turrets do not.

    PS: The docks are part of the old system.
    I have looked into the ship you sent me via PM. The meta file is different and for some reason, re-saving the ship to the catalog did not help. I have changed the way the meta file is loaded in new SM2OBJ v1.3.2 (downloand links updated). It should work now.

    As for adding, I am thinking maybe some video links on it for how it works.
    Can you be more specific? Do you mean how it works under the hood?

    Also maybe have it so you only need to find the starmade folder and from there it connects to the data folder and the blueprints will come down like a drop list.
    Yeah, I am thinking about redesigning whole GUI into something simpler. I am thinking about making it like an app installation with steps.

    E.g: Start -> Select SM folder -> Next -> *new window appears* -> Select blueprint from drop-down list -> Next -> Select output folder -> Next -> What kind of textures do you want to use -> Next -> Some basic settings -> Export -> Next -> Do you want to export textures? -> Yes/No -> Exit

    In each step, there would be a simple text explaining what does it do... For example, explanation about normal textures vs bump textures.

    What do you think?

    Also, is it possible for you to set the docked entities to go to their actual places instead of all cores at the center?
    I have tried to do this a month ago. After a lot of days, coffee, and swearing... it worked only if the docking module was not rotated at all. When it was not in default orientation, the whole thing stopped working and I don't know why. Things get even more complicated when there are different meta files.

    Each docked attachment has a name, position, its docking module position and orientation saved in meta file of its parent. My idea was to create a quaternion based on its orientation (24 total possible orientations) for each attachment and to create a final orientation I multiplied the quaternions togeather. Then, I crated a matrix containing the orientation and translation. This worked only if docked module was in default rotation (facing up and oriented in the same direction as the ship). I have no idea how StarMade handles the orientation. It would be easier if I had a original formula or source code.

    And the meta files, they are pure evil... Let me show you why...

    This is a meta file of Auto Planet Salvager blueprint:

    Violet - number of attachments
    Blue - start of attachment data
    Green - Position of docking module in parent's coordinates



    As you can see, there is a path Planet-Salvager-2/ATTACHMENT_0 following by name and parent's name (I am now not sure in which order) The green one is a XYZ position of docking module in parent's coordinates. The main ship's core is located at [8, 8, 8] and the docking module is at [8, 3, 8]. This makes sense if you look at the ship: There is also a position of docking module [8, 7, 8] relative to attachment at line 0x0d0 following by orientation. If you save a ship to the catalog, the meta file will probably look like this.

    This is a meta file from the ship you PMed me:

    Violet - number of attachments -> 5
    Blue - start of attachment data



    There is only a path, no names... and much fewer data for each entry. I can find a coordinates of docking module if I look harder. That is why the version 1.3.1 failed to export your ship, it expected completely different layout.

    If I had to code loader for each type of meta data without documentation I would lose my mind.

    Yes, I have look into the wiki here and here but they seem to be outdated.
     
    Joined
    Jun 24, 2013
    Messages
    81
    Reaction score
    14
    • Purchased!
    • Community Content - Bronze 1
    • Legacy Citizen
    I have looked into the ship you sent me via PM. The meta file is different and for some reason, re-saving the ship to the catalog did not help. I have changed the way the meta file is loaded in new SM2OBJ v1.3.2 (downloand links updated). It should work now.



    Can you be more specific? Do you mean how it works under the hood?



    Yeah, I am thinking about redesigning whole GUI into something simpler. I am thinking about making it like an app installation with steps.

    E.g: Start -> Select SM folder -> Next -> *new window appears* -> Select blueprint from drop-down list -> Next -> Select output folder -> Next -> What kind of textures do you want to use -> Next -> Some basic settings -> Export -> Next -> Do you want to export textures? -> Yes/No -> Exit

    In each step, there would be a simple text explaining what does it do... For example, explanation about normal textures vs bump textures.

    What do you think?



    I have tried to do this a month ago. After a lot of days, coffee, and swearing... it worked only if the docking module was not rotated at all. When it was not in default orientation, the whole thing stopped working and I don't know why. Things get even more complicated when there are different meta files.

    Each docked attachment has a name, position, its docking module position and orientation saved in meta file of its parent. My idea was to create a quaternion based on its orientation (24 total possible orientations) for each attachment and to create a final orientation I multiplied the quaternions togeather. Then, I crated a matrix containing the orientation and translation. This worked only if docked module was in default rotation (facing up and oriented in the same direction as the ship). I have no idea how StarMade handles the orientation. It would be easier if I had a original formula or source code.

    And the meta files, they are pure evil... Let me show you why...

    This is a meta file of Auto Planet Salvager blueprint:

    Violet - number of attachments
    Blue - start of attachment data
    Green - Position of docking module in parent's coordinates



    As you can see, there is a path Planet-Salvager-2/ATTACHMENT_0 following by name and parent's name (I am now not sure in which order) The green one is a XYZ position of docking module in parent's coordinates. The main ship's core is located at [8, 8, 8] and the docking module is at [8, 3, 8]. This makes sense if you look at the ship: There is also a position of docking module [8, 7, 8] relative to attachment at line 0x0d0 following by orientation. If you save a ship to the catalog, the meta file will probably look like this.

    This is a meta file from the ship you PMed me:

    Violet - number of attachments -> 5
    Blue - start of attachment data



    There is only a path, no names... and much fewer data for each entry. I can find a coordinates of docking module if I look harder. That is why the version 1.3.1 failed to export your ship, it expected completely different layout.

    If I had to code loader for each type of meta data without documentation I would lose my mind.

    Yes, I have look into the wiki here and here but they seem to be outdated.
    I suppose thats fine, except for just having it, here is blueprints! scroll down.

    As for the video, like put a link to my video, or if you made one, put the link to that in there to make it easier.
     

    Nauvran

    Cake Build Server Official Button Presser
    Joined
    Jun 30, 2013
    Messages
    2,343
    Reaction score
    1,194
    • Master Builder Bronze
    • Competition Winner - Small Fleets
    • Legacy Citizen 10
    So yeah
    your program just deleted everything in my starmade folder except for one blueprint.
    Even my pictures and backups are gone
     
    Joined
    Jun 8, 2015
    Messages
    29
    Reaction score
    32
    • Purchased!
    • Hardware Store
    So yeah
    your program just deleted everything in my starmade folder except for one blueprint.
    Even my pictures and backups are gone
    Could you write me the steps? What were you doing?

    I assure you, the program has no power to delete StarMade folder. The only thing that gets deleted is the "temp" folder right next to the "SM2OBJ.exe".
     

    Nauvran

    Cake Build Server Official Button Presser
    Joined
    Jun 30, 2013
    Messages
    2,343
    Reaction score
    1,194
    • Master Builder Bronze
    • Competition Winner - Small Fleets
    • Legacy Citizen 10
    Could you write me the steps? What were you doing?

    I assure you, the program has no power to delete StarMade folder. The only thing that gets deleted is the "temp" folder right next to the "SM2OBJ.exe".
    Well I finished a new ship and wanted to have some more fun with the inbuilt 3d model viewer in W10.
    So I opened your program, found the ship folder (had already set all the other things as I have used it before) and pressed export.
    It came up with a commandoprompt window which disappeared before I could read anything.
    I checked my starmade folder and everything was gone except for that one ships folder but even that folder was empty.

    Found a data recovery programme, and it looks like it was able to find all my missing files, Im currently trying to recover them.
     
    Joined
    Jun 8, 2015
    Messages
    29
    Reaction score
    32
    • Purchased!
    • Hardware Store
    Well I finished a new ship and wanted to have some more fun with the inbuilt 3d model viewer in W10.
    So I opened your program, found the ship folder (had already set all the other things as I have used it before) and pressed export.
    It came up with a commandoprompt window which disappeared before I could read anything.
    I checked my starmade folder and everything was gone except for that one ships folder but even that folder was empty.

    Found a data recovery programme, and it looks like it was able to find all my missing files, Im currently trying to recover them.
    I am sorry to hear that, I hope you will get your files back. As I said before, the exporter can not at any circumstances delete your StarMade folder. The only thing that gets deleted is the temp folder. This gets executed by the following command:

    Line 188 in source/window.cpp source code (which is the only code that deletes something):
    system(std::string("rmdir /Q /S " + ffw::getExecutablePath() + "\\temp").c_str());

    So, if you exported SM2OBJ to C:\SM2OBJ\ then the command would look like this:
    "rmdir /Q /S C:\SM2OBJ\temp\"

    The only possible way for SM2OBJ to delete something, is to put your own files inside the C:\SM2OBJ\temp\ folder, which makes no sense doing it in the first place.

    Your files must have been deleted by different program.
     

    Nauvran

    Cake Build Server Official Button Presser
    Joined
    Jun 30, 2013
    Messages
    2,343
    Reaction score
    1,194
    • Master Builder Bronze
    • Competition Winner - Small Fleets
    • Legacy Citizen 10
    I am sorry to hear that, I hope you will get your files back. As I said before, the exporter can not at any circumstances delete your StarMade folder. The only thing that gets deleted is the temp folder. This gets executed by the following command:

    Line 188 in source/window.cpp source code (which is the only code that deletes something):
    system(std::string("rmdir /Q /S " + ffw::getExecutablePath() + "\\temp").c_str());

    So, if you exported SM2OBJ to C:\SM2OBJ\ then the command would look like this:
    "rmdir /Q /S C:\SM2OBJ\temp\"

    The only possible way for SM2OBJ to delete something, is to put your own files inside the C:\SM2OBJ\temp\ folder, which makes no sense doing it in the first place.

    Your files must have been deleted by different program.
    I have my starmade folder and the obj exporter in another folder.
    I do not know what triggered this but it was after I tried to use your program. Might want to put a warning on it :P
    Also it seems like that program is recovering my files or at least I hope so
     
    Joined
    Jun 24, 2013
    Messages
    81
    Reaction score
    14
    • Purchased!
    • Community Content - Bronze 1
    • Legacy Citizen
    I have my starmade folder and the obj exporter in another folder.
    I do not know what triggered this but it was after I tried to use your program. Might want to put a warning on it :p
    Also it seems like that program is recovering my files or at least I hope so
    Strange, you might want to record next time you use the program, in that case it can be review and looked at. There is also a possibility that you have gotten an infection on your computer from something you had recently downloaded and it targeted at a random time a file address that you frequently used.
     
    Joined
    Jun 8, 2015
    Messages
    29
    Reaction score
    32
    • Purchased!
    • Hardware Store
    Hi everyone!

    I added new GUI (v1.4.0). It should be simple to use. If you find a bug, or you have a suggestion, please let me know!
     
    Joined
    Jun 24, 2013
    Messages
    81
    Reaction score
    14
    • Purchased!
    • Community Content - Bronze 1
    • Legacy Citizen
    I'm getting FragmentFramework.dll is missing, I installed the one you said to, but not working.

     
    Joined
    Jun 8, 2015
    Messages
    29
    Reaction score
    32
    • Purchased!
    • Hardware Store
    I'm getting FragmentFramework.dll is missing, I installed the one you said to, but not working.

    Whoops! I forgot to include DLL in the ZIP file. Sorry, give me 5 minutes and I will reupload the ZIP file.
     
    Joined
    Jun 24, 2013
    Messages
    81
    Reaction score
    14
    • Purchased!
    • Community Content - Bronze 1
    • Legacy Citizen
    My dear sir, you have outdone yourself with this one, its better then what I had in mind.
     
    Joined
    Sep 22, 2015
    Messages
    34
    Reaction score
    10
    • Community Content - Bronze 1
    Great tool. I have a crazy question, do you think you can make a program that does OBJ to SM because your program is so easy to use. It would be nice to have something else outside of SMedit because SMedit is not supported anymore.