p-hofmann / SMBEdit

StarMade Blueprint Editor
5 stars 1 forks source link

Blueprint method to add blocks #19

Closed Septaris closed 7 years ago

Septaris commented 7 years ago

This new feature allows to add blocks directly from a blueprint instance. To add blocks, you have to specify a block ID and a list of positions (as well as a list of rotations - optional).

The add_blocks method will allow, among other things, to voxelize a 3D model using a list of positions.

Usage (see the associated test for more details):

bp = Blueprint()
block_id = 598  # grey hull
bp.add_blocks(block_id, positions=[(0, 0, 0)], rotations=[0])

PS: the voxelizer is ready but it's in a dedicated package and I remember that you don't want to add dependencies to SMBedit. Do you have an idea/solution to integrate the voxelization process without pip (pip install git+https://github.com/Septaris/mesh_vox.git))?

p-hofmann commented 7 years ago

Awesome, I will have a look at it!

I wanted to avoid pip to make the installation as easy as possible. It is hard enough for most to even find out how the console works. I just started experimenting with the 'cx_Freeze' to make an executable and the GUI is now in a ... usable state, still ugly and not user friendly, but usable. I am hoping that if that is used, not even installing python is required? If that works as I hope then only people who want to use console (and who are very likely not to mind installing pip packages) will have to bother with pip and the rest can use the GUI executables.

By the way, do you have a mac by any chance? I put the config file in the following location for those:

"~/Library/Application Support/SMBEdit/config.ini"

But I have no way of testing it.

Septaris commented 7 years ago

Yep, you don't need Python once you have created the executable with cx_freeze.

Sorry, I have just a Windows, a Debian and a Ubuntu :/

p-hofmann commented 7 years ago

Too bad.

A commented unit-test! I feel ashamed now about mine, hehe.