New here!

Get help with installing and running the Cafu Engine here. This forum is also for general questions and discussion of all aspects regarding the Cafu Engine.
User avatar
Thrawn
Posts: 302
Joined: 2004-08-30, 10:38
Location: NRW, Germany
Contact:

Post by Thrawn » 2006-04-18, 01:03

Blender works well both with ase and md5 :)

Your problem could be caused by different reasons (I went through all of them XD):

- Your materials are not assigned right (wrong names in the model/wrong cmat entrys, wrong texture sizes)

- your model is not scaled right

- when exporting, you did not select the model parts so they weren't exported

- CaWE paths are not right (preferences or ?model path?)
Image
Sindwiller
Posts: 108
Joined: 2006-04-14, 21:11
Location: Zürich, Switzerland

Post by Sindwiller » 2006-04-18, 13:02

I have the right Model Path and the right Mod Path. But it doesnt work :( .
- Your materials are not assigned right (wrong names in the model/wrong cmat entrys, wrong texture sizes)

- your model is not scaled right
I dont know what you mean :roll: , can you explain me that? I dont use Blender as the main modeler.
(You don't happen to be a programmer, do you?)
I'm one ;) but i'm a complete novice.

Wfr, Sindwiller
User avatar
Thrawn
Posts: 302
Joined: 2004-08-30, 10:38
Location: NRW, Germany
Contact:

Post by Thrawn » 2006-04-18, 13:25

To be honest, I didn't yet work out either where to put the right paths names in blender to name the model parts :?

I export the models with Blender to ase and reassign the model part names with another program so they do work. As I know this problem, I'm sure that this also the prob in your case.

I can offer you to modify your ase model and send you the thing back so you can compare them - like this you might figer out what to do so they work in future ;)
Image
Sindwiller
Posts: 108
Joined: 2006-04-14, 21:11
Location: Zürich, Switzerland

Post by Sindwiller » 2006-04-18, 13:52

http://rapidshare.de/files/18305478/blah.zip.html

Here is the model, .dmf, .obj and .ase.

Wfr, Sindwiller
User avatar
Thrawn
Posts: 302
Joined: 2004-08-30, 10:38
Location: NRW, Germany
Contact:

Post by Thrawn » 2006-04-18, 14:56

Ok, this is a bit more complicated. I messed quite a bit around with Blender and it is a bit crappy (when it comes to naming materials), i didn't succeed in exporting a model right so it works ingame because I can't figure out how to configurate it so it works. The rest works just fine.

Anyway, it can be fixed with the good old text editor :D

First of all:
Read this tutorial! It tells you exactly what to do to create a static ase model.

Step 3: Prepare your model is exactly the point where your exporting fails. (You can download the example files at the bottom of the tut to have a closer look at them.)

Ok, let's have a look at your ase file to show you the prob (it can be opened with the text editor).

Line 12-13

Code: Select all

*MATERIAL_LIST {
	*MATERIAL_COUNT 0
}
You did not assign any materials to your model. Like this, the textures don't get loaded. If you compare this Material information part with one of a well working ase model, you'll see the difference. Here is the material information part of the tutorial model:

Code: Select all

*MATERIAL_LIST {
	*MATERIAL_COUNT 1
	*MATERIAL 0 {
		*MATERIAL_NAME "Models/Static/tutorial-model/box"
		*MATERIAL_CLASS "Standard"
		*MATERIAL_AMBIENT 0.5000	0.5000	0.5000
		*MATERIAL_DIFFUSE 1.0000	1.0000	1.0000
		*MATERIAL_SPECULAR 0.0000	0.0000	0.0000
		*MATERIAL_SHINE 0.7813
	}
}
There, 1 material is declared. The most important part of it is the line

Code: Select all

      *MATERIAL_NAME "Models/Static/tutorial-model/box" 
The material that is assigned to the model has to have the exact name as the first line in your cmat shader file:

Code: Select all

Models/Static/tutorial-model/box <- texture path/name
{
diffusemap Models/Static/djcrate03_diff.png <- diffuse texture path
normalmap Models/Static/djcrate03_norm.png <- normal map path

red ambientLightRed
green ambientLightGreen
blue ambientLightBlue
}
____________________________________________________

OK. Now, enough theory, let's manipulate your pipe01.ase file so it should work.

First of all, you need to change

Code: Select all

}
*MATERIAL_LIST {
   *MATERIAL_COUNT 0
}
to something like

Code: Select all

*MATERIAL_LIST {
   *MATERIAL_COUNT 1
   *MATERIAL 0 {
      *MATERIAL_NAME "Models/Static/tutorial-model/box"
      *MATERIAL_CLASS "Standard"
      *MATERIAL_AMBIENT 0.5000   0.5000   0.5000
      *MATERIAL_DIFFUSE 1.0000   1.0000   1.0000
      *MATERIAL_SPECULAR 0.0000   0.0000   0.0000
      *MATERIAL_SHINE 0.7813
   }
}

As you can see, the material is *MATERIAL 0 .

The only thing that is now left to do (sadly quite some work) is to assign this material to all your faces (polygons) of your model.

In pipe01.ase, this material assignment begins in line 747 and looks like this:

Code: Select all

		*MESH_FACE_LIST {
			*MESH_FACE    0:    A:  172 B:  113 C:   73 AB:    1 BC:    1 CA:    1 *MESH_SMOOTHING 0   *MESH_MTLID 0
			*MESH_FACE    1:    A:  172 B:   73 C:   99 AB:    1 BC:    1 CA:    1 *MESH_SMOOTHING 0   *MESH_MTLID 0
			*MESH_FACE    2:    A:  113 B:  119 C:   76 AB:    1 BC:    1 CA:    1 *MESH_SMOOTHING 0   *MESH_MTLID 0
			*MESH_FACE    3:    A:  113 B:   76 C:   73 AB:    1 BC:    1 CA:    1 *MESH_SMOOTHING 0   *MESH_MTLID 0
blabla
bla continues
}
Important there is *MESH_MTLID 0. MESH_MTLID 0 = Mesh Material ID 0. It is luck that it already is assigned to the material with the number 0 (remember *MATERIAL 0 { at the beginning of the file ;) ) so you won't have to do this manually. So everything is well assigned there.

If you sucessfully changed the material information part and your cmat shader file is right it should work and you should be able to see your model ingame.

I hope I managed to help you with this. :)
Image
Sindwiller
Posts: 108
Joined: 2006-04-14, 21:11
Location: Zürich, Switzerland

Post by Sindwiller » 2006-04-18, 20:48

Now, the model viewer and the engine crashes when i want to load my model :shock: .

My .cmat (in Static):

Code: Select all

Models/Static/pipe01/system
{
   diffusemap Models/Static/system.bmp

    red   ambientLightRed
    green ambientLightGreen
    blue  ambientLightBlue
}
Material in .ase:

Code: Select all

*MATERIAL_LIST {
   *MATERIAL_COUNT 1
   *MATERIAL 0 {
      *MATERIAL_NAME "Models/Static/pipe01/system"
      *MATERIAL_CLASS "Standard"
      *MATERIAL_AMBIENT 0.5000   0.5000   0.5000
      *MATERIAL_DIFFUSE 1.0000   1.0000   1.0000
      *MATERIAL_SPECULAR 0.0000   0.0000   0.0000
      *MATERIAL_SHINE 0.7813
   }
}
Wfr, Sindwiller
User avatar
Kai
Posts: 177
Joined: 2004-08-19, 15:56
Location: Germany
Contact:

Post by Kai » 2006-04-18, 21:32

Hmm sounds like a small error ..

Some ideas:
- We should add a default texture to the model viewer, that is used when no material is assigned (fallback material)

-A clear overview of what entries are required for a conversion. For example im sure there is no use for "specular" and "shine" parameters.
I have no experience with blender.. Thrawn could you test, what parameters a required and which one can be deleted.

This would help to prevent errors and nail down possible errors.
User avatar
Thrawn
Posts: 302
Joined: 2004-08-30, 10:38
Location: NRW, Germany
Contact:

Post by Thrawn » 2006-04-18, 21:46

Well those entries do not cause the problems, I'm sure Ca3DE don't uses them anyway like informations about scenes etc.

I played a lot with the pipe01.ase model and I have to admit that I have no clue why the model viewer crashes. There must be an error somewhere else, but it doesn't have to do with the materials.

And it's not a fault of the blender export plugin either in general, I just exported my ak47 sucessfully yesterday.

Don't know, maybe you should first try to export something simple, like a box or something. Maybe I get your model anyway to work, I'll keep you up to date.
Image
Sindwiller
Posts: 108
Joined: 2006-04-14, 21:11
Location: Zürich, Switzerland

Post by Sindwiller » 2006-04-18, 22:05

Thanks. And im using Blender only for importing OBJ and exporting them into ASE. So im not using any scene paramters or materials from Blender.

Maybe i could ask our local Plugin Dev in the delgine community :D .

Wfr, Sindwiller
User avatar
Carsten
Site Admin
Posts: 2160
Joined: 2004-08-19, 13:46
Location: Germany
Contact:

Post by Carsten » 2006-04-18, 22:37

Kai wrote:Hmm sounds like a small error ..
Yes. ;)
- We should add a default texture to the model viewer, that is used when no material is assigned (fallback material)
Okay, I can do that, but what does it help? It probably just mildens the shock a little, seeing something is probably better than not seeing anything at all... ;)
-A clear overview of what entries are required for a conversion. For example im sure there is no use for "specular" and "shine" parameters.
I have no experience with blender.. Thrawn could you test, what parameters a required and which one can be deleted.
You're right, there is no need for the specular and shine params. Ideally, the ase importer in Ca3DE should be able to ignore unknown parameters, although they indeed may be able to confuse the loading code enough to produce a crash.
Best regards,
Carsten
User avatar
Carsten
Site Admin
Posts: 2160
Joined: 2004-08-19, 13:46
Location: Germany
Contact:

Post by Carsten » 2006-04-18, 22:39

Sindwiller, please send me your latest ase file that makes the ModelViewer crash - I'll then figure out the reason!
Sindwiller wrote:Maybe i could ask our local Plugin Dev in the delgine community :D .
That's certainly a good idea! :)
Best regards,
Carsten
User avatar
Carsten
Site Admin
Posts: 2160
Joined: 2004-08-19, 13:46
Location: Germany
Contact:

Post by Carsten » 2006-04-18, 22:53

Oh, and my email address is CarstenFuchs at T-Online.de ;)
Best regards,
Carsten
User avatar
Thrawn
Posts: 302
Joined: 2004-08-30, 10:38
Location: NRW, Germany
Contact:

Post by Thrawn » 2006-04-18, 23:43

Carsten, don't you like the edit button? :twist:
Image
User avatar
Carsten
Site Admin
Posts: 2160
Joined: 2004-08-19, 13:46
Location: Germany
Contact:

Post by Carsten » 2006-04-19, 10:39

:hiding: right... :oops:
Best regards,
Carsten
Sindwiller
Posts: 108
Joined: 2006-04-14, 21:11
Location: Zürich, Switzerland

Post by Sindwiller » 2006-04-19, 12:11

Carsten wrote::hiding: right... :oops:
And i dont like E-Mails (because my Windows Thunderbird cannot send emails and sending only works on Linux Evolution).

http://rapidshare.de/files/18389687/blah.zip.html

Wfr, Sindwiller
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests