Problem loading .dmf

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
The Creator
Posts: 30
Joined: Wed Sep 10, 2008 9:04 pm

Problem loading .dmf

Post by The Creator »

I've made a really simple level in DeleD using 3ds meshes. I tried loading into irrlicht but i only see white, no errors just white.

I've created a "media" folder where i store the 3ds and their textures, but i've also noticed that to give a mesh a texture you made, you've to copy that texture in the DeleD texture directory.

Could it be a path problem? Because i've both the textures and the meshes in my media folder, which i use to load everything with irrlicht.
andrei25ni
Posts: 326
Joined: Wed Dec 14, 2005 10:08 pm

Post by andrei25ni »

you can open the .dmf file in Notepad, and check the paths of the textures (they are at the top of the file).
The Creator
Posts: 30
Joined: Wed Sep 10, 2008 9:04 pm

Post by The Creator »

Nope, it wasn't that.

Apparently, the scene is empty. It loads everything without problem, but the things i put in the scene in DeleD don't appear in the program.

Here is the code:
bool
draw::LEVEL::load(char * name,physics::INIT_PHYSICS *p_newt_manager, ISceneManager* pScene){


if(pScene->loadScene(name)){


//Physics
core::array<irr::scene::ISceneNode*> listProps;
pScene->getSceneNodesFromType(ESNT_MESH,listProps);

for(unsigned int i =0; i<listProps.size(); i++){

irr::newton::SBodyFromNode props_data;

props_data.Type=newton::E_BODY_TYPE::EBT_TREE;
props_data.Node= listProps;

scene::IMeshSceneNode* msn = (scene::IMeshSceneNode*)listProps;

props_data.Mesh=msn->getMesh();
props_data.BodyOffsetFromNode.setScale(core::vector3df(listProps->getScale()));


irr::newton::IBody *temp = p_newt_manager->getPhysicsWorld()->createBody(props_data);

char* s1 = (char*)listProps->getName();
char* s2 = "floor";

if(strcmp(s1,s2))
temp->setMaterial(p_newt_manager->getMaterial(MATERIALS_ID::LEVEL));

}
listProps.clear();

//add Camera
cam = pScene->addCameraSceneNode(0,core::vector3df(0,CAMERA_HEIGHT,0),core::vector3df(0,0,0.9f),-1);

cam->setAutomaticCulling(EAC_FRUSTUM_BOX);
cam->setFOV(core::degToRad(30.0f));
//cam->setAspectRatio(4.0f/3.0f);
cam->setFarValue(CAMERA_HEIGHT+1);
cam->setNearValue(50);

//Get Floor mesh
scene::IMeshSceneNode* msn = (scene::IMeshSceneNode*)pScene->getSceneNodeFromName("floor");
if(msn)
terrainSelector = pScene->createOctTreeTriangleSelector(msn->getMesh(),pScene->getSceneNodeFromName("floor"));


return true;
}
return false;
}


We were using .irr before, but since irredit sucks; we decided to use .dmf; perhaps they use different loading procedures for scenes and that is the problem.

Another problem might be the textures path, in the .irr scene we were using a media folder, so the path was "media/textures/blah.jpg", but with DeleD we can't create a folder like that, in fact i can't even delete the system folder from the my scene material editor.

We're using Irrlicht 1.5
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

For the path you may try

Code: Select all

SceneManager->getStringParameters()->setAttribute(scene::DMF_TEXTURE_PATH, "path/to/your/textures");
You cannot load a scene from dmf, only meshes. So use the getMesh code from the examples. This will put the whole scene of your dmf file into one object, though. Jus be aware of this fact.
The Creator
Posts: 30
Joined: Wed Sep 10, 2008 9:04 pm

Post by The Creator »

If i want to load scenes like the .irr we were using, what level editor would you recommend me?

Irredit sucks, it's crazy to use it if you can't ctrl+z properly. Deled was really cool to use, but since we want to put lights and stuff, i'd prefer to use a type of file that loads complete scenes and not only the meshes


Edit: is the .dxs the same as the .dmf or it does save the whole scene?
The Creator
Posts: 30
Joined: Wed Sep 10, 2008 9:04 pm

Post by The Creator »

It still doesn't work.

It's not the texture because we don't see any model at all, not even with the white default texture irrlicht uses.


Any more suggestions?
The Creator
Posts: 30
Joined: Wed Sep 10, 2008 9:04 pm

Post by The Creator »

Nobody has any idea what might be?

If someone could give an example of a level you made and the code you used to uploaded it to irrlicht, it would be most useful.
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

You neither gave the code you are now using, nor the file you try to load. We cannot help anymore until you do so.
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Post by serengeor »

maybe you should export it in other file format? :wink:
just a suggestion.
Working on game: Marrbles (Currently stopped).
The Creator
Posts: 30
Joined: Wed Sep 10, 2008 9:04 pm

Post by The Creator »

The code is some posts above.

I've uploaded the scene file with the objects and the textures:

http://www.sendspace.com/file/rxu7g4

One object is the lantern, the other one is the floor. The black texture is for the floor and the rust one for the stone lantern
hybrid
Admin
Posts: 14143
Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:

Post by hybrid »

The problem is that you use absolute texture paths. I've fixed the DMF loader to try even more paths in SVN/trunk. As a workaround in case you don't want to use that Irrlicht version you can simply edit the dmf files and remove the absolute path of the textures (i.e. everything up to media/textures...)
Post Reply