[Plugin] OBJexporter v3.0 20130131

Re: [Plugin] OBJexporter v2.7 20121008

Postby TIG » Fri Jan 25, 2013 9:43 pm

@Sound

I am afraid you are mistaken. :?
I have tested this extensively and a cube of 6 faces exports as a cube of 12 facets, because they are each triangulated.
You can clearly see it in the OBJ code.
If I import the OBJ it then arrives with 12 triangulated faces too.
this occurs with many OBJ importing apps.

IF you triangulate the faces manually before exporting you can create internal 'partitions' inside the cube depending on the order the diagonals are drawn, this should only make more that the visible 12 faces :?

So this suggests there is something wrong with your initial cube if it indeed has 16 facets when exported, or alternatively something wrong with the app into which you are importing it? There are many apps that import these OBJ files quite acceptably without new facets or complaints about unconnected facets...
What are you using to import it ?

The code takes faces in the same context using the same material, triangulates them as necessary and produces the facets to suit. This tool is used as the basis of several rendering apps. The Pro OBJ exporter exports a simple cube with a file that is all but identical to this tool's file, so I don't think there's anything wrong with it...

Try the Pro version OBJ exporter and see it's the same...

I suspect you are either mis-modeling the cube beforehand OR not using appropriate import settings and getting spurious results... I suggest you make an OBJ made from a 1m cube in the positive quadrant of the axes, bb.min at [0,0,0]. Then compare it with mine in the ZIP, which only has 12 facets...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] OBJexporter v2.7 20121008

Postby Sound » Sat Jan 26, 2013 11:54 am

Thank you for the answer. Yes, it looks like those internal faces were already in SketchUp. A new test shows 12 facets, and that's fine.

Still, the other problem persists. Even when the exported cube results in 12 facets, the file contains 24 vertices (you can check this by opening the OBJ file with Meshlab or any other importer, or even by counting the "v" lines in the OBJ file). This looks very wrong, as the original geometry only has 8 vertices. Can you help me about this issue too? Thanks!
0

Sound 
 

Re: [Plugin] OBJexporter v2.7 20121008

Postby TIG » Sat Jan 26, 2013 1:04 pm

So no apology for putting me to unpaid trouble when it was entirely your error? :roll:
My exporter does work differently from the pro-OBJexporter, which minimizes the number of vertices by recycling them when possible.
However, my version treats each context, material and face as a separate set, and doesn't reused vertices. The coding is such that it would be very awkward to effect...
However, it has no noticeable effect on the resulting form and a ood 3rd party app should be able to cope with welding vertices etc anyway...
Get Pro if you really do NEED this functionality, and are not just being 'anally retentive'.
After all my tool is 'free' [donationware] and you cannot readily expect, let alone demand, changes to its functions... :roll:
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] OBJexporter v2.7 20121008

Postby Sound » Sat Jan 26, 2013 3:55 pm

Well, I'm just reporting a bug. A cube, having 8 vertices, is exported with 24 vertices :shock:
This is a wrong representation of the object and has a very noticeable impact on all uses of the OBJ file when topologic integrity is required (3D printing is one example).

Of course I expect nothing from you, being it freeware. Whether you want to fix this bug or leave it there is entirely up to you.

Sadly, your code is not even covered by an open source license (it's "all rights reserved"), so people are not allowed to fix this bug and redistribute a fixed version. :cry:
0

Sound 
 

Re: [Plugin] OBJexporter v2.7 20121008

Postby TIG » Sun Jan 27, 2013 1:46 pm

@Sound

The vertex 'duplication' isn't actually a 'bug', since that would suggest that it isn't doing what it is intended to do: and it currently does exactly what it is coded to do.
However, I do take your [inelegantly put] point that vertex entries could be 'reused' if they are 'shared' by more that one facet...

So I now have an idea on to make an adjusted version of the code that will now does this: and it can also have a few other tweaks; to reduce the file size further, to optimize the processing time etc.

I'll post it soonest...

PS: Although I do 'reserve all rights' to my code... please feel free to make your own improvements to any of my tools, and either PM me or post them here, of course for free unfettered use by all members... The only thing I ask is not to post whole scripts in the same thread as it'll cause confusion... :roll:
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] OBJexporter v2.8 20130127

Postby TIG » Sun Jan 27, 2013 1:54 pm

Here's v2.8 viewtopic.php?p=294844#p294844
The D.P. accuracy is not now applied to 'whole numbers', and any -0 values becomes 0.
Any shared-vertex entries are now 'reused'.
The OBJ file size is minimized and the processing time is optimized.
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] OBJexporter v2.8 20130127

Postby Sound » Sun Jan 27, 2013 3:36 pm

TIG, thank you very much for working on that and for clarifying your terms about modifying the script.
I will test the new version as soon as possible and report success or failure.
Have a good day.
0

Sound 
 

Re: [Plugin] OBJexporter v2.8 20130127

Postby Sound » Mon Jan 28, 2013 4:44 pm

I can confirm this works for any model I tried.
Thank you! Exported OBJ is now topologically correct and thus suitable for a lot more uses.
0

Sound 
 

Re: [Plugin] OBJexporter v2.8 20130127

Postby TIG » Mon Jan 28, 2013 4:49 pm

Good.
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] OBJexporter v2.9 20130130

Postby TIG » Wed Jan 30, 2013 6:00 pm

Here's v2.9 viewtopic.php?p=294844#p294844
Merging of shared vertices is now optional, as it slows down processing for larger models considerably; and it is only required by some more picky mesh-apps, but renderers etc don't seem to mind non-merged vertex data at all.
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] OBJexporter v3.0 20130131

Postby TIG » Thu Jan 31, 2013 12:58 pm

Here's v3.0 viewtopic.php?p=294844#p294844
It has a much improved shared-vertex merging algorithm that is now slightly faster than a non-merging version, so the option 'not to merge' has been removed because it is now of no benefit.

Where possible, shared-vertex data is always reused, ensuring correctly formed geometry.
This can mean that a SKP export containing 100,000 faces and therefore potentially 300,000 vertices can be 'compacted' to use perhaps 50,000 shared-vertices [but of course this depends on each SKP's geometry, grouping etc]: this 'compaction' also reduces processing time [which will now be perhaps ~60 seconds for this sized example], and when combined with the latest optimized 'numerical-entries' gives much smaller OBJ file sizes, and faster processing in 3rd-party apps too.
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] OBJexporter v3.0 20130131

Postby andybot » Thu Jan 31, 2013 5:27 pm

Great work, as usual, TIG!! This plugin is very essential for me. Many thanks for your development efforts!
0
my blog featuring recent projects
User avatar
andybot 
Premium Member
Premium Member
 

Re: [Plugin] OBJexporter v3.0 20130131

Postby cotty » Thu Jan 31, 2013 6:40 pm

Thank you for this update!
0
User avatar
cotty 
Top SketchUcator
 

Re: [Plugin] OBJexporter v3.0 20130131

Postby samurai1789 » Sun Feb 10, 2013 3:24 pm

What simple instructions???? What ever i do i cannot find it HELP!!!!
0

samurai1789 
 

Re: [Plugin] OBJexporter v3.0 20130131

Postby TIG » Sun Feb 10, 2013 10:09 pm

samurai1789 wrote:What simple instructions???? What ever i do i cannot find it HELP!!!!
They are on the download page ! viewtopic.php?p=294844#p294844
There are also some simple dialogs as you go after the tool is started...
What problems do you have otherwise ?
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] OBJexporter v2.8 20130127

Postby thomthom » Sat Feb 23, 2013 6:16 pm

TIG wrote:The D.P. accuracy is not now applied to 'whole numbers', and any -0 values becomes 0.

What made you chose to do this? Are there applications that doesn't handle these values well? I'm curious because I've been looking at the OBJ format this weekend.
(Is there an official specification somewhere? I find multiple sources around...)
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] OBJexporter v3.0 20130131

Postby pilou » Sat Feb 23, 2013 6:25 pm

See the external links at the end of the page :)
0
Frenchy Pilou
Is beautiful that please without concept!
Speedy Galerie
User avatar
pilou 
Top SketchUcator
 

Re: [Plugin] OBJexporter v3.0 20130131

Postby thomthom » Sat Feb 23, 2013 7:06 pm

Pilou wrote:See the external links at the end of the page :)

Is that the official specs though? "martinreddy.net" ...
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] OBJexporter v2.8 20130127

Postby TIG » Sat Feb 23, 2013 7:44 pm

thomthom wrote:
TIG wrote:The D.P. accuracy is not now applied to 'whole numbers', and any -0 values becomes 0.

What made you chose to do this? Are there applications that doesn't handle these values well? I'm curious because I've been looking at the OBJ format this weekend.
(Is there an official specification somewhere? I find multiple sources around...)
It just minimizes the OBJ file size, an importer reads 0 as 0.0, so making it 0.000000 is pointless, -0==0 so it might as well be 0 !... so all trailing zeros are now omitted, it speeds up the writing by a few % and I also the importing at the 3rd party end...
There's an OBJ Wavefront Wiki...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] OBJexporter v3.0 20130131

Postby thomthom » Sat Feb 23, 2013 8:11 pm

Are you sure all importers manage to read an int instead of a float which the specs appear to indicate? Just wondering in case the parsing is implemented in a stricter language...

TIG wrote:I also the importing at the 3rd party end...

Something missing from that sentence? :?

TIG wrote:There's an OBJ Wavefront Wiki...

This one? http://en.wikipedia.org/wiki/Wavefront_.obj_file
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] OBJexporter v3.0 20130131

Postby TIG » Sun Feb 24, 2013 9:53 am

I have used OBJ files exported like this in many apps [Octane, Blender, MeshLab, MeshMan, AC3D etc] and they all import just fine.
As far as I can tell they expect a 'number', so 0 == 0.0 == 0.000000 etc, 1 == 1.0 == 1.000000...
They even take -0 == 0 when -0 is not really a number.
I also trap for 'NaN' and 'Infinity' which would break them...
Sharing vertex data is also permissible if you correctly reference the vertices.

Try it yourself using a box that is located at, and offset from, the ORIGIN by whole 'meter' distances. The native OBJ exporter using m/triangulation, flipped-YZ etc gives a similar result to my 'free' tool BUT 1.000000 >> 1 in mine... Now import the two OBJ files into an app like Blender and you get the exact same result... If you make the two much more complex you'll find mine loads into the app a tiny % faster. Of course it takes longer to write the file because the native exporter is a swifter exe...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] OBJexporter v3.0 20130131

Postby thomthom » Sun Feb 24, 2013 2:31 pm

There are no way to define faces with holes in OBJ, is it?

I see that OBJ files can support bezier patches - which is interesting for Bezier Surface.
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: [Plugin] OBJexporter v3.0 20130131

Postby mra » Thu Mar 21, 2013 11:43 pm

I'm getting a crash during export, albeit its a large file, the obj gets up to about 5mb and sketchup crashes without warning.

I'm aware this would be highly scene dependant but is there anything I can do? I'd be happy to send in a scene somewhere for debug. :)
0

mra 
 

Re: [Plugin] OBJexporter v3.0 20130131

Postby chuckasaki » Thu Apr 04, 2013 8:17 am

Firstly thanks for such a great plugin. I think it's a big rough that google want us to go all the way to 500 bucks for an obj export, something that could be considered pretty standard, and clearly exporting means that they may not even need all sketchup pros power as the model will be used elsewhere. I'd would love to see a slightly less expensive option, cos I ain't going to 5 without a good reason.
Having said that... I don't want to seem like someone whining about a freebie for sure, I think what you done is great..... but I can't get an export that works.
The model goes some way and then crashes- bugsplat . I can open the obj...sure.. but only half of it comes in.
Is your plugin still compatible?
If I can get results I will definitely donate.
:cry:
0

chuckasaki 
 

Re: [Plugin] OBJexporter v3.0 20130131

Postby TIG » Thu Apr 04, 2013 9:57 am

As I have no way of knowing what it is you are trying to do then I don't have the feintest idea what's up.
My exported OBJ files have proved to be compatible with all of the standard apps that can import such files.
Have you tried exporting a simple box and seeing if that works...

Bugsplats during the export are very rare, if the SKP is large with complex geometry etc it can take a while to complete; so don't confuse a white-out with a 'crash'!
When Sketchup is doing intensive calculations it sometimes looses its screen focus and says it's 'unresponsive'.
However, it is still beavering away in the background writing the OBJ data etc.
Leave it alone until it's completed its tasks.
If you run it with the Ruby Console open do you get any error messages ?

If you still have issues and it's not just your impatience that's aborting things... then can you post [or PM] a sample of a SKP that is failing, so I can look at it...

For example do you have anything peculiar about your SKP files?
Like very small geometry, or very large geometry, edges and no faces, oddly grouped geometry, oddly layered faces/edges etc etc... ???
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] OBJexporter v3.0 20130131

Postby cotty » Thu Apr 04, 2013 11:59 am

chuckasaki wrote:... google want us to go all the way to 500 bucks for an obj export

It's not google anymore ;)
0
User avatar
cotty 
Top SketchUcator
 

Re: [Plugin] OBJexporter v3.0 20130131

Postby mommykathy » Mon May 13, 2013 12:00 am

Thank You, Thank You, Thank You! Been going nuts trying to find something to do this and this is PERFECT. Have a great day!
0

mommykathy 
 

Re: [Plugin] OBJexporter v3.0 20130131

Postby McGyver » Mon Jul 01, 2013 6:10 pm

Hi! I'd like to thank TIG once again for this truly awesome plugin as well as all the subsequent updates.
I frequently recommend this plugin for people who are new to SketchUp, showing them that their modeling efforts can be used in other programs besides SketchUp.
A lot of people tend to believe that SketchUp is very limited, has no export options for the free version and are not aware of all the amazing plugins that extend SU's capabilities and give it greater power.
I was just writing a short "How to" for people who wish to use their models in Poser/DAZ studio, but it occurred to me that while I giving instructions on how to install a ruby script such as "OBJexporter" I was not sure if there were any other plugins that needed to be installed for OBJexporter to work properly... I have quite a few and the thought came to me when I was describing the progress bar and "Model exported in X# of seconds" features... so I figured I'd ask-

Does OBJexporter require any other plugins such as Progressbar.rb to function properly?

Thats probably a pretty stupid question, but before I tell someone how something works, I figured I should probably include any relevant additional information.

Thanks in advance for any information any of you can provide!
0
User avatar
McGyver 
 

Re: [Plugin] OBJexporter v3.0 20130131

Postby TIG » Mon Jul 01, 2013 9:06 pm

My OBJexporter code is 'self-contained'.
It only 'requires' sketchup.rb, and that is installed by SketchUp itself in the Tools folder...
The progress reporting etc is built-in to my code and needs no 3rd party helpers...
0
TIG
User avatar
TIG 
Global Moderator
 

Re: [Plugin] OBJexporter v3.0 20130131

Postby McGyver » Tue Jul 02, 2013 4:04 pm

Thank you once again!
0
User avatar
McGyver 
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 

PreviousNext


 

Return to Plugins

Who is online

Users browsing this forum: waurbenyeger and 7 guests

Visit our sponsors: