V3 Wish: Mesh export density adjustment

Next
 From:  Mark Brown (MABROWN)
3570.1 
Hi Michael,

Would it be possible to have an option in V3 where you could apply different mesh export settings on a per object basis and have MoI export with those settings to a single file? I ask because it is incredibly difficult to find reasonably priced software that can merge multiple obj's into a single file and still maintain those all important vertex normals. To date I have only found Milkshape 3D (which has a 64k poly limit) as a budget solution. I also have Simlab which does the right thing with the vertex normals but currently imports all obj's to the world origin (a fix is on the way). Perhaps this could be done with a script?

Also, it would be really nice to be able to apply a denser mesh only in critical areas of a surface. I'm thinking perhaps we could apply a base mesh setting to an object and then select areas of any surfaces in that object that we want more dense (using say, a lasso) and re-mesh those areas. Such a mechanism would create a great compromise between poly count & mesh smoothness.

I'm finding that avoiding the use of non-MoI software wherever possible is important to maintain the vertex normals. On that score, I would also find basic texture mapping (box, planar etc) and basic wire frame texture map generation within MoI very useful.

Mark

---
Mark
http://www.homepages.ihug.com.au/~mabrown/index.html

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
3570.2 In reply to 3570.1 
Hi Mark, Marc Tellier was also recently running into the same problem where none of the mesh programs that he tried (I gave him a list of a bunch of different ones) could merge OBJ files into a single one and also keep all the vertex normals.

He resorted to just using a text editor to merge them - one thing that makes that easier is to turn on the "relative indexing" OBJ export style from MoI, which you can do in moi.ini under:

[OBJ Export]
UseRelativeIndexing=y

That makes the faces index vertices using a negative number which means "back this many from the last seen vertex" - it makes the faces more self contained with the vertices before them rather than faces referencing things by absolute position.

However, be aware that some programs won't read an OBJ file that uses relative index numbers like that, that's why it is not enabled by default.


Probably some of the more heavy hitter programs like Cinema4D, Maya, or Softimage would be able to handle this OBJ merging task for you, but of course those are all fairly expensive.


It would probably not take me very long to write a standalone OBJ file merger utility, I'll see if I can cook something up for that within the next week or so, that may help you for the time being.


> I'm thinking perhaps we could apply a base mesh setting
> to an object and then select areas of any surfaces in that
> object that we want more dense (using say, a lasso) and
> re-mesh those areas.

So unfortunately this part of what you are talking about here would probably require quite an extensive amount of work to make happen. That would be a lot of specialized UI and I can forsee a lot of issues such as strange mesh formations or aliasing where things abruptly switch settings within the same surface.


A "per object" setting would be much more feasible at some point, it would probably need to wait until I had a good place in the UI to put a bunch of extra object properties.


But in the near term I think I can cook up a merging utility for you.

It is strange that so many other programs can't handle it.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Mark Brown (MABROWN)
3570.3 In reply to 3570.2 
Hi Michael,

>He resorted to just using a text editor to merge them - one thing
>that makes that easier is to turn on the "relative indexing" OBJ
>export style from MoI, which you can do in moi.ini under:
>
>[OBJ Export]
>UseRelativeIndexing=y

I just tried that then imported a model into Simlab with welding on. Simlab crashed. With welding off however it imported just fine. Currently, the model I'm working on is listed as having about 2500 objects in MoI (about 50 or 60 named objects to export). Would be a daunting task with a text editor I think.

>It would probably not take me very long to write a standalone
>OBJ file merger utility, I'll see if I can cook something up for that
>within the next week or so, that may help you for the time being.

As always Michael, that is a very generous offer. It is something that would be very useful. I tried to write my own merging utility with little success some time back, then Googled long and hard for something ready made without any luck. Given that Marc has had a similar problem I reckon others would find this useful too. It would definitely fix one of my current issues.

>...I can forsee a lot of issues such as strange mesh formations or
>aliasing where things abruptly switch settings within the same surface.

Hadn't thought of that of course and I can see what you mean.

>A "per object" setting would be much more feasible at some point,
>it would probably need to wait until I had a good place in the UI
>to put a bunch of extra object properties.

No worries Michael, it can wait till V6 (if at all) if I can merge my objects some other way!

>It is strange that so many other programs can't handle it.

It is indeed and very frustrating, particularly when a $25 program like Milkshape can import and export obj's perfectly. It is slow doing it but dead accurate. If only it didn't have that 64k poly limitation. UV Mapper Pro can do it too but has no object merging.

Thanks again for your help Michael. I'm greatly looking forward to having access to the V3 betas.

EDITED: 28 May 2010 by MABROWN

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Marc (TELLIER)
3570.4 
Hi Mark, I indeed stumble into a lot of frustration with this issue.
Milkshake didn't work for me, maybe I did something wrong in the export?.

Rhino appeared to do it right but as far as I could see the material definition were not read.

I ran into similar troubles trying to UV unwrap more complex models, the vertex normal are often lost.
I found a small trick.

1-export the model from MOI
2-Open with a 3d program and do the unwrapping. (This is one thing blender is quite good at)
3- Same the obj under another name, it will most probably have lost vertex normal info.
4-Open original Moi export with uvmapper and load the uvs from the other obj file (from file/import Uvs..)
5-Save the file.

This way you have preserved the vertex normal and have your Uvmapping.
Zbrush recently had a nice uwrapping plugin also


Michael, it would be very convenient to have such an utility to merge obj. files.
I'm sure a quite a few users will find it useful.

If it's a simple thing to do, I think it might be a simpler solution than integrating a export/meshing/layering/ mechanism inside.
Thanks a lot for your support.

Marc
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Mark Brown (MABROWN)
3570.5 In reply to 3570.4 
Hi Marc,

Sorry for the slow reply.

Many thanks for the tip. I haven't had a chance to try it but I will be with this current model. I have UVMapper Pro. This technique might also enable me to use Ultimate Unwrap which has some useful texture template options but in my tests made a mess of the vertex normals.

I'm surprised that Milkshape didn't work for you. What version did you try? Do you have a small test obj you could post that shows what didn't work?

Like you, I've tried a lot of software to deal with this but the selection which worked for me is really small.

I'm really looking forward to the obj merger if Michael can find some free time to do it.

Mark

---
Mark
http://www.homepages.ihug.com.au/~mabrown/index.html

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Micha
3570.6 In reply to 3570.1 
Mark wrote "Would it be possible to have an option in V3 where you could apply different mesh export settings on a per object basis and have MoI export with those settings to a single file? ....
Also, it would be really nice to be able to apply a denser mesh only in critical areas of a surface. ...."

I have the problem often, that a small mesh angle is need to avoid a visible tessellation on large light bended surfaces. This small angle cause a to dense mesh at all other parts. Since MoI is created for easy usage wouldn't not better to add a "max error" option (distance NURBS to mesh) first than adding a meshing single objects feature? Also, it's not seldom that a single part contain large light bended surfaces and small rounds. In this case the different parts can be separate meshed. Attached a very simple example. OK, "avoid smaller than" can be used, but ...

I know we talked about it in the past. Only I want keep it in the mind, maybe it can be implemented in v3. ;)


Visualisation for Designer and Architects | http://www.simulacrum.de
Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
3570.7 In reply to 3570.6 
Hi Micha, I do think that the kind of "max error" (possibly I will call it Chord height) should get added in as a new meshing parameter in v3.

Currently you would probably want to use "Divide larger than" to force some additional divisions in larger slightly curved objects like you show there - that's probably a bit easier than using a tight angle + "Avoid smaller than" which it sounds like you are doing now.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
3570.8 In reply to 3570.6 
One of the things that I want to figure out is some way to have that kind of chord height switchable between 2 modes - a "percent relative to the bounding box size" mode, and an "absolute distance value" mode.

It would be helpful for the default simple dialog (where only the slider is showing) to also set this value in the relative size mode when moving the slider around instead of only the angle parameter alone.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Micha
3570.9 In reply to 3570.7 
"Currently you would probably want to use "Divide larger than" to force some additional divisions in larger slightly curved objects like you show there - that's probably a bit easier than using a tight angle + "Avoid smaller than" which it sounds like you are doing now."

I'm not a fan of "divide larger than" since it divide not only in curved directions. So I get much to much polygons - see screenshot. If it would work perfect, it would devide in the curved direction only. This you could implement without to change any UI. ;)




Visualisation for Designer and Architects | http://www.simulacrum.de
Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
3570.10 In reply to 3570.9 
Hi Micha, I see - but "divide larger than" would work without complication on that previous example that you posted though.

I also have that on my list as well, to make "Divide larger than" when set to apply to curved surfaces only to not divide in the straight direction on extruded surfaces.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Micha
3570.11 In reply to 3570.10 
Great, thank you.

Visualisation for Designer and Architects | http://www.simulacrum.de
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
3570.12 In reply to 3570.5 
I've been able to cook up the "merge obj files" utility that was mentioned earlier in this thread, it's available here:

http://moi3d.com/download/MergeOBJ.exe

And I updated the wiki resources page to list it:

http://moi3d.com/wiki/Resources#MergeOBJ_utility


So hopefully that should do the trick if you want to merge OBJ files together into a single larger file but still preserve vertex normals which unfortunately other freely available programs have a tendency to discard.


When you run it, it will show a simple dialog and you build up an input files list either by pushing the "Add files" button which lets you use the file open dialog (w/multi select) or by drag/dropping files on to the dialog window.

If you want to start over you can hit the Clear button to blank out the input files.

Then when you have all your input files listed up, you push the "Generate merged file" button which will ask you for a filename to write and then crunch out one single OBJ file that has all the other stuff combined into it.

Most things like object names and vertex data pass straight through to the combined file, but the index values of all faces are adjusted to make them correct in the new vertex list and also it gathers up all the materials used by every file and puts that out into one combined material file as well.

Hope it's useful!

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Mark Brown (MABROWN)
3570.13 In reply to 3570.12 
Not just useful, in fact, absolutely essential for the job I've got to do.

It works perfectly too but I don't reckon that will be any surprise to anyone on the forum.

Cheers!

Mark

---
Mark
http://www.homepages.ihug.com.au/~mabrown/index.html

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Frenchy Pilou (PILOU)
3570.14 
A cool one to add on the French wiki parts ;)
Edit : Done ;)
http://moi3d.com/wiki/Ressources_%28french%29#MergeOBJ_fusionner_des_fichiers_OBJ
and here ;)
http://moiscript.weebly.com/

EDITED: 9 Jun 2010 by PILOU

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Marc (TELLIER)
3570.15 
Wow, that's an awesome 60kb!!

Thanks for the utility, works great and will save a lot of Tylenol.

Marc



Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  Mark Brown (MABROWN)
3570.16 In reply to 3570.15 
> Thanks for the utility, works great and will save a lot of Tylenol.

I shared your pain, now happily cured by Dr Gibson!

---
Mark
http://www.homepages.ihug.com.au/~mabrown/index.html

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All