DrawInfo-Machine - Now in Python

Discussion, updates, modifications, etc for the various map editors...
Post Reply
User avatar
Zehra
Survey Champion 2024
Survey Champion 2024
Posts: 934
Joined: Sun Oct 18, 2015 3:36 pm
Location: Within the BZFS API and Beyond it
Contact:

DrawInfo-Machine - Now in Python

Post by Zehra »

DrawInfo is perhaps one of the least used features, but perhaps one of the best features:
It can do the following:
  • Increase FPS of maps greatly
  • Reduce inconsistent physics
  • Enable better framerates
  • Reduce lag and jitter like effects
  • Provide more appealing visuals
  • Provide limited animation capability
Very few people have much knowledge or insight on it. It is difficult to do manually and it can be rather confusing, as it is not an object by itself, but rather a sub-component of the more widely known "mesh".

Despite all of this, some years ago a tool/script was released to enable creating drawInfo rather easily from .obj files and it may be viewed in the following thread: obj-to-drawinfo converter DI_machine_beta 0.3

At the time period, PHP was more common, but to make it easier for people who may have Python on hand, it has been ported to Python from the original PHP.

All credits to the success of this belong to Tedius who is the author and creator of DI-Machine. (The original PHP version)

I have attempted to try to make a port of this to Python, as it is permitted in the licensing used for it: CC BY 3.0 Deed Attribution 3.0 Unported , which may be seen in the original thread attachment in the following forum post.

(Python port built from the linked forum post.)

To summarize the differences:
  • Python vs PHP
  • Help message if user adds no file.
  • Python parses things via a list compare to arrays and objects in PHP
  • My code quality is likely not as good as the original
Please note: That this has been done as a private venture and has not had any endorsements of any kind.

This is a port of the original PHP version.
py-machine.txt
build from the release in 2007-11-17 (0.6 edition)
(13.98 KiB) Downloaded 61 times
Rename file type from .txt to .py

To use:

Code: Select all

python3 py-machine.py /path/to/example.obj > example.bzw
-Zehra
Those who are critical of me, I'll likely be the same of them. ~Zehra
The decisions we make are the ones we look forward too and the ones we regret. ~Zehra
There's a difference between knowing my name and knowing me, one shows respect to my name and the other is to who I am. ~Zehra

See where I've last been active at Strayers.
Visit BZList.net for a modern HTML5 server stats site.

Click here to view the 101 Leaderboard & Score Summaries Last updated 2021-01-12 (YYYY-MM-DD)
Latest 101 thread
User avatar
Zehra
Survey Champion 2024
Survey Champion 2024
Posts: 934
Joined: Sun Oct 18, 2015 3:36 pm
Location: Within the BZFS API and Beyond it
Contact:

Re: DrawInfo-Machine - Now in Python

Post by Zehra »

For anyone who may have downloaded the previous version. I had forgotten to include the tristrip logic. My apologies for this mistake.

I've added the revised version below:
py-machine-0-0-2.txt
tristrip logic included
(14.75 KiB) Downloaded 163 times
-Zehra
Those who are critical of me, I'll likely be the same of them. ~Zehra
The decisions we make are the ones we look forward too and the ones we regret. ~Zehra
There's a difference between knowing my name and knowing me, one shows respect to my name and the other is to who I am. ~Zehra

See where I've last been active at Strayers.
Visit BZList.net for a modern HTML5 server stats site.

Click here to view the 101 Leaderboard & Score Summaries Last updated 2021-01-12 (YYYY-MM-DD)
Latest 101 thread
User avatar
Zehra
Survey Champion 2024
Survey Champion 2024
Posts: 934
Joined: Sun Oct 18, 2015 3:36 pm
Location: Within the BZFS API and Beyond it
Contact:

Re: DrawInfo-Machine - Now in Python

Post by Zehra »

I haven't tested this, but it should likely work. (I've attempted to reduce the amount of duplicate code/logic needed to get this script to work.)
py-machine-0-0-3.txt
possible cleaner/nicer version of py-machine
(12.91 KiB) Downloaded 11 times
Let me know if this doesn't work for any reason.

-Zehra
Those who are critical of me, I'll likely be the same of them. ~Zehra
The decisions we make are the ones we look forward too and the ones we regret. ~Zehra
There's a difference between knowing my name and knowing me, one shows respect to my name and the other is to who I am. ~Zehra

See where I've last been active at Strayers.
Visit BZList.net for a modern HTML5 server stats site.

Click here to view the 101 Leaderboard & Score Summaries Last updated 2021-01-12 (YYYY-MM-DD)
Latest 101 thread
Post Reply