bzwrap: Python Package

General talk about the map making process.
Post Reply
User avatar
tainn
Private First Class
Private First Class
Posts: 278
Joined: Sun Nov 18, 2018 7:25 pm
Location: phantom_zone;

bzwrap: Python Package

Post by tainn »

I made a Python package bzwrap (or bzw wrapper) for personal use, but am sharing it in case anyone else might find it useful. It is aimed towards anyone creating maps by hand, but wanting to express themselves in a slightly smaller amount of lines or perhaps want to introduce some logic to their creations.

The package, its code and description can be found in its GitHub repository.

Perhaps as a post scriptum, this is meant to be a straightforward and lightweight package, assisting at elementary levels of map creation by hand. That said, I am open for any pull requests or some other form of contribution, should there be any interest.
User avatar
mathiaz
Private First Class
Private First Class
Posts: 64
Joined: Sat May 27, 2006 11:59 pm

Re: bzwrap: Python Package

Post by mathiaz »

Nice! I have done something similar. but not enough clean.
The first class is a bloc, with interesting attribute:
- type (meshbox, pyramid..)
- sx, sy, sz (size)
- px, py pz (position)
- shoothrought
- rotation
- name
- option
- color

and methods:

- getSurface
- cloneCtf
- draw
- symetrieAxiale
- translate
- xShift, yShift,zShift
<°)))><|
User avatar
tainn
Private First Class
Private First Class
Posts: 278
Joined: Sun Nov 18, 2018 7:25 pm
Location: phantom_zone;

Re: bzwrap: Python Package

Post by tainn »

Hey, mat! Sounds sweet!

Yeah, this package is meant to be very open and non-restrictive, so any type of attribute can be set, even if the attribute itself doesn't exist. I'm considering making a more strict version as well, where the creator is essentially guided on what objects they can create, what attributes those objects can have, as well as what types of values can those attributes then be given.
User avatar
tainn
Private First Class
Private First Class
Posts: 278
Joined: Sun Nov 18, 2018 7:25 pm
Location: phantom_zone;

Re: bzwrap: Python Package

Post by tainn »

Just a slight update that v3.0 of the package has been released.

The package has also been renamed from bzwrap to bzw for simplicity.

Among other things, the changes include the following since the last version (2.7):
  • Lazy IO support only with a required final dump
  • Addition of indent and output utility methods
  • Addition of the exceptions module
  • Removal of the utils module and partial inclusion in the bzw module as @staticmethod
  • Reduction to non-nested parameters support only
Post Reply