Page 1 of 1
ascii cmod models broken
Posted: 14.02.2010, 15:38
by Boux
Since svn revision 496x, ascii cmod models are no longer rendered properly.
Most noticeable symptoms are missing textures or texture corruption.
Once models are converted to binary format, they are rendered as they should be.
Looks like something got broken when those massive code changes were made two weeks ago.
Did anyone else noticed?
Re: ascii cmod models broken
Posted: 14.02.2010, 20:46
by selden
Boux,
Can you provide a simple example (ssc,model & texture) ?
The example I thought I had seems to be failing with both 1.6.0 and the latest svn build.
I'm sure used to work for v1.6.0, so I'm not at all sure what has happened to it
Re: ascii cmod models broken
Posted: 15.02.2010, 03:08
by Joe
The "trilist" sections for the meshes in the cmod model file do not exist any more. They should be there to define the mesh surfaces.
Re: ascii cmod models broken
Posted: 15.02.2010, 19:27
by selden
Joe,
Your comment is ambiguous.
What model files are you referring to?
Or do you mean that the ASCII interpreter for cmod files no longer recognizes "trilist" ?
Re: ascii cmod models broken
Posted: 16.02.2010, 00:08
by chris
If you're seeing a problem with ASCII cmod files, then it's likely that it was caused by my checkin two weeks ago. However, I've seen no problems so far with loading ASCII models, and I've tried quite a few. If anyone can provide me with an ASCII cmod file that's not loading correctly, I should be able to debug the problem very quickly.
--Chris
Re: ascii cmod models broken
Posted: 16.02.2010, 03:07
by Joe
selden,
What i did was as follows:
I created a box in 3D MAX 9.0 (just a simple 6-face box, no texture and surface features) and saved it in 3ds format as box.3ds.
Then I did the conversion with
3dstocmod box.3ds > box.cmod
This was I got for box.cmod, it seems that 3dstocmod rejected the trilist section from my box.cmod.
Code: Select all
#celmodel__ascii
mesh
#"Box01"
vertexdesc
position f3
normal f3
texcoord0 f2
end_vertexdesc
vertices 36
-19.684 -29.5266 0.001 0 0 -1 1 -0
-19.684 29.5286 0.001 0 0 -1 1 -1
19.686 29.5286 0.001 0 0 -1 0 -1
19.686 29.5286 0.001 0 0 -1 0 -1
19.686 -29.5266 0.001 0 0 -1 0 -0
-19.684 -29.5266 0.001 0 0 -1 1 -0
-19.684 -29.5266 7.87502 0 0 1 0 -0
19.686 -29.5266 7.87502 0 0 1 1 -0
19.686 29.5286 7.87502 0 0 1 1 -1
19.686 29.5286 7.87502 0 0 1 1 -1
-19.684 29.5286 7.87502 0 0 1 0 -1
-19.684 -29.5266 7.87502 0 0 1 0 -0
-19.684 -29.5266 0.001 0 -1 0 0 -0
19.686 -29.5266 0.001 0 -1 0 1 -0
19.686 -29.5266 7.87502 0 -1 0 1 -1
19.686 -29.5266 7.87502 0 -1 0 1 -1
-19.684 -29.5266 7.87502 0 -1 0 0 -1
-19.684 -29.5266 0.001 0 -1 0 0 -0
19.686 -29.5266 0.001 1 0 0 0 -0
19.686 29.5286 0.001 1 0 0 1 -0
19.686 29.5286 7.87502 1 0 0 1 -1
19.686 29.5286 7.87502 1 0 0 1 -1
19.686 -29.5266 7.87502 1 0 0 0 -1
19.686 -29.5266 0.001 1 0 0 0 -0
19.686 29.5286 0.001 0 1 0 0 -0
-19.684 29.5286 0.001 0 1 0 1 -0
-19.684 29.5286 7.87502 0 1 0 1 -1
-19.684 29.5286 7.87502 0 1 0 1 -1
19.686 29.5286 7.87502 0 1 0 0 -1
19.686 29.5286 0.001 0 1 0 0 -0
-19.684 29.5286 0.001 -1 0 0 0 -0
-19.684 -29.5266 0.001 -1 0 0 1 -0
-19.684 -29.5266 7.87502 -1 0 0 1 -1
-19.684 -29.5266 7.87502 -1 0 0 1 -1
-19.684 29.5286 7.87502 -1 0 0 0 -1
-19.684 29.5286 0.001 -1 0 0 0 -0
end_mesh
Re: ascii cmod models broken
Posted: 16.02.2010, 03:33
by Joe
Just tested with amalthea.3ds:
3dstocmod amalthea.3ds > amalthea.cmod
amalthea.cmod did not show the trilist section either. But I tested with another 3DS model skylab.3ds, strangely the trilist section appeared in skylab.cmod. I guess 3dstocmod is now "picky" for 3DS models, but it never behaved as such before svn revision 496x.
Re: ascii cmod models broken
Posted: 16.02.2010, 07:49
by chris
Joe wrote:Just tested with amalthea.3ds:
3dstocmod amalthea.3ds > amalthea.cmod
Thanks! I've been able to reproduce the problem. The new code doesn't work for 3ds files that don't have any materials defined. I didn't realize that this was even legal (there doesn't seem to be any official documentation for the 3ds file format.) I'll have a fix ready soon.
--Chris
Re: ascii cmod models broken
Posted: 16.02.2010, 19:37
by chris
SVN revision 4973 fixes the problem for 3dstocmod and cmodview. I still need to fix Celestia itself, which at this point uses different code to convert 3ds files (something I intend to address soon.)
--Chris
Re: ascii cmod models broken
Posted: 17.02.2010, 09:20
by Boux
Here is an example of what is happening:
http://www.quickfixcomm.fr/Celestia/mw-msx.7zIt is a small add-on by Selden.
The zip provide models in cmod ascii, cmod bin and 3ds for reference.
The bug happens with any ascii cmod model (I have dozens of them, all broken!).
Really nasty.
Re: ascii cmod models broken
Posted: 17.02.2010, 12:17
by Joe
Chris,
3dstocmod (code from SVN revision 4973) gets a hold when I tried it on a Windows XP.
Re: ascii cmod models broken
Posted: 17.02.2010, 15:48
by chris
Boux wrote:Here is an example of what is happening:
http://www.quickfixcomm.fr/Celestia/mw-msx.7zIt is a small add-on by Selden.
The zip provide models in cmod ascii, cmod bin and 3ds for reference.
The bug happens with any ascii cmod model (I have dozens of them, all broken!).
Really nasty.
Thanks, Boux. I used this model to find and fix the bug (a one-liner) in SVN revision 4976.
The bug affected ASCII cmod files with textures, and only in Celestia, not the cmodview tool that I'd been using to test a lot of cmod files.
--Chris
Re: ascii cmod models broken
Posted: 17.02.2010, 16:12
by Boux
Thanks, Chris.
Just built 4976 and everything is back to normal
PS: thanks Selden for the sphere model with inward normals. Very useful for many add-ons!
Re: ascii cmod models broken
Posted: 23.02.2010, 03:51
by Joe
Hi,
Anyone has a copy of WIN32 3dstocmod tool compiled from SVN revision 4973? I cannot make it work, it holds everytime I run it.
Re: ascii cmod models broken
Posted: 23.02.2010, 04:41
by chris
Joe wrote:Hi,
Anyone has a copy of WIN32 3dstocmod tool compiled from SVN revision 4973? I cannot make it work, it holds everytime I run it.
I'll build a new version of this as soon as I can... You might want to try out the new cmodview utility. cmodview is a GUI app which can preview, convert, and perform basic operations on 3D file types supported by Celestia. Here's the link for Windows:
http://www.celestiaproject.net/~claurel/celest ... -win32.zipAnd the Mac version:
http://www.celestiaproject.net/~claurel/celest ... odview.dmgThere's no installer for the Windows version. The zip archive just contains the EXE and required libraries.
--Chris
Re: ascii cmod models broken
Posted: 23.02.2010, 18:21
by Fenerit
Thanks! Just FYI, no particular issues with 4973, CMOD models that I use doesn't have problems. Thanks to Vincent also for the locations patch.
Re: ascii cmod models broken
Posted: 23.02.2010, 19:31
by Fenerit
Just a question: does the "change base texture" buttons are work-in-progress features ? They doesn't open the file selection... I tried to extract the cmodview both in /celestia/ and /extras. All the rest work perfecly but that buttons doesn't seems to work... (Windows system)
Re: ascii cmod models broken
Posted: 23.02.2010, 22:10
by chris
Fenerit wrote:Just a question: does the "change base texture" buttons are work-in-progress features ? They doesn't open the file selection... I tried to extract the cmodview both in /celestia/ and /extras. All the rest work perfecly but that buttons doesn't seems to work... (Windows system)
Right--those buttons are not hooked up yet. Soon!
--Chris
Re: ascii cmod models broken
Posted: 23.02.2010, 22:55
by Fenerit
Never mind: happy to wait for that. However, although not yet tested, the OBJ to CMOD option is GREAT and was one of my personal Celestia's features request, so I wish to express my gratitude. THANKS!!!
Re: ascii cmod models broken
Posted: 24.02.2010, 03:22
by chris
I've uploaded a new version of cmodview that has texture editing enabled. I'll be posting a lot more information about cmodview in the Utilities section of the forum.
--Chris