To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cad.devOpen lugnet.cad.dev in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / Development / 9738
9737  |  9739
Subject: 
Re: Blender LDraw support
Newsgroups: 
lugnet.cad.dev
Date: 
Thu, 15 Jul 2004 14:35:48 GMT
Viewed: 
1826 times
  
On Mon, 12 Jul 2004 23:14:49 +0000, James Reynolds wrote:

In lugnet.cad.dev, Yann Vernier wrote:
I hope this isn't off topic for this list. I've begun writing some
scripts for Blender to import (and eventually export) LDraw DAT files.

Script location (currently 5KB):
  http://donkey.dyndns.org/~yann/datimport.py

Any comments?

I'm not a Blender user.  Yet.

I would like MPD support if/when I start using Blender and your script.

Well, I'm a bit further along now. No MPD support yet, but it'll be easy
to add. It now supports hierarchical loading with piece recognition,
loading even the Masakari model in a tolerable amount of time. In the
process I noticed not all parts seem to have a type tag, so anything
called "Official LCad update" (like part 4275) is recognized as a part.
Perhaps the type should be triggered by its location instead. Part 3660
had no type line at all so was not detected. The library I'm using is from
the zipped LDraw+updates from ldraw.org.

Blender seems to filter some matrices. The upper left 2420 in the VW type
82 model (as you can see, I took sample models from MOTM..) gets its angle
about 15 degrees off. This problem also occurs for some primitives if part
detection doesn't work right (6246c.dat). If someone knows where I got the
matrix conversions wrong, please let me know. (Failing to detect parts may
also trigger other problems, such as 0-scaled primitives.)

TODO:
1. Complete the material assignment code. Currently tries to assign
    indices, unknown results.
2. Implement MPD, should be rather simple. Perhaps this would be a good
    place for a progress bar as well.
3. If possible, fix the matrix handling so objects get rotated correctly.
4. Fine-tune model type detection.
Possibly fix step support for submodels - currently the step animations
will only work for direct children of the first loaded file. Perhaps add
scaling adjustments like the seam code for L3P.

New features include an attempt to detect smooth faces; any face matching
the ends of a conditional line is marked for AutoSmoothing. Ordinary lines
are still ignored.

My "tolerable amount of time" is certainly not fast, by the way; the model
loads with ldglite -l3 in less than 3 seconds, while my script takes
nearly 30. Still, I don't think that's too shabby. That's with duplicate
vertex elimination, winding up at nearly 450800 vertices. Disabling vertex
elimination gives much quicker code, 9 seconds for almost exactly 1000000
more vertices. I don't know how many of all those vertices could be
eliminated with Blender's function (which doesn't use floating point
equality) but the number can definitely be lowered, as part 3660 was not
merged into one mesh.



Message has 1 Reply:
  Re: Blender LDraw support
 
(...) Part detection is problematic due to changes over time in the library. For reference, LDView uses the following to identify parts: File is in the Parts directory, and isn't a descendent of any other parts at the time the file is loaded (sub (...) (20 years ago, 15-Jul-04, to lugnet.cad.dev)

Message is in Reply To:
  Re: Blender LDraw support
 
(...) I'm not a Blender user. Yet. I would like MPD support if/when I start using Blender and your script. (20 years ago, 12-Jul-04, to lugnet.cad.dev)

17 Messages in This Thread:






Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR