leozide / leocad

A CAD application for creating virtual LEGO models
https://www.leocad.org
2.48k stars 212 forks source link

Export pieces' pivot points #90

Closed AlexGustafsson closed 3 years ago

AlexGustafsson commented 7 years ago

Right now exporting to .obj or .3ds does not keep the pivot points within LeoCAD. The expected behaviour is to export these as well. The current behaviour is that all pieces have their pivot point / origin in the world origin (0, 0, 0).

Both .3ds and .obj supports pivot points.

I took a look at both of the file specifications but I could not quite wrap my head around it enough to submit a PR.

leozide commented 7 years ago

I've looked into the 3ds pivots when I first added the exporter but couldn't get it to work correctly.

I didn't know there was support for it in obj files but I'm not sure how many applications support, it may be safer to keep things the way they are.

ghost commented 7 years ago

I didn't know there was support for it in obj files but I'm not sure how many applications support

As I know, V-REP simulator could import OBJ with pivots points.

But, as for me, for export 'rigged mesh' would be much better add "Export -> AC3D..."

ghost commented 7 years ago

I tried it, it works with the OBJ format, but the export loses the object names, for example, if I export one object composed of several parts, the OBJ file contains only a single mesh object and unfortunately for applications that want to interface (the open-source project for flight simulation named Flightgear) it is important that the individual parts have their own name. My idea is to figure out if it makes sense to to make a program to export to AC3D.

leozide commented 3 years ago

Collada exports files correctly and most applications support it, I'll leave the legacy formats alone.