Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replacer for *Dat2Obj.py* and *Dat2ObjTex.py* #1

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

LaChal
Copy link

@LaChal LaChal commented Jan 28, 2018

Dat2Obj.py and Dat2ObjTex.py are now replaced by dat2obj.py, and renamed with a _old suffix to avoid issues on case unsensitive file systems.

dat2obj.py uses a more object oriented approach to convert files.
It can handle mono or multi-textured files, whith or without NORMALS section.

More details can be found in dat2obj.md.

*Dat2Obj.py* and *Dat2ObjTex.py* are now replaced by *dat2obj.py*, and renamed with a *_old* suffix to avoid issues on case unsensitive file systems.

*dat2obj.py* uses a more object oriented approach to convert files.
It can handle mono or multi-textured files, whith or without NORMALS section.

More details can be found in `dat2obj.md`.
@LaChal
Copy link
Author

LaChal commented Mar 28, 2018

@JensAyton @Kaks @AnotherCommander Anyone still active here or is this project dead?

@AnotherCommander
Copy link
Member

Hi, sorry for not getting back to you earlier.

The project's activity is much reduced these days. The reason I did not comment on this PR earlier is that I do not have Python experience and do not feel qualified to comment on the code. Plus, I cannot test the PR and was hoping that someone else might be able to do a review.

Just a couple of quick questions for now, a) What is the minimum version of Python required to be able to run this? b) Can it be built also on Windows and, if yes, are there any dependencies we need to be aware of?

@LaChal
Copy link
Author

LaChal commented Apr 1, 2018

Hi @AnotherCommander,

No problem. I read in the readme that Obj2DatTexNorm.py was the only program that could be considered as the sole maintained. (And the latest commit on master branch was done in 2016.)

Merging a PR locally to test it is possible using git command line.

The minimum version of Python is 2.7.3. It can be converted for Python 3 by using 2to3.
I could not test with older version than 2.7.3, so adaptation may be needed.
The new dat2obj.py program runs with standard python modules; so it may be built using py2exe or pyinstaller.
However, the tests need openstep_parser module. It is installed by the test_dat2obj.sh shell script in a dedicated Python virtual environment.

I also created a release on my fork, where are instructions to run on Linux.
Since there's no code to be compiled or dependencies on non-standard Python modules, I guess the same logic can be used to run on Windows provided Python is installed.

LaChal and others added 3 commits April 7, 2018 16:09
The test helper program `build_otis.py` now rely on `pbPlist` library instead of `openstep_parser`.
The test script `test_dat2obj.sh` has been updated to install `pbPlist` in the virtual environment.
Changed test program dependency and formated `dat2obj.py`.
@AnotherCommander
Copy link
Member

I am unable to test this PR on Windows. The Python I have is too old (2.4) and no time to get it set up with more updated versions right now. There are also some new dependencies introduced, which makes things more complicated for me. I would appreciate it if someone else did this review.

@LaChal Could you maybe test under Windows and confirm that this PR can be built and works there too?

@LaChal
Copy link
Author

LaChal commented Apr 10, 2018

Badly, I don't have a working Windows system right now on my side.
However, a basic Python 2.7 is enough to run the new dat2obj.py file.
It is possible to install several Python versions on any system. These two posts can lead you on how to manage several versions: https://stackoverflow.com/questions/4583367/how-to-run-multiple-python-versions-on-windows https://superuser.com/questions/296072/is-it-possible-to-install-2-versions-of-python-on-windows
More technical information can be found in the links of the second answer in the second link: https://docs.python.org/3.3/using/windows.html https://www.python.org/dev/peps/pep-0397/

@AnotherCommander
Copy link
Member

We have a forum comment from a user who tried the proposed updates. It looks like the conversion to .obj is not entirely clean. More details here: http://www.aegidian.org/bb/viewtopic.php?p=263131#p263131

@LaChal
Copy link
Author

LaChal commented Apr 18, 2018

Hmmm...
Interesting. Looks like normals are not calculated the right way.
On My side, I tested some models, but verifying them all in Blender can take ages.
Anyway, I'll have a look.

@LaChal
Copy link
Author

LaChal commented Apr 19, 2018

@AnotherCommander I think I have the answer for the issue you linked.
The new dat2obj.py replaces only the ones renamed with a _old suffix (Dat2Obj and Dat2ObjTex).
IMO, he has tow solutions:

  1. Use the Dat2ObjTexNorm.py program, which is unchanged.
  2. Use the new dat2obj.py program, then correct the normals in Blender (or the software he's using).

LaChal and others added 2 commits May 19, 2018 00:19
* The `test_dat2obj.py` program can be used to test `dat2obj.py`.
  Call it with the python interpreter, or use the dedicated scripts `test_dat2obj.bat` or `test_dat2obj.sh`, according to your OS.
  By default, this program will use your Oolite installation to double convert the `.dat` models files to `.obj` and `.mtl` ones.
  The `.dat` files are copied in dedicated folders before conversion, so the game ones are not used directly.
  Note that the test program will tell that the tests failed for 35 files. This is (for now) the expected behaviour.
  See `test_dat2obj.py` itself for more details about the test scenario and usage options.
* Removed the forced lower case conversion on file names in `dat2obj.py`.
* Enhanced `build_otis.py`.
* Fixed some typos and docstrings.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants