Check later posts by TL for working plugin...
Check later posts by TL for working plugin...
Have you seen this thread form 2009?
http://www.photonlexicon.com/forums/...hlight=blender
Kudos for your work dream! I tried doing dxf export from Sketchup a few months ago, but it didn't go so well.
Free sketchup can't export a view, only the object to dxf I think I used. Fair enough.
Ildasos is able to convert it (make sure optimization is off) to ilda object or ilda frame, and laserboy could rotate it but I think I had issues with zoom or something. But you just end up with too many faces on objects once projected. It might be possible to use them with a clipping plane to cut off the back half, but still there was enough optimization that would need to be done on what I had it would be easier to trace it from an image.
Blender export with means to get to ilda could possibly be a way to get results like the killer Pangolin plugin for 3dsmax. That would be killer!
I've an dxf exporter based on the svgwriter ready for months, but was just too lazy for a nice GUI around it.
ILD SOS even supports color gradients on lines and the "sample raster" should also work with svg files.
I think I could add a GUI around this the next days/weeks, so it's easier to use. Currently I'm editing my export script for the various options
the vector renderer from Blenders provides.
Thomas
Color gradients are simply a colorfade from one to another color.
I've just tested the sample raster function with svg files and it really doesn't work...
Currently the script is really messy, it was done in a few minutes based on my previous work with blender and dxf files.
Give me some time to clean this a little up... ;-)
Out of interest, what bugs did you encounter in the original svg script?
This can't be possible, since the rendere can only transform objects with surfaces to lines...Quote:
It's also pity that this renderer ignores points and lines that aren't part of a polygon. I wanted to create some line abstracts but ended up with nothing. I've thought of a workaround but it doesn't work for all shapes, only works with orthogonal camera and produces dublicate vertices.
Regarding freestyle scripting, it's virtually nowhere documented... This is also my problem regarding the GUI options for the dxfWriter...
so here is the dxfWriter for Blender.
Download
Just copy it to the Blender/scripts/freestyle/style_modules/ directory and assign it as style module in Blender.
It respects the percentage scale for rendering and does proper frustum culling. Currently it doesn't support RGB colors,
instead it maps the rendered colors to the standard dxf palette. But I think this isn't a big problem, since ILD SOS can overlay
the colors from the rendered images...
Currently no GUI is provided for the writer for controlling which edge types are exported. But I'm working on this.
I'm currently using the dxfWriter in one Layer and other Layers for the various freestyle rendering options.
All I have to do is rendering twice, one pass for writing the dxf files and one pass for the bitmap files.
Afterwards both are combined with ILD SOS. To help ILD SOS use a relative thick line in freestyle for rendering.
Here's a small example including shading (not testet on a real preojector, but should display ok).
Only Blender and ILD SOS were used...
Objects inside Blender:
Attachment 41113
ILD SOS:
Attachment 41114
Nice work both! Looking forward to what comes off this...
There are few problems in my opinion:
1) as this had to be done in pythons, it would be very slow
2) we would have to uses the same 3d to 2d algorithm as blender internal and decide afterward which points/lines are visible due to objects behind other objects etc.
maybe there is another solution for this...
It does use a approximated color at the moment, it can be changed easily, it's only a question of time...
I'm really curious about your results...
I will put it on my web page...
Thomas
Nice work. In the ilda file posted in 11 above, it appears that the corner sensitivity is a little too high, or some other little bug, as occasionally a non-corner edge is drawn inside the wheel and on its side. Other than that, it's good progress and with the faster render times I look forward to trying this again sometime.
Yes, I know. This is the problem with selecting edges in the dxfWriter. Since there is no GUI at the moment a default setting for selecting edges is used. As soon as the GUI is completed, a much finer control about the edges is possible...
Until now this was not so much work, the GUI is the challenge...
Yes, it has to be in the style_modules dir.[/quote]
I will have a look later...
new version with GUI for control of the exported edges.
Download
Install instructions:
copy dxfWriter.py dxfColorMap.py and dxfLibrary130.py to the Blender\2.69\scripts\freestyle\style_modules directory.
install dxfWriterGUI.py as addon:
Attachment 41259
Attachment 41260
and enable the dxfWriterGUI addon with the checkmark.
as soon as freestyle is enabled and the dxfWriter module is loaded the settings for dxfWriter appear in the Render Layer panel.
Attachment 41261
These options are the same as in the Parameter Editor settings...
if the dxfWriter module is not loaded, the settings will not be displayed.
It would be nice, if people using this, would post some pics of their work... :-)
Thomas
Wow, Thomas, WTG!
I might find this handy one day.... when I get blender :P [edit] downloading now[/edit]
Keeping a close eye on this thread :)
Keith
That would be cool, currently I don't have the time for this... and I'm not good at writing documentation... :-)
Currently I'm working on this and it's almost finished. This was a complete rewrite of the dxf output, since truecolor is only supported by R14 Acad dxf file upwards and the file format is much more complicated...
Also added an own color shader to my freestyle modul to get the correct colors from blender. pyMaterialColorShader does some strange modifications to the colors.
When working with line particles, these are rendered as boxes, so these work. Keep the width of the lines as small as possible, else the point count of the converted ilda explodes...
new version 0.0.3 Download
Changes:
- true color output ( now outputs R14 dxf files)
- different color shader, which takes directly the material color from the object
I think this is better handled in a color shader, not in the vector output...
In the upcoming blender version 2.70 it's planned to add the ability to append script modules to the "parameter editor mode" so there will be completely new possibilities. And in this context, I would prefer writing a color shader, which is more universal...
yes I think using freestyle. Using the "distance from object" and "distance from camera" it's possible to create depth shadings...
these are in the linestyle / color settings...
Attachment 41431
This is not a bug in dxfWriter, it was the original coloring in the Blender file...
New version online with experimental coloring from the rendered image.
Download dxfWriter 0.0.4
Note, the results from this are highly dependent on the blend file. Best results are achieved when the edges are inside the texture of the objects.
If the edges are at the outline, the result is mostly not so good...
Also the result varies at different sizes, I suggest 1024x1024.
This was a quick hack/test, so please report your results, maybe with attached .blend files... :-)
ILD SOS
Attachment 42460
Blender
Attachment 42461
It adds the color from the rendered image directly to the points/lines inside the dxf file. So ILS SOS's recoloring isn't needed anymore...
And yes in the rendered images the color is from the freestyle module.
yes the bitmap images get the object color. if you need the original coloring also in the bitmap files, the only option is actuall to render twice.
one time with freestyle and one time without freestyle...
just change your directory for ren der output...
- change the render directory
- render with freestyle
- change the render directory again
- render without freestyle
in the first dir are the correctly colored dxf files and wrong bitmap files
in the second dir are the correct bitmpap files
just a workaround until the next release... ;-)
die you enable the rendered colors in the dxfWriter options?
maybe you didn`t update the dxfWriter GUI plugin?
@dream:
dxfWriter doesn't sort the lines, it just takes the edges from freestyle...
new version for Blender 2.70:
Download
New in this version:
- support for Blender 2.70
- new color shader for getting the color from the rendered image (basically the same as in the last version, but displays the correct colors in the render window, instead of white)
Many thanks for this plugin !
It's the best thing I found so far to get vector output from Blender and import to Flash !
Two questions though :
- Can I get DXF output in an older DXF format ? (unlikely because you said you rewrote output to get R14 that supports true color)
- Straight lines are in fact made up from many segments. Is this because of the Freestyle rendering ?
Thanks again !
@magus:
it's great seeing use of this plugin! :-)
@pjgfi:
unfortunately, I'm using currently the R14 format as you said and I don't want to support R13 anymore. since the lack of true color support.
regarding lines, this depends on the original objects/meshes, my plugin just takes the Freestyle lines and puts them into the dxf file.
If I would use the chaining option from Freestyle I could combine them into one line again.
I think I will add this as option.
Great ! Thanks ! :)
Here's what I managed to get from the DXF export (3D model by Andre Schneider, a colleague did the Blender part) :
http://www.swfcabin.com/open/1397474708
It works great but could lose weight with some line optimization :p :
Attachment 42864
Sorry, I forgot to mention this has nothing to do with laser projection ! I just posted here because I searched a Freescape to Flash export and that was the best thing I came across.
I hope you don't mind :angel:
We all want straight and simple lines in the end !
New version 0.0.6 with chaining support
By default it's disabled, because ILD SOS normally takes care of this.
Download
Attachment 42925
@Dream:
maybe you could try again your circle, when you complained about the blanking path...
Chaining does not necessarily create an laser optimized frame. It just connects edges which touch each other.
It's feature from freestyle. If "same object" it only connects edges from the same object, if they intersect with other objects.
SVG support would no problem, it's just another file writer instead of the dxf one.
About the optimization options, depending on my time i *might* add these...
And regarding realtime laser output, which DAC's should be supported?
3D isn't possible at all with dxfWriter, since it based on the 2D freestyle output.
Does LSX support 3d dxf import?
small animation using Blender and the physics engine of it:
Attachment 42938
ILD file is optimized for 30K and has around 1000 points per frame
Attachment 42939
The flicker of the animation is ok, could be a little bit less... ;-)
I think the demo blends should be separated from the plugin... Example files are always a good idea, especially with this, since the models should be low poly and the output resolution should not be too high.
Thanks for this new version, I'll let you know how chaining works for me !
I've got a little problem with some frames (nothing to do with the Chaining function though).
Attachment 42979
Any idea on what's happening ?
Thanks for your comment. In my animation, it appears on consecutive frames (3) at two or three moments.
We checked and we actually did not had "Culling" checked ! What is it supposed to do ? Clipping ? It's weird because the stroke is OK but it's way too long.
@pjgfi:
could you send me the blend file? then I could check this...
@TL : file sent !
@magnus : thanks for the info !
I found it, it was a bug in my viewport clipping code...
Additionally you can select now a group to include/exclude from the rendering:
Attachment 42986
This is perfect for rendering complex animations for 2 or more projectors... *warn
New version: Download
this is a little bit complicated, I think the long lines are really a freestyle bug... but this is corrected by my viewport clipping. I had to do this since freestyle does no exact viewport clipping (only lines completely outside from the viewport are clipped). In my clipping code was a bug which was triggered when the second point of a clipped line was inside the viewport...
It's perfect now, many thanks !
great examples!
could you show me a frame, where this happens?
in the example "8 - curve path modifier" the first frame?
Attachment 43003
To get the gap closed, you the "face smoothness" option in freestyle...
here's a good explanation for this: http://freestyleintegration.wordpres...ovember-15-28/
regarding the materials inside a mesh, currently I've no idea how freestyle decides which material to take... I will have a look at this...
I noticed that too and made a bug report: https://developer.blender.org/T43082
"The reported behaviour of the SVG exporter is a feature and not a bug. The rationale is that individual lines in an exported figure are SVG paths, each of which can have a fixed color, transparency, and line width. Hence only the base line color, alpha and thickness specified in a line style are applied to SVG lines. All modifiers for these line properties are simply ignored. On the other hand geometry modifiers are taken into account."
So, unfortunately, they won't implement colours, because svg strokes can only have one colour. Somebody might alter it so that for each stroke, the material colour is used instead of the Base Color as it currently is (hint to the python guys...)
I couldn't get the DXF animation plugin to work with 2.73 so had to downgrade. But it could be I simply messed up when installing...