CModTool 1.0.1 for OS X

General discussion about Celestia that doesn't fit into other forums.
Avatar
Topic author
dirkpitt
Developer
Posts: 674
Joined: 24.10.2004
With us: 20 years 1 month

CModTool 1.0.1 for OS X

Post #1by dirkpitt » 29.05.2005, 05:28

I've made an OS X gui wrapper around the 3dstocmod and cmodfix tools:

* Download CModTool 1.0.1

CModTool is a utility for converting 3DS models to Celestia's cmod format, or for optimizing cmod models.

It includes an icon by ElChristou who along with Cham provided valuable feedback.

It should run on OS X 10.2 and later. License is GPL, and source code is available via anonymous SVN access,
https://svn.osxdev.org/project/CModTools/trunk/. Note that it requires the Celestia source code as well to compile.

Features:
- Batch processing of multiple files (no Applescript or Automator yet)
- Drag and drop files onto the window
- Triangle strip optimization
- Simulation mode
- Files are not overwritten if an error occurs

Notes:
- Speed, for me, is roughly similar to using the command line versions of 3dstocmod and cmodfix. That is to say,
for about a 2MB 3ds it takes about 20 seconds on a 1.x GHz G4. The tools are tuned for G5's so expect better
performance on say, recent iMacs.
- In rare cases, certain meshes fail to produce satisfactory results. While fiddling with the various options often
fixes this, if it does not please let me know so I can determine if this is due to the model itself, or issues with the
command line tools, or the GUI.
Last edited by dirkpitt on 18.06.2005, 13:33, edited 1 time in total.

julesstoop
Posts: 408
Joined: 27.03.2002
With us: 22 years 8 months
Location: Leiden, The Netherlands

Post #2by julesstoop » 29.05.2005, 09:35

Thanks!
Another tool for OS X-users.
Lapinism matters!
http://settuno.com/

ElChristou
Developer
Posts: 3776
Joined: 04.02.2005
With us: 19 years 9 months

Post #3by ElChristou » 31.05.2005, 19:54

Hello,

I still have some problem with the "generate tangents"... (bad stuff)
Someone met something like this?
Image

jestr
Posts: 612
Joined: 14.09.2003
With us: 21 years 2 months
Location: Bridgwater,UK

Post #4by jestr » 31.05.2005, 22:00

Yes,I get the same complaint sometimes with the Windows version.It complains it needs texture coordinates to generate tangents,even though the model has them.Odd,sometimes it works sometimes not,Jestr

rthorvald
Posts: 1223
Joined: 20.10.2003
With us: 21 years 1 month
Location: Norway

Re: CModTool 1.0 for OS X

Post #5by rthorvald » 12.06.2005, 03:59

dirkpitt wrote:I've made an OS X gui wrapper around the 3dstocmod and cmodfix tools


Thank you for the app!

It works fine, but i have one question:
It seems transparency does not carry over well from 3ds to cmod. The values for a material??s transparency are changed (becomes less transparent, and in some cases, completely opaque). Is this a limitation of the format, or something to do with my 3ds files, or the settings?

It happens on all the files i have tested. The models are rather complex, the biggest one almost 20MB in size.

-rthorvald

Avatar
Topic author
dirkpitt
Developer
Posts: 674
Joined: 24.10.2004
With us: 20 years 1 month

Re: CModTool 1.0 for OS X

Post #6by dirkpitt » 12.06.2005, 08:48

rthorvald wrote:It seems transparency does not carry over well from 3ds to cmod. The values for a material??s transparency are changed (becomes less transparent, and in some cases, completely opaque). Is this a limitation of the format, or something to do with my 3ds files, or the settings?


A quick look at the relevant source code suggests that the opacity is explicitly copied from the 3ds model.
However, as I didn't author the underlying conversion code I'm not 100% sure what happens in the case of
mesh groups and other special cases.

rthorvald
Posts: 1223
Joined: 20.10.2003
With us: 21 years 1 month
Location: Norway

Re: CModTool 1.0 for OS X

Post #7by rthorvald » 14.06.2005, 15:50

dirkpitt wrote:A quick look at the relevant source code suggests that the opacity is explicitly copied from the 3ds model.


Hm... It might have been the models, or some wrong settings during export to 3ds. I have since managed to get it correct, exporting later iterations of the models. Thanks, though.

Another question: i have some files that won??t convert. I have localized the meshes in them that causes the problem, but can??t find out *why* they are problematic; there are no signs... And they do work correct as 3ds, both in Celestia and in several 3D apps. Is there any way to get some diagnostics information out of the CMOD tool? "Bad stuff happened" isn??t too helpful ;-)

- rthorvald

Avatar
Topic author
dirkpitt
Developer
Posts: 674
Joined: 24.10.2004
With us: 20 years 1 month

Re: CModTool 1.0 for OS X

Post #8by dirkpitt » 14.06.2005, 20:13

rthorvald wrote:Another question: i have some files that won??t convert. I have localized the meshes in them that causes the problem, but can??t find out *why* they are problematic; there are no signs... And they do work correct as 3ds, both in Celestia and in several 3D apps. Is there any way to get some diagnostics information out of the CMOD tool? "Bad stuff happened" isn??t too helpful ;-)


Sounds like a plan. I'll try to find some time to add a log window during the weekend.

ElChristou
Developer
Posts: 3776
Joined: 04.02.2005
With us: 19 years 9 months

Re: CModTool 1.0 for OS X

Post #9by ElChristou » 14.06.2005, 20:18

dirkpitt wrote:...Sounds like a plan. I'll try to find some time to add a log window during the weekend...


... :?
Image

ElChristou
Developer
Posts: 3776
Joined: 04.02.2005
With us: 19 years 9 months

Re: CModTool 1.0 for OS X

Post #10by ElChristou » 14.06.2005, 20:25

rthorvald wrote:...but can??t find out *why* they are problematic; there are no signs...


Somtime some very small problems (generally visibles by zooming at max) of wrong placements before boolean actions, mix up points without merging etc... can do all kind of "Bad stuff", even crash the file (after various works on small errors...). If you have a mesh as example, I can perhaps have a look on what's wrong...
Image

rthorvald
Posts: 1223
Joined: 20.10.2003
With us: 21 years 1 month
Location: Norway

Re: CModTool 1.0 for OS X

Post #11by rthorvald » 14.06.2005, 20:39

ElChristou wrote:If you have a mesh as example, I can perhaps have a look on what's wrong...


Thank you, but it would be better to learn how to find out... Else, i??m just as stuck next time...

So, how to isolate something that small in a mesh containing say 50.000 points?

-rthorvald

ElChristou
Developer
Posts: 3776
Joined: 04.02.2005
With us: 19 years 9 months

Re: CModTool 1.0 for OS X

Post #12by ElChristou » 14.06.2005, 20:49

rthorvald wrote:...So, how to isolate something that small in a mesh containing say 50.000 points?...


At this level, you have a big problem... (it's on your Titan scenery?)
You can try by cuting the problem in two, test both pieces, then recut the one with problem and so on... If there is lots of meshes, you can make groups and test... It's long but unfortunatly I don't have other solution without looking at the mesh...
Image

rthorvald
Posts: 1223
Joined: 20.10.2003
With us: 21 years 1 month
Location: Norway

Re: CModTool 1.0 for OS X

Post #13by rthorvald » 15.06.2005, 01:31

ElChristou wrote:You can try by cuting the problem in two, test both pieces, then recut the one with problem and so on... If there is lots of meshes, you can make groups and test...

Yes, this is what i did to narrow it down to a single mesh. Unfortunately, that one is a monster... I hoped anyone knew of a sort of diagnostics tool - well, have to slice it up then, i guess.

-rthorvald

Avatar
Topic author
dirkpitt
Developer
Posts: 674
Joined: 24.10.2004
With us: 20 years 1 month

Post #14by dirkpitt » 18.06.2005, 13:32

A new version of CModTool is available:

* Download CModTool 1.0.1

This version adds a log window (Window > Messages).

Avatar
Topic author
dirkpitt
Developer
Posts: 674
Joined: 24.10.2004
With us: 20 years 1 month

Post #15by dirkpitt » 08.10.2006, 08:06

I've finally updated CModTool with the latest versions of 3dstocmod and cmodfix:

* Download CModTool 1.0.3 (build 4)

Note: If you have downloaded an earlier build of 1.0.3 (check the About CModTool box... the new build downloaded from the above link should say "1.3.0 (4)"), you are strongly encouraged to upgrade to this new build.

Apart from being Universal and incorporating latest fixes from Chris for specular surfaces, this version should work with a lot more models than before. This is because previous versions would simply quit if they couldn't generate either normals or tangents for certain parts of a model; this build will not abort in such cases and continue to generate a valid model.

rthorvald
Posts: 1223
Joined: 20.10.2003
With us: 21 years 1 month
Location: Norway

Post #16by rthorvald » 18.10.2006, 10:08

Using the latest version [1.0.3 (4)], i get a weird error:

I get the dreaded "Bad stuff happened" error message on a mesh only by changing the UV mapping.

This is the outputted message:

Code: Select all

2006-10-18 12:06:09 +0200 Converting .3ds to .cmod...
Replacing /Users/rthorvald/Desktop/test.3ds
Group: #0, indices=3141
cmodfix(455) malloc: ***  Deallocation of a pointer not malloced: 0x205000; This could be a double free(), or free() called with the middle of an allocated block; Try setting enviroAn error occured while processing "/Users/rthorvald/Desktop/test.3ds". The file may be an unsupported format or corrupted.



Note that if i change the mapping to some other value (any other), the mesh goes through just fine.

- rthorvald
Image

Avatar
Topic author
dirkpitt
Developer
Posts: 674
Joined: 24.10.2004
With us: 20 years 1 month

Post #17by dirkpitt » 18.10.2006, 13:30

rthorvald wrote:Using the latest version [1.0.3 (4)], i get a weird error:

I get the dreaded "Bad stuff happened" error message on a mesh only by changing the UV mapping.

This is the outputted message:

Code: Select all

2006-10-18 12:06:09 +0200 Converting .3ds to .cmod...
Replacing /Users/rthorvald/Desktop/test.3ds
Group: #0, indices=3141
cmodfix(455) malloc: ***  Deallocation of a pointer not malloced: 0x205000; This could be a double free(), or free() called with the middle of an allocated block; Try setting enviroAn error occured while processing "/Users/rthorvald/Desktop/test.3ds". The file may be an unsupported format or corrupted.



Note that if i change the mapping to some other value (any other), the mesh goes through just fine.

- rthorvald


I'd like to reproduce this but this isn't enough information. Could you mail me the 3ds and let me know what settings you used?

rthorvald
Posts: 1223
Joined: 20.10.2003
With us: 21 years 1 month
Location: Norway

Post #18by rthorvald » 18.10.2006, 15:41

dirkpitt wrote:Could you mail me the 3ds and let me know what settings you used?


See PM.

- rthorvald
Image

Avatar
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Post #19by Cham » 18.10.2006, 17:15

Hmmm, I didn't encountered any problem with that version, yet. I'm doing *LOTS* of modeling these days, and I'm converting to CMOD about 20 times a day (mostly asteroids and test models). Everything works fine until now. I'm curious what may cause your problem, Runar. What options are you using, with the CMODTool ? I'm using all of them, except the last one (optimize triangle lists to strip, which gives weird results).
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

rthorvald
Posts: 1223
Joined: 20.10.2003
With us: 21 years 1 month
Location: Norway

Post #20by rthorvald » 18.10.2006, 17:37

Cham wrote:What options are you using, with the CMODTool ? I'm using all of them, except the last one (optimize triangle lists to strip, which gives weird results).


I used the first two and the last two.
... What weird behaviour do you get with the optimize triangle lists option?

- rthorvald
Image


Return to “Celestia Users”