NLMISC::CIFile

Added by wangxuan2730 almost 4 years ago

In my own project, there isn't a class(CIFile) in NLMISC namespace!

Why? I have used the lib needed, How to do it?


Replies (12)

RE: NLMISC::CIFile - Added by kervala almost 4 years ago

In C++, you need to include a header before using a class.

I suppose this should be enough :

#include <nel/misc/file.h>

RE: NLMISC::CIFile - Added by wangxuan2730 almost 4 years ago

NO, I must know this method, It doesn't run...

And ,I found that when I typed NLISC:: which there isn't a CIFile .

So what's wrong?

RE: NLMISC::CIFile - Added by wangxuan2730 almost 4 years ago

I want to write my own method to simulate the function(LoadMesh() in Object_viewer), But I can't find the CIFile function in NLMISC in my own project.

RE: NLMISC::CIFile - Added by wangxuan2730 almost 4 years ago

I have got the resource about the ryzom character.shape . But the character are apart, I'm looking for the method to combine them.

So I find the method in Object_Viewer, Or Do you have any better way to do it?

I'm so diffused on it for weeks, So giving me some suggestions.

RE: NLMISC::CIFile - Added by kervala almost 4 years ago

Sorry, I don't understand you :(

RE: NLMISC::CIFile - Added by wangxuan2730 almost 4 years ago

eg: I have some resource:
Character3DSetup::Character3DSetup() {
// the filename of the skeleton
Skeleton = "ZO_HOF_skel.skel";
// the filename of the parts of the character
Parts[CharPart_Chest].Name = "ZO_HOF_underwear_gilet.shape";
Parts[CharPart_Legs].Name = "ZO_HOF_underwear_pantabottes.shape";
Parts[CharPart_Arms].Name = "ZO_HOF_civil01_armpad.shape";
Parts[CharPart_Feet].Name = "ZO_HOF_civil01_bottes.shape";
Parts[CharPart_Face].Name = "ZO_HOF_visage.shape";
Parts[CharPart_Head].Name = "ZO_HOF_cheveux_short01.shape";
Parts[CharPart_Hands].Name = "ZO_HOF_armor01_hand.shape";
}

How to combine these shapes to an character?

RE: NLMISC::CIFile - Added by wangxuan2730 almost 4 years ago

also the character can animate the animations. I'm sorry about my poor English!!!

My meaning is : Using the Object_viewer can open some shape files, and can combine these shapes to an character,  I want to do it on my own project on NeL.

RE: NLMISC::CIFile - Added by kervala almost 4 years ago

Why do you talk about NLMISC::CIFile ?

About your skeleton problem, you have to use :

 1UScene *scene = Driver->createScene(true);
 2
 3UInstance inst1 = scene->createInstance("ZO_HOF_underwear_gilet.shape");
 4UInstance inst2 = scene->createInstance("ZO_HOF_underwear_pantabottes.shape");
 5...
 6
 7USkeleton skel = scene->createSkeleton("ZO_HOF_skel.skel");
 8skel.bindSkin(inst1);
 9skel.bindSkin(inst2);
10...

You should look at Object Viewer or Snowballs code :)

RE: NLMISC::CIFile - Added by wangxuan2730 almost 4 years ago

I have read these code. In Object_viewer, the function LoadMesh() have used NLMISC::CIFile.

I'll try to use your method.

RE: NLMISC::CIFile - Added by wangxuan2730 almost 4 years ago

Thank you. Now I have resolve the problem, but the character animation isn't on my control direction.

But the NLMISC::CIFile is still a problem.

RE: NLMISC::CIFile - Added by kervala almost 4 years ago

You know why ?

Object Viewer (the old one, the one using MFC), is very old, obsolete, using old code and doesn't use the U* classes which are helpers.

You should have a look at the NEW Object Viewer in "object_viewer_qt" folder, you'll see the easy method to load shapes and skeletons is using U* classes (UInstance, USkeleton, etc...). U* classes are even used in Ryzom.

In this case, NLMISC::CIFile is used to open a file and then deserialize it manually, UInstance and USkeleton are deserializing files automatically.

RE: NLMISC::CIFile - Added by wangxuan2730 almost 4 years ago

Oh no!! thank you for your reminding, I don't know the Object_viewer on mfc is the old one.

Now there is a problem is that half of the character under the terrain .

(1-12/12)