View Full Version : PLUGIN: Enhanced OBJ exporter available
Dennis
20th April 2005, 05:26 AM
I've developed a new OBJ exporter for AC3D. All the features of the existing AC3D export, but adds groups, lines, textures, and optional copying of textures to the OBJ output directory.
Windows-only, but source is included if you can (or know someone who can) compile it for other platforms.
Find it here:
http://supercoldmilk.com/ac3dplug/objenh.html
See all of my plugins at http://supercoldmilk.com/ac3dplug/index.html
Enjoy
Spinner
5th April 2006, 06:08 AM
Dennis,
Setting up in a new computer I've downloaded all your plugins again and re-installed.
I notice the directions for this install direct us to place the .tcl and .p into /scripts. Your others usually indicate /plugins as the location for these (ie Wave) and /scripts for .tcl only (ie Crease). Is there a reason for this diference?
Dont really understand the functional dif between placement in those two folders.
btw, Doing this has reinforced my realisation of how much your efforts have improved my hobby. Thanks again, mate.
Dennis
5th April 2006, 01:49 PM
I notice the directions for this install direct us to place the .tcl and .p into /scripts.
Seems you've found a typo here :oops:
I've corrected this and reposted the page.
To answer the question about scripts versus plugins:
Scripts are anything written entirely in Tcl/Tk (these are the .tcl files). Basically, this is text-based code that ac3d can use on any platform. You could open one of these files in a text editor, and there's your source code for the script.
Plugins require a compiled program (the .p file), and normally perform operations outside the scope of what's possible in ac3d + tcl. Plugins are specific to platforms (Windows/Mac/Linux), so it's nice to use scripts where we can to alleviate having to compile a different version for each platform.
AC3D treats the .tcl files for plugins a bit differently than it treats the .tcl files for scripts, so that's why they're in separate directories.
Good to hear you're getting use out of these plugins - always glad to help out!
Dennis
chono00
14th April 2006, 10:32 PM
Nice!!! but it does not work properly, Im trying to export a file that uses textures and simple color materials (AC3D materials) and it does not export the color materials to the mtl file and uses the texture insted.
Dennis
15th April 2006, 12:10 AM
This should work properly. Can you post an example? The contents of the .mtl file should suffice.
Dennis
chono00
15th April 2006, 09:31 AM
This is the file Im trying to export:
[/url]http://members.lycos.co.uk/chono00/m998-enh.zip
The file contains the obj and mtl files I get and a screenshot of the generated file.
Also I think AC3D groups option is not working. By the way where can I get ac_plugin.h to compile your plug in?
--------------------------------------
The original AC3D OBJ exporter also has some bugs. Sometimes, I think when you use textures, it starts the texture coordinate count at 2 not 1, so the first vt is never used and the last f line has a wrong vt (vt_lines + 1)
chono00
15th April 2006, 09:52 AM
Also I think AC3D groups option is not working.
The plugin writes AC3D groups info, but AC3D does not parse it.
Dennis
15th April 2006, 12:40 PM
I see the material you're talking about --- at the bottom of the vehicle and the turret, correct? I'm not sure why the AC3D loader isn't recognizing these assignments. I loaded the OBJ model into trueSpace, and all materials show up fine.
So this seems to be a problem with the OBJ loader, not the exporter.
Let me know if you find anything that may be related to the exporter, and I'll be glad to have a look at it.
Oh, and send a private message to Andy to get the ac_plugin.h header - it's part of the AC3D SDK.
Dennis
Dennis
15th April 2006, 12:57 PM
Probably worth mentioning, and anyone feel free to correct me here, but I think the main purpose of the importers/exporters in AC3D are to get the geometry loaded/saved --- materials are tricky, because not all applications treat them the same.
A good example of this is the OBJ format and applying textures. OBJ allows multiple textures per object, but AC3D only allows one texture per object --- this makes importing objects with textures problematic, as a choice had to be made between splitting up the object into multiple objects to support different textures (thus losing shared vertex advantages), and loading only one texture (the loader author went with the latter, probably a good choice as the geometry is often more important than the surfacing when loading into a modeler).
This is likely causing the materials not to load properly per-surface as well...
chono00
16th April 2006, 12:35 AM
Thanks Dennis!!! Your work and cooperation really helped me!!!
I think the problem is in (as you said) the OBJ importer. Seems like the AC3D OBJ importer and exporter modules are very simple (missing a lot of features).
Dennis
16th April 2006, 01:20 AM
Thanks chono00
I actually tried an OBJ importer, but ran into the same problem the original author did when it came to importing data with multiple textures...
It's possible to come up with an importer that imports surfaces with different textures into different objects when possible, and prompts the user for a choice of actions when importing files where shared vertices will be split because of multiple textures. I just never spent the time to go through all that...
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.