CMP Import/export dll
-
Does this import the group names of a model or is it supposed to but doesn’t? It would be handy if it did tbh. If you have a model with a number of different group names and need to update the model for some reason, bit of a pain if you need to rename all the groups from scratch
-
This is one I’m uploading now is OK. The last one messed LODs for some reason. I can’t remember at the moment why.
Yes. If you have a multipart model, It will load it as such. You might see in the groups list in Milkshape several meshes with the same name. This just means all those meshes belong to the same group. Milkshape needs the different meshes in order to use different textures in the same group.
Is this what you needed to know? -
Thanks for the info but no, that’s not what i meant. When you load in the model, any group part is just called Root, if you’ve previously named each part of the model, part A. part B etc, then just curious why the importer doesn’t recognise the names. I have some bases with 20 or 30 parts, this means i have to rename them everytime if i need to edit them for some reason, or any other model for that matter. It recognises the different texture names but not the group parts
-
That’s exactly what I meant.
Let’s say you have a ship with four parts. You have,
Hull
Port_wing
Starboard_wing
TailSo when you import this, you’ll get.
Hull <mat: mat1=“”>Hull <mat: mat2=“”>Hull <mat: mat3=“”>Hull <mat: mat4=“”>Port_wing <mat: mat5=“”>Starboard_wing <mat: mat6=“”>Tail <mat: mat7=“”>Tail <mat: mat8=“”>Tail <mat: mat9=“”>It’s still four parts, but has nine meshes. When this gets exported, it will get exported with four parts.
However, if your model is a single model like most user models. Then that model will import as,
Root <mat: ??=“”>Root <mat: ??=“”>Root <mat: ??=“”>Root <mat: ??=“”>Root <mat: ??=“”>and so on.</mat:></mat:></mat:></mat:></mat:></mat:></mat:></mat:></mat:></mat:></mat:></mat:></mat:></mat:> -
Yes that’s it. So with regard to single mesh models, could it not read the part names as they are on the model instead of as i’ve already mentioned, having to rename all the parts everytime the model is edited?. Bear in mind some single group models can still have many parts
Ok, strange happenings. Imported a model to create a sur file with Smacks utility. Followed the tutorial on here somewhere, and when i looked at the created sur, it was backwards on the model. Model orientation seemed ok but sur was definately backwards. Tried again with the older 2.7 model importer and it was all fine, so i know the problem isn’t my end. Anyone else seen this? Also less vertices on the model were loaded into Lithunwrap than with the 2.7 version. Very odd.
-
I just noticed, that the importer crashes if I want to import the Rheinland Battleship. But it works with all other battleships.
Same for the RH Gunboat.
Tried it with different import settings. -
I have to admit, this exporter is great.
It just have one big missing element: Manual centering the multi parts! If I want to create the sur, the multi parts are moved a bit because they dont have the same poly count and the calculated center will be another.
So: Just a checkbox like “Manual Centering Groups?” is the missing thing for a perfect exporter!And belive me: Thats really a big problem for creating exact multi part ships!
-
@Skotty
Hi Skotty,When I modified the importer to import a model I got from Sushi, I inadvertantly changed the code that loads multiple vms models like the Rheinland Battleship. It’s since been repaired. I’m uploading my most recent dlls.
About centering the groups, I’m not sure I know what you mean. All the parts are centered at (0,0,0). Then their positions relative to the root part are saved in the connections node. I believe this is how the original models were set up. At anyrate, I’ll see what I can do.
-
There are different methods how you calculate the center point of a group.
Schmackbolzens method is calculating the center point by the dimensions of the object. You are calculating the center by the spread of all vertices.
-> Schmacki will write the exact problem and solution in a few minutes.Another problem: Your CMP Exporter also repositionates the Root mesh. I think some of the modelers, including me, are positioning their root meshes willfuly at another point than the exact caluclated mass center.
So please remove the adjustment of the rootSo far, your CMP importer and mainly the exporter are the greatest I’ve ever seen! With them modeling for Freelancer makes fun again!
-
What Skotty means is, that you use a different way to calculate the center. I would say you calculate the arithmetic average whereas you just should calculate the center of the bounding box. I have attached a screenshot from Skotty where you can see the problem. The gray mesh is the automatic centered multipart group by my obj -> sur converter and the colored one the one from your exporter. Since you use a different way to calculate the center they don’t overlap. This means that you would have to correct it either in your program or everyone will have to enter different center values into my converter which would be quite annoying I guess ^^.
P.S.: No, the new sur converter version is not released yet, Skotty has a prerelase version, which has some minor bugs left…
Remember to click “view image” or how your browser calls it since the image is cut thanks to this nice forum software ^^
-
@Schmackbolzen
Hi,I was just wondering, How did you calculate the bounding box?
I cycled through all the vertices of each part and took the two farthest away for each axis.Anyway, this dll uses the bounding box and doesn’t move the root mesh.
-
Thanks for the quick fix!
I just iterate through all vertices per group and look for the min and max values per axis. In the end you have 6 values (or 2 Vectors / Points) defining the bounding box. That should be the quickest way to do it. -
Perfect. Thanks P1p3r, the CMP Exporter exports my CMP now with perfect center coordinates. Schmackis SUR converter creates now in combination with your CMP exporter a really perfect ship.
Now the next and best generation of Freelancer ships can come! -
Amen!!
-
Geting a weird error when using this exporter seen here:
http://i113.photobucket.com/albums/n240/Alucard1_01/errordllexporter.png
Any ideas why it’s missing parts of the words used?
-
I just remembered, this only occurs when you first use the exporter. It uses the last filename for the VMeshLibrary.lod then replaces it when a new filename is selected. But if there was no last filename, it cannot replace it. This should be fixed soon.
-
Your radius calculation is wrong. If I use a box with the size 80x80m, your radius is just 40, but it would need to be 69,28 or a bit bigger (tolerance value).
Schmackbolzen will write how to solve the problem via vector calculation.