SolidWorks Exporter

Announcements, information, requests and support regarding other exporters and general/new exporters
User avatar
xrok1
Posts: 287
Joined: Wed Jun 13, 2007 11:26 am

Post by xrok1 » Fri Jul 27, 2007 10:19 am

o.k i tried a different .ASM here's what i got. but i still can only get the geometry_export to work . below is debug report when trying idigo_export.

P.S where is the geometry actually created because i can't seem to find it?
Attachments
Capture4.JPG
geometry_export
Capture4.JPG (216.23 KiB) Viewed 8864 times
error5.JPG
indigo_export
error5.JPG (46.66 KiB) Viewed 8864 times

User avatar
xrok1
Posts: 287
Joined: Wed Jun 13, 2007 11:26 am

Post by xrok1 » Fri Jul 27, 2007 10:48 am

now i got the first .ASM to work by selecting skylight.
Attachments
Capture5.JPG
Capture5.JPG (177.4 KiB) Viewed 8858 times

jeffr
Posts: 120
Joined: Sun Jan 28, 2007 2:08 pm

Post by jeffr » Fri Jul 27, 2007 10:56 am

The section you show is where the geometry is extracted.
Simplified the assembly is 'traversed' from one part to the next. Tessalate converts the geometry. The xyz points are in an array which is then written to the file.

Have you tried making another macro button on the toolbar for the other macro that isn't working for you? Maybe it's another one of those strange things going on.

User avatar
xrok1
Posts: 287
Joined: Wed Jun 13, 2007 11:26 am

Post by xrok1 » Fri Jul 27, 2007 11:17 am

sorry, i meant the geometry 'file'. it seems on further investigation it seems the file is created wherever the SW file is saved. but, are you using .obj or .igs? because in your original post it says .obj?

and yes both the macros are buttons.

jeffr
Posts: 120
Joined: Sun Jan 28, 2007 2:08 pm

Post by jeffr » Fri Jul 27, 2007 12:33 pm

The one macro exports an obj for the geometry and an Indigo file for the scene set up, lights, materials etc. The other exports completely into an Indigo file (using igs as in an indigo file even though igs is already a 3d format. Indigo really should use a different extension to avoid confussion )

If you use the SW_Indigo_Export it exports the obj and sets the indigo file to use it. If you use the Indigo_Geometry_Export it exports the geometry in the indigo file. Going from one macro to the other will overwrite the indigo file.

I haven't decided which version is the best route yet. With exporting the obj I originally had some issues but I think I've overcome that and can go that way and still get the results I want but that needs more testing. That's why I've put both versions up.

User avatar
xrok1
Posts: 287
Joined: Wed Jun 13, 2007 11:26 am

Post by xrok1 » Fri Jul 27, 2007 12:52 pm

i think the obj option is a much better way to go. it kills 2 birds with 1 stone because SW doesn't currently offer obj export and this would open up a world of possibilities for post SW work such as sds and freeform edits in a less constrictive environment, pre render.

on a side note now that you've explained, its the indigo exporter that works for me not the obj exporter. sorry for the confusion. have you considered renaming your macros to SW_Indigo_Export.swp and SW_Indigo_obj_Export.swp might be a little less confusing.

jeffr
Posts: 120
Joined: Sun Jan 28, 2007 2:08 pm

Post by jeffr » Fri Jul 27, 2007 2:39 pm

I was hoping I could make the obj export version do what I want also. It does actually allow (and I say this very quietly-using other renderers for the same obj file) it also allows easy adjusting of the scenes without having to re-export the model geometry.
I will focus on that version.

User avatar
xrok1
Posts: 287
Joined: Wed Jun 13, 2007 11:26 am

Post by xrok1 » Fri Jul 27, 2007 3:21 pm

i can only get it to work if i change (tess.GetVertexNormal(i)) to (tess.IGetVertexNormal(i)) but then the normals are all screwed?

jeffr
Posts: 120
Joined: Sun Jan 28, 2007 2:08 pm

Post by jeffr » Fri Jul 27, 2007 4:01 pm

xrok1 wrote:i can only get it to work if i change (tess.GetVertexNormal(i)) to (tess.IGetVertexNormal(i)) but then the normals are all screwed?
Assuming this is the version that doesn't export obj. I'm wondering what's different. It has been working for me except for the odd part would cause some problem.
The error would report a problem at line 0 column 0 according to Indigo. Not sure what the difference is between the parts. I've recreated the part and it would be fine.

User avatar
xrok1
Posts: 287
Joined: Wed Jun 13, 2007 11:26 am

Post by xrok1 » Fri Jul 27, 2007 4:52 pm

this is from the obj export version it does export a nice obj if i change this code (looks good in HEX 2.2)but like i said the normals are wrong so it won't render properly.

i tried making a hybrid by adding the appropriate code from the obj version so that the igi version would export an obj while its doing its stuff because it deals with normals fine, but then i get an error @ 55Open FileName + ".obj" For Output As 1? if i skip that one line in the debugger everything else completes it just won't open the .obj or create it.

i'll attach the swp so you can see it, then maybe you could try getting rid of the strickly igi exporter to make communication about this topic a little easier. :wink: [/i]

P.S i like the idea of choice of renderers as well but don't tell anyone :lol:
Attachments
SW_Indigo_Export_Hybrid.zip
(161.06 KiB) Downloaded 316 times

jeffr
Posts: 120
Joined: Sun Jan 28, 2007 2:08 pm

Post by jeffr » Sat Jul 28, 2007 12:52 am

Haven't had a chance yet to look at what you did but I will (have to sneak it in here at work. shhhh! 8) ).
The original code was just exporting the obj and it worked great but I ran into issues with creating and using materials so I went fully Indigo. Obviously messed something up with the obj export.
I think we can go back to exporting the obj but I'm pretty sure we'd have to export each part as a separate obj rather than one all inclusive bigger file, to avoid the materials issues I was having.
I started arranging the code to do that last night so should be able to get it to you tonight.

User avatar
xrok1
Posts: 287
Joined: Wed Jun 13, 2007 11:26 am

Post by xrok1 » Sat Jul 28, 2007 6:21 am

your code already exports with seperate objects and materials; sort of. if you open one of the obj files in Hex or Carrara their are seperate objects and materials their just all the same color. so it looks like the mat domains are there but the default material is applied to them for some reason.


P.S if you change your export scale to 39.3738 its just about perfect. if you're in inches in SW that is. but i think that what most of us work in anyway.

jeffr
Posts: 120
Joined: Sun Jan 28, 2007 2:08 pm

Post by jeffr » Sat Jul 28, 2007 8:32 am

The reason I'm thinking export separate obj's is because I haven't figured out how to get Indigo to take the uv coordinates with a single file.
This isn't important to get most materials but any that use an image map for the texture or a bump map we need it.

With the scale, I found that the output values need to be a certain range of values for the best image so I'm trying to set the scale based on the numbers rather than the actual units being used. I tried it with the units but depending the size of the scene and camera positioning I found I had some bad results.

User avatar
xrok1
Posts: 287
Joined: Wed Jun 13, 2007 11:26 am

Post by xrok1 » Sat Jul 28, 2007 9:16 am

maybe you could make the obj and igs exports use different scales, scal1 and scal2, best of both worlds.
this was the idea of the hybrid, think of each file(obj &igs)as a seperate process not dependent on oeach other. that way you can concentrate on making an obj thats a good obj because the igs is still produced and sent to indigo at the same time.

jeffr
Posts: 120
Joined: Sun Jan 28, 2007 2:08 pm

Post by jeffr » Sat Jul 28, 2007 4:30 pm

I've updated the file again.
Now the zip file only contains the version that exports geometry as an obj file.
The UV's are working so there's just some work to do on using the solidworks appearance call outs to create materials within sw.

Give it a try and see what problems you come up with.
I provided a box to enter the scale in. I will give it the ability to remember what scale you used the last time it run so it's not a pain every time you call it up.

Cheers
Jeff

Post Reply
102 posts

Who is online

Users browsing this forum: No registered users and 1 guest