SMBEdit - Blueprint Editor

    Joined
    Jan 4, 2017
    Messages
    16
    Reaction score
    12
    StarMade Blueprint Editor
    ====

    This editor allows changes to StarMade blueprints that are either difficult or too tedious to do with he official client.
    SMBEdit called from command prompt is compatible with both python2.7 and python3, and should work on all platforms.
    The graphical user interface of SMBEdit requires python3.6 and several extra pip packages.
    Using the GUI allows the import of 3D models from .stl and .obj files.

    # Features:

    * Import 3D model from .obj, .stl (GUI only, experimental)
    * Auto-shape: Set wedges on edges or tetra/corner shapes on corners automatically.
    * Change entity type
    * Change entity class
    * Exchange all hull blocks with std./adv. Armor blocks or the other way around.
    * Mirror entity at core/center at each axis.
    * Move core/center
    * Remove blocks
    * Removes outdated blocks
    * Replaces old style docked entities with rail docked entities.
    * Replace all blocks of a block type with another block type

    # Work in progress

    * Load zipped .obj 3D models
    * Paint blueprint automatically (using textures coming with some .obj files).
    * Improved performance
    * Update notifier

    # Installation
    Installation instructions can be found at:
    Installation · GitHub Wiki

    To update an already (with pip) installed version, use a command prompt:
    Code:
    pip3 install -U "git+https://github.com/p-hofmann/MeshReader.git"
    pip3 install -U "git+https://github.com/p-hofmann/PyVoxelizer.git"
    pip3 install -U "git+https://github.com/p-hofmann/SMBEdit.git"

    # Manual
    A manual for command prompt usage and examples can be found there:
    Command prompt usage · GitHub Wiki
    Examples · GitHub Wiki
    [doublepost=1502872346,1502872271][/doublepost]Finally made a thread, in the hope of getting more feedback on issues, especially with the graphical user interface.

    Please feel free to rant about how horribly complicated it is to install and use it, but most importantly tell me all about crashes, in detail!
    Also, if something in the wiki guides is not clear, I will try to improve it.
     
    Joined
    Sep 12, 2014
    Messages
    90
    Reaction score
    44
    • Purchased!
    • Community Content - Bronze 1
    • Legacy Citizen 4
    Went ahead and installed SMBEdit GUI on Windows. The GUI itself doesn't seem to work, as when I type smbeditGUI into CMD, it stays blank for a couple seconds, and then it goes back to waiting for input. The command line input works just fine though. When I get a chance, I'm going to test smbeditGUI on my Linux install.
     
    Joined
    Jan 4, 2017
    Messages
    16
    Reaction score
    12
    No error, no nothing?
    Alright, I just tried it, too, on a win7 virtual-box. The first time I ran it it took ~15 seconds to appear, but it did.
    It seems to start a separate process in Windows, that is why the input is available again after a short while.
    I will check now where the error messages should appear, when run on a Windows system.

    Could you check for me if python3.6 is used?
    Code:
    python --version
    [doublepost=1502910640,1502907927][/doublepost]Alright, no clue yet where windows redirects the error output, maybe into nirvana.
    Here is a work around:
    Code:
    smbeditGUI 2> logfile.txt
    This will redirect the error output to the local file "logfile.txt".
    I will add a fix logfile location for the next release.

    Thank you for your input! I hope I can help with the real issue when the error is revealed.
     
    Joined
    Sep 12, 2014
    Messages
    90
    Reaction score
    44
    • Purchased!
    • Community Content - Bronze 1
    • Legacy Citizen 4
    Ok, checking the Python version returned
    Code:
    Python 3.6.0 :: Anaconda 4.3.0 (64-bit)
    As for the redirecting the error to a log file, it has only one line:
    Code:
    Fatal Python error: PyThreadState_Get: no current thread
    Thank you for your prompt response, and I hope that this information gives you an insight towards solving the issue.

    Edit: I suppose I should mention as well, SMBEdit, both with and without GUI, worked flawlessly on my Linux install.
     
    Joined
    Jan 4, 2017
    Messages
    16
    Reaction score
    12
    Thank you. That error is a new one for me. From a google search it sounds like that issue would occur, if python mixes up libraries from different version.
    Do you have a python2.x installed besides the 3.6 version? Or another lower python3.x version by any chance?

    Good to hear it works well in Linux.
    The import of 3d models feature is still being worked on. Some models work well, but there is still an issue with some facets not being filled in with blocks in the released version.
    On my local version the pure python import now seems to work right, but the faster c libraries give me trouble.
    I will look into the c-library issue again after I am done with using textures to paint the hull, which is a lot more fun.
     
    Last edited:
    Joined
    Sep 12, 2014
    Messages
    90
    Reaction score
    44
    • Purchased!
    • Community Content - Bronze 1
    • Legacy Citizen 4
    Well, I found that I also had Python 3.5.4 installed for some reason. After removing that, the log file got slightly more interesting:
    Code:
    Traceback (most recent call last):
      File "C:\Program Files\Anaconda3\Scripts\smbeditGUI-script.pyw", line 11, in <module>
        load_entry_point('SMBEdit==0.1.9', 'gui_scripts', 'smbeditGUI')()
      File "C:\Program Files\Anaconda3\lib\site-packages\setuptools-27.2.0-py3.6.egg\pkg_resources\__init__.py", line 565, in load_entry_point
      File "C:\Program Files\Anaconda3\lib\site-packages\setuptools-27.2.0-py3.6.egg\pkg_resources\__init__.py", line 2598, in load_entry_point
      File "C:\Program Files\Anaconda3\lib\site-packages\setuptools-27.2.0-py3.6.egg\pkg_resources\__init__.py", line 2258, in load
      File "C:\Program Files\Anaconda3\lib\site-packages\setuptools-27.2.0-py3.6.egg\pkg_resources\__init__.py", line 2264, in resolve
      File "C:\Program Files\Anaconda3\lib\site-packages\smbeditGUI.py", line 4, in <module>
        from PyQt5.QtWidgets import QApplication
    ImportError: DLL load failed: The specified module could not be found.
    Is this more helpful?
     
    Joined
    Jan 4, 2017
    Messages
    16
    Reaction score
    12
    This sounds more familiar.
    I suspect that the 'pip3 install' installed PyQt5 for 3.5.4 or something.
    Try this:
    Code:
    pip3.6 install -I pyqt5
    pip3.6 install -I "git+https://github.com/p-hofmann/MeshReader.git"
    pip3.6 install -I "git+https://github.com/p-hofmann/PyVoxelizer.git"
    pip3.6 install -I "git+https://github.com/p-hofmann/SMBEdit.git"
    The '-I' tells it to ignore the currently installed stuff and reinstall it, hopefully correct.
    The 'pip3.6' will specify it for 3.6, thought that failed once on my linux system and it got installed for 3.5 anyway. Removing '3.5' was not an option for me sadly. Since you removed yours that should not be an issue anymore.

    Usually, adding '-v' after 'pip3.6 install' reveals at which location the files are installed into, but this was not the case for 'pyqt5', but could be added to the other commands, if unsure.

    I hope that will do it!
    If it complains about 'numpy' after that, you will have to do the same for that, too. I hope not since it can take a bit longer.
    Code:
    pip3.6 install -I numpy
     
    Last edited:
    Joined
    Sep 12, 2014
    Messages
    90
    Reaction score
    44
    • Purchased!
    • Community Content - Bronze 1
    • Legacy Citizen 4
    I've double-checked all the files, even going so far as to locate them using windows search and comb through them. From what I can tell the error "File "C:\Program Files\Anaconda3\lib\site-packages\smbeditGUI.py", line 4, in <module>
    from PyQt5.QtWidgets import QApplication" refers to a file in C:\Program Files\Anaconda3\sip\PyQt5\QtWidgets called "qapplication.sip". I've tried moving that around to see if that changed anything, but it didn't really do anything. If I knew how Python calling files worked I'd be able to figure out what to do to fix it, but until now my experience with Python has been limited to looking at Blender and MCEdit plugins.
     
    Joined
    Jan 4, 2017
    Messages
    16
    Reaction score
    12
    The problem is probably the environment created by 'Anaconda'. PyQt5 might not be included in it.

    Is 'Anaconda' something you installed on purpose, or is it maybe you set up in the past, maybe with the python3.5?
    If you installed pyhon3.6(without anaconda) after installing anaconda with3.5, this might have caused the library issues.
    Supposedly you have to use
    Code:
    conda install -c dsdale24 pyqt5
    to get PyQt5 into the Anaconda python environment.
    If that does not work, a clean new install might be needed. Removing pytohn3.6 and anaconda, then use one of the two.

    Replace "pip3.6 install -I pyqt5" with "conda install -c dsdale24 pyqt5" with Anaconda.
    If the conda command does the trick, I will add a wiki entry specific for anaconda users.
     
    Joined
    Sep 12, 2014
    Messages
    90
    Reaction score
    44
    • Purchased!
    • Community Content - Bronze 1
    • Legacy Citizen 4
    Unfortunately, the pyqt5 version provided from the Anaconda repository, using the command you suggested, is version 5.3.2, which doesn't support python3.6. Looking around the Anaconda repository, I wasn't able to find a version of pyqt5 newer than 5.6, and that also doesn't support python3.6. Rather than attempt a long and painful workaround, I opted instead to uninstall Anaconda, as I think it was only installed because I was over enthusiastic on checking boxes while installing Visual Studio.

    After doing a clean install of Python3.6, and dealing with an unrelated system variable issue, I can happily report that SMBEditGUI works flawlessly under Windows as well. I suspect that completely uninstalling Anaconda wasn't necessary, but since I wasn't using it for anything it didn't affect me in the slightest. I would suggest putting a warning on the wiki that Anaconda users should ensure that they install and use SMBEditGUI with a separate Python install than the one in Anaconda.
     
    Joined
    Jan 4, 2017
    Messages
    16
    Reaction score
    12
    Equilibrium21
    Thank you.

    Xtremesonicboom
    Now I am curious if anaconda with python 3.5 and pyqt 5.6 would have worked.

    So much trouble. If I had thought of releasing the tool for public use from the beginning, I would have written it in java.
    I hope someone gets desperate enough to take the time and convert it to java at some point. I would then switch over.
     

    Daro_Khan

    Bearer of Truths
    Joined
    Jul 1, 2013
    Messages
    72
    Reaction score
    6
    • Legacy Citizen
    • Legacy Citizen 3
    • Legacy Citizen 2
    Ive installed git and python, now i just get loads of syntax errors everytime i try and use any of the commands listed to try and get the darn thing to run *shrug faces* I always get confused as ^$@^ with git hub instructions :/ Am on Windows 10
     
    Joined
    Jan 4, 2017
    Messages
    16
    Reaction score
    12
    It would be very helpful if you could post the syntax errors.
    While it is required to install python, it is never required to actually start python directly.
    If you start the python console and try one of the commands, that would be one way to cause errors.
    All commands are for the normal command prompt.

    I am seriously considering converting all the code to java, that would solve most of the install and usage issues. But I do not feel like it, yet.
     
    Joined
    Sep 12, 2017
    Messages
    84
    Reaction score
    31
    Hello,
    I am trying to import my model but it gets stuck at 0.3%. Do you know why? Can I give it more ram? I set max length to 3820, it is very excessive, but wandering if theres some tweaking I can do. The reason I'm asking is because I know it is not impossible to import 3d models in that size as I can import the obj model in smedit with no problem, but I want to use your program since the quality of import is better.


    Otherwise I really like this program. I have a request that would drastically improve the importing. Can you can find a way to import .kv6 or .vox or .kvx files? There is a program called poly2vox which converts models to voxel formats. This program uses very little resources and can import almost any size without problems VERY fast.

    Eg.


    So if you were able to make your program read either kv6, vox or kvx files you could make importing of massive objects very easy. Right now there is a .kv6 to minecraft schematic converter. SMedit can import minecraft schematics. The only problem is that .kv6 --> schematic converter is limited to 2048 x 2048 x 256 because minecraft can't be built higher than 256 blocks due to the way minecraft has a 256 world height limit.
     
    Last edited:
    Joined
    Jan 4, 2017
    Messages
    16
    Reaction score
    12
    Hy, with an import of that size, it might just be a slow down to a point where no progress is noticeable anymore. The import performance of smbedit is sadly rather bad.
    If you reduce the max length to something like 200, does it work then?
    The current version also has an issue with some triangles not being filled out because of an floating point issue.
    This issue might not occur in the 'develop' version, but runs currently as pure python (very slow).

    I will have a look at 'kv6' / 'vox'.
     
    • Like
    Reactions: silverfoe
    Joined
    Sep 12, 2017
    Messages
    84
    Reaction score
    31
    Hy, with an import of that size, it might just be a slow down to a point where no progress is noticeable anymore. The import performance of smbedit is sadly rather bad.
    If you reduce the max length to something like 200, does it work then?
    The current version also has an issue with some triangles not being filled out because of an floating point issue.
    This issue might not occur in the 'develop' version, but runs currently as pure python (very slow).

    I will have a look at 'kv6' / 'vox'.
    200 works flawlessly. I tried again the 3820 and it slowly goes 0.1...0.2...0.3, then I wait 20 minutes and doesn't move at all, so its like crashed or something.

    If you are able to implement to SMBedit, a converter of kv6, kvx or vox files to starmade blueprints that is scalable, i.e. works regardless of size but takes longer, SMBedit will be revolutionary. So far its been near impossible to make decent imports at big sizes without having 64+ gb of ram, since binvox (another program: binvox 3D mesh voxelizer, keywords: voxelization, voxelisation, 3D model ) can do max 4096x4096x4096, but requires SO MUCH ram (the 3820 import im trying to do requires 55 gigabytes).

    Here is the kv6 --> minecraft schematic converter: kv6ToSchematic - Import 3d models with textures - Minecraft Tools - Mapping and Modding - Minecraft Forum - Minecraft Forum

    Here is Ken silvermann's website where you can find poly2vox (scroll down a bit): Ken Silverman's Projects Page

    The thing that excites me a lot is that poly2vox is just so damn good at voxelizing. Very fast, doesn't use a lot of ram unlike binvox and can handle MASSIVE sizes (as seen in my previous screenshot). If poly2vox was able be combined with starmade without the limitations of the kv6 --> schematic converter (2048x2048x256) that would be groundbreaking.
     
    Joined
    Jan 4, 2017
    Messages
    16
    Reaction score
    12
    if you start the gui with
    Code:
    smbeditGUI 2> logfile.txt
    that should write a potential crash into that file.

    I set a hard limit of 5000x5000x5000 for imports, just because that is a typical sector size and anything bigger would probably just crash a server.
    I should make a test some time for how much memory/block is required. To convert a voxel object of massive size into a starmade blueprint format might require a different tool, one that saves a converted block directly back to the hard drive.
    I hope that will not be needed.

    For the import, best would be a description of the file format of kv6, kvx or vox.
    The best I found so far in that regard are a few badly commented source code files that read/write such formats.
     
    Joined
    Sep 12, 2017
    Messages
    84
    Reaction score
    31
    if you start the gui with
    Code:
    smbeditGUI 2> logfile.txt
    that should write a potential crash into that file.

    I set a hard limit of 5000x5000x5000 for imports, just because that is a typical sector size and anything bigger would probably just crash a server.
    I should make a test some time for how much memory/block is required. To convert a voxel object of massive size into a starmade blueprint format might require a different tool, one that saves a converted block directly back to the hard drive.
    I hope that will not be needed.

    For the import, best would be a description of the file format of kv6, kvx or vox.
    The best I found so far in that regard are a few badly commented source code files that read/write such formats.
    I did this and it made a log file, but it was blank. Not sure if it properly crashed because it says not responding so I spam clicked the close button.
     
    Joined
    Aug 10, 2015
    Messages
    99
    Reaction score
    45
    • Community Content - Bronze 1
    Hi, I'm trying to figure out how to run this. I've downloaded the recommended Python version and the SMBEdit files but attempting to start the program results in solely the brief appearance of a command line, blank or with only 1-2 lines, which immediately disappears. Any idea as to what I did wrong in either the SMBEdit install or the Python install? I've never run Python before so I'm not sure what's going on.


    ----


    Nevermind all of that above, I got the SMBEditGUI working, it opens up the window. However, upon trying to import an OBJ, Python crashes and closes.
     
    Last edited: