Getting .nxs files

aspilicious

20-02-2011 15:07:55

Hi all,

I have a new question. I am trying to convert a model into a nxs file with 3DS studio max (student version). I'm not a designer so I just took a model from the net.
I found some nvidia physx software for studio 3ds max. I found an export option, but the options I get are: .xml, .nxb and .dae.

After looking around on the forum I found the link to an xml => flower tool. (http://nxogre.org/flowerconverter)
But that doesn't work with the xml files the plugin produces.

Any tips?

betajaen

20-02-2011 15:54:47

NxOgre uses it's own fileformat (.flower) to convert into .nxs file. If you can save it as a ogre .mesh.xml file, then you can convert it into .flower form online at http://nxogre.org/flowerconverter

Othewise you can try exporting as any of those filetypes, NxOgre won't read them, but 3DSMax may of made a .nxs file which it can read.

aspilicious

20-02-2011 18:10:16

After some reading, I installed an ogre exporter tool (http://www.ogremax.com/downloads) but I only can export the model as a .mesh/.material and those are not xml files =)...
How can I export models to .mesh.xml ??

betajaen

20-02-2011 18:38:23

.mesh.xml is the intermediary file format from your modeller to an ogre mesh. There should be some exporter somewhere that does it.

aspilicious

20-02-2011 19:47:41

Well I had to download a converter tool...
Couldn't find a exporter for 3ds max 2011.

So I got my .mesh.xml files...
Now I'm still confused...

1) I fail at compiling flour in visual studio 2010

Got some errors:
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error MSB3073: The command "..\VC.postbuild.final.bat Flour Final
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(113,5): error MSB3073: :VCEnd" exited with code 2.


Well it makes an .exe but i get the following error while running flour test:

C:\flour\build\vc10\Flour\Final>flour test
* Creating World

=====================================================================
No PhysX System Software (World)
=====================================================================

The PhysX System Software has not been installed.
From: ..\source\NxOgreWorld.cpp#74

=====================================================================


Exception Called.

C:\flour\build\vc10\Flour\Final>


But the biggest question I have is why we need to go through all this effort. If I look at the sample code it uses plain.mesh files...

mBody = mRenderSystem->createBody(NxOgre::BoxDescription(1,1,1), NxOgre::Vec3(0,5,0), "cube.1m.mesh", bodyDescription);

betajaen

20-02-2011 19:57:57

If your creating boxes/spheres/wheels/capsules/planes you don't need .nxs files. NXS files are only used for triangle meshes and convexes which can't be described using a primitive. That mesh your using there is the Actor/Body being shown on the screen, it has no bearing on what the physics simulation is like.

You don't need to compile flour, there is an executable provided.

aspilicious

20-02-2011 20:41:57

Ok found the executable, works.
I tried the web based solution but my test model was a bit to heavy so it crashes :p.

So I installed ruby and that worked...

thnx for all the help

betajaen

20-02-2011 20:56:37

I'm going to improve on that script in the future. In fact the plan is once LeJean is (nearly) completed and Linux compatible, I want to put Flour on that website, it can convert some types of files to nxs online.

dronbas

02-03-2011 12:58:47

I suppose any newcomer faces this problem. I also tried flour but without success. So my way to create nxs files:
1. Decompose mesh into simple meshes (detach) if the mesh is complex. For example decompose a cup into handle and a cup itself. Export these meshes into obj format.
2. Then use convexdecomposition utility (which takes obj file, and parameters and generates obj files with convex bodies, which approximate the initial mesh). *
3. Import the convex bodies in 3dsmax (actually i use Maya) and look whether they are ok.
4. If the convex bodies are not ok (may be you need more precise approximation) then you can vary parameters of convexdecomposition utility and go to 2.
5. You can also paint convex bodies by yourself ( or modify the results of the convexdecomposition utility) - sometimes it is easier. For example create a cube and move its vertices, then may be duplicate this cube.
6. When you have one or several convex bodies which wrap the initial mesh you can export them into .mesh file. Then batch rename them (in Total Commander for example). So you get for example myConvex_0.mesh, myConvex_1.mesh ...
7. Convert .mesh to .nxs. This can be done using Critter. **
8. Finally when you create a body you use all the nxs files.

* actually you can download 3dsmax recent sdk and compile a plugin which can be found near convexdecomposition (I did it for max 2009), then you will have a button in 3dsmax which will decompose a mesh into convex meshes (so you avoid steps 2,3).
I also had to modify convexdecomposition utility slightly so it writes convex bodies to different obj files.

** I wrote a simple utility, which initializes Ogre, and takes as input a list of .mesh files, then for each file it does the following
Ogre::MeshPtr mesh = Ogre::MeshManager::getSingleton().load(meshFile + ".mesh", "Media");
MeshData *NxMeshData = Critter::MeshFunctions::read(mesh);
NxMeshData->mType = MeshType_Convex;
NxMeshData->cook("file://" + meshFile + ".nxs");
delete NxMeshData;


Hi all,

I have a new question. I am trying to convert a model into a nxs file with 3DS studio max (student version). I'm not a designer so I just took a model from the net.
I found some nvidia physx software for studio 3ds max. I found an export option, but the options I get are: .xml, .nxb and .dae.

After looking around on the forum I found the link to an xml => flower tool. (http://nxogre.org/flowerconverter)
But that doesn't work with the xml files the plugin produces.

Any tips?