ent_create and .obj

Posted By: Reconnoiter

ent_create and .obj - 04/19/15 15:29

Hello,

I get an E1198: Bad file format error when trying to place a .obj through ent_create:

Code:
ent_create("Block.obj", nullvector, NULL);



while I can import it without problems in MED (with non-broken mesh etc.). The Block.obj is in the folder (its .mtl too if that helps) and was exported with the latest version of Blender.

Maybe it helps if I upload the file?

Thanks in advance.
Posted By: DLively

Re: ent_create and .obj - 04/19/15 15:49

Have you tried opening other .obj files at runtime with success..?
Posted By: Anonymous

Re: ent_create and .obj - 04/19/15 15:56

It has to be saved out of MED as a MDL
http://www.conitec.net/beta/fileformats.htm
http://www.conitec.net/beta/prog_mdlhmp.htm
Posted By: DLively

Re: ent_create and .obj - 04/19/15 16:05

Thats what I figured. Only MDL -- But I didn't want to say otherwise if he was actually getting success with other .obj models laugh
Posted By: Anonymous

Re: ent_create and .obj - 04/19/15 16:17

As a side note, not sure why you would want another file format, however if it is for consumers to customize, then remember that forcing them to get their models converted by you could be a added source of revenues.

anyway just a side note.
Posted By: Reconnoiter

Re: ent_create and .obj - 04/19/15 18:13

Hi Dlively and Malice,

Quote:
Have you tried opening other .obj files at runtime with success..?
, sadly no. I have tried .obj exported by Blender (several ones) and by photoshop (3D layer, really buggy but funny grin ). I can try some more, but MED does import them so the .obj except for the photoshop ones seem to be perfectly fine.

The manual says that ent_create should be possible with .obj:
Quote:
The following file formats are supported: wmb (map entities), hmp (terrain), mdl, x, obj (models), tga, pcx, bmp, dds (sprites). Note that some formats have restrictions, f.i. the obj format requires loading the skin through ent_setskin, and the compressed dds format offers no access to single pixels of the bitmap. A cache with hash function is used for storing the file when it was already loaded before; for this, file names must not exceed 30 characters.


Quote:
As a side note, not sure why you would want another file format, however if it is for consumers to customize, then remember that forcing them to get their models converted by you could be a added source of revenues.

anyway just a side note.
, yes it is for users to customize. You bring up an interesting point however, thanks for that. Though in this case I want it load obj directly.
Posted By: DLively

Re: ent_create and .obj - 04/19/15 20:27

nice idea laugh what if you imported it to med from obj, and re-exported back to obj. see if that makes a difference?
Posted By: Reconnoiter

Re: ent_create and .obj - 04/20/15 10:08

It looks like MED doesn't has an export to .obj format though, only import (could be I am overlooking it though, there is some stuff of exporting it too ASC [text format] though).

Anyway since .obj is so easy to export to with almost every program, I think an ent_create with .obj would be a very nice feature to have (even though it is limited to non-animated models I think).

I also saw that ent_create should be able to place .x models (direct x format), which would also be interesting but to a lesser degree since it is more difficult to export to than .obj. I have found this nice little website though where one can import many model formats and export them to some (.x included but sadly not .mdl). Though the ent_create did not work too with the .x format. So perhaps I am just doing something wrong? I will try to export .obj with some other programs and see how that works.
Posted By: Reconnoiter

Re: ent_create and .obj - 04/21/15 20:10

Exported models from Sketchup as .obj also gives bad file format error.
It seems like .obj does not work with ent_create, in contrary to what the manual says frown .
Posted By: 3run

Re: ent_create and .obj - 04/22/15 06:02

I'm not sure, but just make sure that your skins is power of two 256x256, or 512x512 - try it just for testing purpose, cause I remember facing 'bad file format' and problem was related to the skin. Additional it might be that skin is 8bit, change it to 24 in MED under skin settings, and it even might be that skin doesn't use RGB but something called Index (I've faced it with skins and textures from some older games). I'm not sure that this will help, but I just wanted to share my experience with this error message.

greets
Posted By: jcl

Re: ent_create and .obj - 04/22/15 11:21

The skin must not be indexed, but normal 24 bit RGB. However there is no real .obj standard - there are many variants. If in doubt, export the file in a standard format such as FBX, and convert it to .mdl.
Posted By: Reconnoiter

Re: ent_create and .obj - 04/22/15 12:54

Yes I finally got it working with Blender laugh , thanks so much jcl and 3run for helping to get me on the right track.
In short; the problem was that the model got exported with a material attached to it.
I will make a short guide for this cause I think this could be handy for others too. I will post a link to it here soon.

Now I still need to figure out how to disable exporting materials with Google Sketchup. And probably with some other often used programs.
found the solution laugh (will put it in the guide)

guide link
© 2024 lite-C Forums