News:

 

Topic: Nvil is slow.  (Read 16873 times)

0 Members and 2 Guests are viewing this topic.

  • No avatar
  • Posts: 2101
  • Polygon
April 24, 2014, 10:46:03 am
Yes, when writing into file, they are merged into one mesh.
So I will ask yet again. Why do you merge all objects when exporting to .obj?


  • No avatar
  • Posts: 3710
  • Developer
  • Administrator
  • Polygon
April 24, 2014, 11:20:21 am
Seems you misunderstand. On the object side, there maybe multiple meshes, on the file side one obj file only holds a mesh. So when writing, data are read from meshes and written into file which is one mesh. That's why I called it merge. It is not merging into one mesh before write to file.

  • No avatar
  • Posts: 2101
  • Polygon
April 24, 2014, 12:02:28 pm
Seems you misunderstand.
No. It appears you do not understand.
Quote
On the object side, there maybe multiple meshes,
Yes, each object can be a single mesh, or have multiple mesh.
Quote
on the file side one obj file only holds a mesh.
It looks like you do not understand the .obj format, and how it can have multiple objects.

Quote
So when writing, data are read from meshes and written into file which is one mesh. That's why I called it merge. It is not merging into one mesh before write to file.
The result is the merging of all mesh into one object within the .obj file, That is what I am asking. Why do you merge all mesh.

.obj file can contain multiple objects, they are flagged either by "o"(object) or by "g" group, which are placed into the vertex list.
You place all vertex into one group, which equals one object/mesh, which is incorrect. Polygon groups can be placed in the face groups.
What you do is ignore the fact there are multiple objects in a scene, then give an option (in the .obj exporter) to divide the mesh into polygon groups (one polygon group per mesh). That of course conflicts with a multiple object scene with polygon groups set.

---------------------------------------------------------------

Here again is the .obj file from Wings. It contains 2 box(2 objects). I have added comment (original is in post above)

# Exported from Wings 3D 1.5.2
mtllib wings_box.mtl
o Cube2                                            << "o" = defining object (I have seen other .obj exporters use "g" for vertex group to define an object)
#8 vertices, 6 faces                               ---------------------------------
v 1.00000000 -1.00000000 -1.00000000               vertex list for box "Cube2"
v 1.00000000 -1.00000000 1.00000000
v 1.00000000 1.00000000 -1.00000000
v 1.00000000 1.00000000 1.00000000
v 3.00000000 -1.00000000 -1.00000000
v 3.00000000 -1.00000000 1.00000000
v 3.00000000 1.00000000 -1.00000000
v 3.00000000 1.00000000 1.00000000
vn -0.57735027 -0.57735027 -0.57735027             Vertex normal list for "Cube2"
vn -0.57735027 -0.57735027 0.57735027
vn -0.57735027 0.57735027 -0.57735027
vn -0.57735027 0.57735027 0.57735027
vn 0.57735027 -0.57735027 -0.57735027
vn 0.57735027 -0.57735027 0.57735027
vn 0.57735027 0.57735027 -0.57735027
vn 0.57735027 0.57735027 0.57735027
g Cube2_default                                    <<< "g" = defining polygon group
usemtl default
s 1                                                <<< "s" = defining smooth group
f 1//1 5//5 6//6 2//2                              -------------------
f 2//2 4//4 3//3 1//1                              Face list for "Cube2"
f 2//2 6//6 8//8 4//4
f 3//3 7//7 5//5 1//1
f 4//4 8//8 7//7 3//3
f 5//5 7//7 8//8 6//6
o Cube1                                            <<<"o" defining next object in .obj file = "Cube1"
#8 vertices, 6 faces                               Repeat as above.
v -3.00000000 -1.00000000 -1.00000000
v -3.00000000 -1.00000000 1.00000000
v -3.00000000 1.00000000 -1.00000000
v -3.00000000 1.00000000 1.00000000
v -1.00000000 -1.00000000 -1.00000000
v -1.00000000 -1.00000000 1.00000000
v -1.00000000 1.00000000 -1.00000000
v -1.00000000 1.00000000 1.00000000
vn -0.57735027 -0.57735027 -0.57735027
vn -0.57735027 -0.57735027 0.57735027
vn -0.57735027 0.57735027 -0.57735027
vn -0.57735027 0.57735027 0.57735027
vn 0.57735027 -0.57735027 -0.57735027
vn 0.57735027 -0.57735027 0.57735027
vn 0.57735027 0.57735027 -0.57735027
vn 0.57735027 0.57735027 0.57735027
g Cube1_default
usemtl default
s 1
f 9//9 13//13 14//14 10//10
f 10//10 12//12 11//11 9//9
f 10//10 14//14 16//16 12//12
f 11//11 15//15 13//13 9//9
f 12//12 16//16 15//15 11//11
f 13//13 15//15 16//16 14//14

---------------------------------------------------

Out of curiosity, I decided to install Silo and check its .obj exporter. That also exports objects as being defined as "o" in the vertex list.
So there is no other .obj exporter that I can find that merges all objects into one mesh as Nvil does.





« Last Edit: April 24, 2014, 12:31:03 pm by steve »

  • No avatar
  • Posts: 3710
  • Developer
  • Administrator
  • Polygon
April 24, 2014, 12:28:40 pm
Ah, it is my misunderstanding. I always thought one object file can only contain one object and never doubt it. Well, I have to rewrite obj import/exporter.

  • No avatar
  • Posts: 3710
  • Developer
  • Administrator
  • Polygon
April 27, 2014, 09:49:18 am
The obj import/exporter is redone. See if it works correctly.
http://www.digitalfossils.com/Download/NVil-Apr-20-14.rar

  • No avatar
  • Posts: 2101
  • Polygon
April 27, 2014, 02:34:27 pm
Hi IStonia,

I did not think you would be re-doing the .obj importer/exporter yet.

On very quick checks, I can see a couple of problems up to now.

The face lists become incorrect.
The default polygon groups should they be named.(I have not checked yet as to what the .obj export options do)

Quick example:-
Simple scene with 3 box. .obj export default settings.
Comments added.
Code: [Select]
# Exported from NVil (1.0)


mtllib 3_box.mtl

o Object_Box

#     Vertices: 8
#        Faces: 12
#    Materials: 1

# vertex list

v -1.5 -0.5 1.5      #vertex list of "object_Box"
v -1.5 -0.5 0.5      # Vertex numbered 1 to 8
v -0.5 -0.5 1.5
v -0.5 -0.5 0.5
v -1.5 0.5 1.5
v -1.5 0.5 0.5
v -0.5 0.5 1.5
v -0.5 0.5 0.5

# face list

usemtl Mtrl_01
g                   # Group name?
s 2
f 1 2 4 3           #face list using vertex numbers from "object_box", correct
s 4
f 5 7 8 6
s 8
f 1 3 7 5
s 16
f 2 6 8 4
s 32
f 1 5 6 2
s 64
f 3 4 8 7

o Object_Box_01

#     Vertices: 8
#        Faces: 12
#    Materials: 1

# vertex list
v 0.5 -0.5 1.5         #vertex list of "object_Box?_01"
v 0.5 -0.5 0.5         #Vertex numbered 9 to 16
v 1.5 -0.5 1.5
v 1.5 -0.5 0.5
v 0.5 0.5 1.5
v 0.5 0.5 0.5
v 1.5 0.5 1.5
v 1.5 0.5 0.5

# face list

usemtl Mtrl_01
g                      #Group Name?
s 2
f 9 10 12 11           #Face list using vertex numbers from "object_Box_01", correct
s 4
f 13 15 16 14
s 8
f 9 11 15 13
s 16
f 10 14 16 12
s 32
f 9 13 14 10
s 64
f 11 12 16 15

o Object_Box_02

#     Vertices: 8
#        Faces: 12
#    Materials: 1

# vertex list

v 0.5 -0.5 -0.5         #vertex list of "object_Box_02"
v 0.5 -0.5 -1.5         #Vertex numbered 17 to 24
v 1.5 -0.5 -0.5
v 1.5 -0.5 -1.5
v 0.5 0.5 -0.5
v 0.5 0.5 -1.5
v 1.5 0.5 -0.5
v 1.5 0.5 -1.5

# face list

usemtl Mtrl_01
g                        #Group name?
s 2
f 9 10 12 11             #Face list using vertex numbers from "object_Box_01", incorrect.
s 4
f 13 15 16 14
s 8
f 9 11 15 13
s 16
f 10 14 16 12
s 32
f 9 13 14 10
s 64
f 11 12 16 15

# End of file


In that simple example, when loading the .obj file, you just get overlapping box. But in a scene where you have various objects with different number of vertex, objects(saved as .obj) are corrupt due to incorrect face lists.

Screen_shot of 3 box with different number of vertex.


Saved as, then loaded as .obj. Objects corrupt.



---------------------------------------------------

Just very quickly looked at the option in .obj export "Regroup polygons by meshes"
When used, it is placing all polygons from all mesh into the same named group.

Should that option still be there/needed?



« Last Edit: April 28, 2014, 01:27:31 am by steve »

  • No avatar
  • Posts: 3710
  • Developer
  • Administrator
  • Polygon
April 28, 2014, 12:09:56 pm

  • No avatar
  • Posts: 2101
  • Polygon
April 28, 2014, 02:14:44 pm
Hi IStonia,

The face lists(vertex ref numbers) now appear to be numbered/ordered correctly. (I still need to check more for VN and VT)

The export option "Regroup polygons by meshes" is still incorrect. That is still placing all polygons into same named group. (for example. I have 3 box in scene "Object_box", "Object_box_01" and "object_box_02" each with one mesh. I export with option "Regroup polygons by meshes", the 3 object face lists are grouped with name "Box"). [to add]Looking through the naming of the mesh in scene, they are in fact all named "Box" in the example. I find that strange considering that objects cannot have the same name. I see similar mesh naming in earlier versions, but those names are changed in .obj file exported.

With default export settings(no regroup), any polygon groups set, appear to be exported OK. But I will need to check that with other .obj importers (that support polygon groups) as well as Nvil. (I will probably check the importer from 3D coat, due to link).

Materials(colors) appear to be exporting/importing OK

I still need to make checks on hard_edge and smooth group export/import.


-------------------------------
Checking more with polygon groups.

I looked at simple scene with 2 Box. Each box had one polygon in a separate group. Then one polygon from each object placed in a 3rd group.

The export appears to be OK, but import of polygon groups that span multiple objects is splitting/re-naming those groups.
In the simple example. It looks like on import(default settings), polygon groups with same name on different objects, instead of them being loaded as one group, the second group is re-named and a new group created.

I can post example files/pics to better explain the issue if needed.

---------------------------------

Off topic.
With taking note of objects/mesh and groups when checking, I find that scene management is a complete nightmare. Having to have 3 different windows open to keep track of objects/mesh and groups is not something I would want to do if I had projects that needed scene management.(which they would if it was work/project for someone other than myself).
Hopefully, some time in the future, you could look at better organization?.
//


« Last Edit: April 29, 2014, 02:09:41 am by steve »

  • No avatar
  • Posts: 3710
  • Developer
  • Administrator
  • Polygon
April 29, 2014, 10:44:30 am

  • No avatar
  • Posts: 2101
  • Polygon
April 29, 2014, 12:05:00 pm
Hi IStonia,

The set groups now appear to be OK. (groups spanning multiple objects are saved/imported correctly)

The exported groups via "Regroup Polygons by Meshes" is still repeat naming as I mentioned above. But considering Nvil and other applications I have checked can deal with that on import, I do not think an issue.

I need to check normals/texture lists. So will post back finding later.

-------------------------------------------------

There is a slight issue if .obj files are imported/merged when the .mtl file for that .obj file is empty/missing. The objects appear to be wireframe until a material is applied to them.
If the .mtl file is empty/ missing, should a default material not be automatically applied?

What I would normally see, is the material names from the .obj file are loaded, but if the .mtl file is missing, those materials are filled/ applied with default color.

----------------------------------

UV's and normals appear to be OK up to now.




« Last Edit: April 29, 2014, 12:53:24 pm by steve »

  • No avatar
  • Posts: 3710
  • Developer
  • Administrator
  • Polygon

  • No avatar
  • Posts: 2101
  • Polygon
April 30, 2014, 04:02:03 pm
Hi IStonia,

A default material is now added if .mtl file missing. So OK.

Have checked Vertex normals, and those export/import correctly.

One thing at the moment. Which is memory usage with .obj import.
As a simple example. I have a scene in .vws format that I load. After it is loaded, total memory usage by Nvil is approx 556 MB. I save that scene as .obj. Restart Nvil, and load that scene from the .obj file. Memory usage by Nvil is then approx 1.15 GB.
Why is memory usage so much more (when importing via .obj format) for the exact same scene?

Loading that same scene from .dae, that as similar memory usage as the .vws file.(approx 564 mb)


  • No avatar
  • Posts: 3710
  • Developer
  • Administrator
  • Polygon
April 30, 2014, 06:46:22 pm
How many objects in that scene?

  • No avatar
  • Posts: 2101
  • Polygon
April 30, 2014, 07:30:25 pm
72 objects
72 mesh
148,916 polygons.


  • No avatar
  • Posts: 3710
  • Developer
  • Administrator
  • Polygon
May 01, 2014, 11:41:11 am
Try this
http://www.digitalfossils.com/Download/NVil-Apr-24-14.rar

Also recheck vt and vn. They are affected.