discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Can I force Animation to use "Render" instead of "Preview"?

M
MichaelAtOz
Mon, Nov 30, 2015 6:21 AM

Another dropped post. New user with external links as first post - anti SPAM
probably.

From Bruno: (you animators should know this one)

---====================
I have a very complex animation that I am trying to Render as an animation.
Unfortunately, it looks terrible as a Preview. (The seams of objects I am
differencing have a film.) I would like to use Render on all 360 frames, but
don't want to render them one by one. Using animation would be great but it
produces Preview like results.

Sample:
https://dl.dropboxusercontent.com/u/310759/u/fuse_block_preview.png

vs.

https://dl.dropboxusercontent.com/u/310759/u/fuse_block_render.png

.!# BrunoBronosky #!.


Newly minted Admin - PM me if you need anything, or if I've done something stupid...

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.

The TPP is no simple “trade agreement.”  Fight it! http://www.ourfairdeal.org/  time is running out!

View this message in context: http://forum.openscad.org/Can-I-force-Animation-to-use-Render-instead-of-Preview-tp14828.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Another dropped post. New user with external links as first post - anti SPAM probably. >From Bruno: (you animators should know this one) ===================================================== I have a very complex animation that I am trying to Render as an animation. Unfortunately, it looks terrible as a Preview. (The seams of objects I am differencing have a film.) I would like to use Render on all 360 frames, but don't want to render them one by one. Using animation would be great but it produces Preview like results. Sample: https://dl.dropboxusercontent.com/u/310759/u/fuse_block_preview.png vs. https://dl.dropboxusercontent.com/u/310759/u/fuse_block_render.png .!# BrunoBronosky #!. ----- Newly minted Admin - PM me if you need anything, or if I've done something stupid... Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above. The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out! -- View this message in context: http://forum.openscad.org/Can-I-force-Animation-to-use-Render-instead-of-Preview-tp14828.html Sent from the OpenSCAD mailing list archive at Nabble.com.
M
MichaelAtOz
Mon, Nov 30, 2015 6:24 AM

I'm no expert on animation, you could try wrapping it in render() {...}


Newly minted Admin - PM me if you need anything, or if I've done something stupid...

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.

The TPP is no simple “trade agreement.”  Fight it! http://www.ourfairdeal.org/  time is running out!

View this message in context: http://forum.openscad.org/Can-I-force-Animation-to-use-Render-instead-of-Preview-tp14828p14829.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

I'm no expert on animation, you could try wrapping it in render() {...} ----- Newly minted Admin - PM me if you need anything, or if I've done something stupid... Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above. The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out! -- View this message in context: http://forum.openscad.org/Can-I-force-Animation-to-use-Render-instead-of-Preview-tp14828p14829.html Sent from the OpenSCAD mailing list archive at Nabble.com.
N
Neon22
Mon, Nov 30, 2015 12:03 PM

The Render operation is only repeated if it is required.
So it might not take a lot longer to Render() each frame depending on eth
nature of the animation.

--
View this message in context: http://forum.openscad.org/Can-I-force-Animation-to-use-Render-instead-of-Preview-tp14828p14831.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

The Render operation is only repeated if it is required. So it might not take a lot longer to Render() each frame depending on eth nature of the animation. -- View this message in context: http://forum.openscad.org/Can-I-force-Animation-to-use-Render-instead-of-Preview-tp14828p14831.html Sent from the OpenSCAD mailing list archive at Nabble.com.
MK
Marius Kintel
Mon, Nov 30, 2015 12:37 PM

The animation is always Preview.
Your best bet is to make preview look nicer. In your case, try to make negative objects slightly larger so that you don’t get z fighting.
See the FAQ: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/FAQ#What_are_those_strange_flickering_artifacts_in_the_preview.3F

-Marius

The animation is always Preview. Your best bet is to make preview look nicer. In your case, try to make negative objects slightly larger so that you don’t get z fighting. See the FAQ: https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/FAQ#What_are_those_strange_flickering_artifacts_in_the_preview.3F -Marius
J
jpmendes
Mon, Nov 30, 2015 9:19 PM

Hi, I made this animation pre-rendering all the components  video-02.mp4
http://forum.openscad.org/file/n14840/video-02.mp4  . It was very time
consuming and definition is not as good as I expected.
Question: is there a way to achieve better video definition?

Best regards

João Mendes

--
View this message in context: http://forum.openscad.org/Can-I-force-Animation-to-use-Render-instead-of-Preview-tp14828p14840.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Hi, I made this animation pre-rendering all the components video-02.mp4 <http://forum.openscad.org/file/n14840/video-02.mp4> . It was very time consuming and definition is not as good as I expected. Question: is there a way to achieve better video definition? Best regards João Mendes -- View this message in context: http://forum.openscad.org/Can-I-force-Animation-to-use-Render-instead-of-Preview-tp14828p14840.html Sent from the OpenSCAD mailing list archive at Nabble.com.
TP
Torsten Paul
Mon, Nov 30, 2015 10:02 PM

On 11/30/2015 10:19 PM, jpmendes wrote:

Hi, I made this animation pre-rendering all the components  video-02.mp4
http://forum.openscad.org/file/n14840/video-02.mp4  . It was very time
consuming and definition is not as good as I expected.
Question: is there a way to achieve better video definition?

From the GUI it's currently not possible to set a specific resolution,

it always uses the window size, just grabbing the displayed image.

You can generate the animation from command line, e.g. using a script
like below. That way it's possible to define the image size within
the bounds your graphics driver will allow. I've used the example
Advanced->Animation that ships with the latest release.

Note that it needs an additional "$t = 0;" at the beginning of the
file to make the "-D" parameter work.

Result with HD resolution => http://files.openscad.org/tmp/animation-test.mp4

ciao,
Torsten.

---snip---snap---snip---snap---snip---snap---snip---snap---snip---snap----

#!/bin/bash

STEPS=200
PATTERN=%04d.png

for a in $(seq 0 $STEPS)
do
FILE=$(printf "$PATTERN" $a)
echo "$FILE"
openscad
--imgsize=1920,1080
--camera=0,0,0,60,0,40,300
"-D$t=$a/$STEPS"
-o "$FILE" animation.scad \

/dev/null 2>&1

done

ffmpeg -i "$PATTERN" -c:v libx264 -r 30 -pix_fmt yuv420p animation.mp4

---snip---snap---snip---snap---snip---snap---snip---snap---snip---snap----

On 11/30/2015 10:19 PM, jpmendes wrote: > Hi, I made this animation pre-rendering all the components video-02.mp4 > <http://forum.openscad.org/file/n14840/video-02.mp4> . It was very time > consuming and definition is not as good as I expected. > Question: is there a way to achieve better video definition? > >From the GUI it's currently not possible to set a specific resolution, it always uses the window size, just grabbing the displayed image. You can generate the animation from command line, e.g. using a script like below. That way it's possible to define the image size within the bounds your graphics driver will allow. I've used the example Advanced->Animation that ships with the latest release. Note that it needs an additional "$t = 0;" at the beginning of the file to make the "-D" parameter work. Result with HD resolution => http://files.openscad.org/tmp/animation-test.mp4 ciao, Torsten. ---snip---snap---snip---snap---snip---snap---snip---snap---snip---snap---- #!/bin/bash STEPS=200 PATTERN=%04d.png for a in $(seq 0 $STEPS) do FILE=$(printf "$PATTERN" $a) echo "$FILE" openscad \ --imgsize=1920,1080 \ --camera=0,0,0,60,0,40,300 \ "-D\$t=$a/$STEPS" \ -o "$FILE" animation.scad \ >/dev/null 2>&1 done ffmpeg -i "$PATTERN" -c:v libx264 -r 30 -pix_fmt yuv420p animation.mp4 ---snip---snap---snip---snap---snip---snap---snip---snap---snip---snap----
J
jpmendes
Mon, Nov 30, 2015 10:34 PM

Hi Torsten, thanks a lot. Unfortunately I use Windows. I will try a script
adaptation to my OS.
Regards

jpmendes

--
View this message in context: http://forum.openscad.org/Can-I-force-Animation-to-use-Render-instead-of-Preview-tp14828p14847.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Hi Torsten, thanks a lot. Unfortunately I use Windows. I will try a script adaptation to my OS. Regards jpmendes -- View this message in context: http://forum.openscad.org/Can-I-force-Animation-to-use-Render-instead-of-Preview-tp14828p14847.html Sent from the OpenSCAD mailing list archive at Nabble.com.
J
jpmendes
Mon, Nov 30, 2015 10:44 PM

Hi Torsten, may I use the script directly in the CYGWIN Windows environment?
Thanks in advance.

Regards
jpmendes

--
View this message in context: http://forum.openscad.org/Can-I-force-Animation-to-use-Render-instead-of-Preview-tp14828p14848.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Hi Torsten, may I use the script directly in the CYGWIN Windows environment? Thanks in advance. Regards jpmendes -- View this message in context: http://forum.openscad.org/Can-I-force-Animation-to-use-Render-instead-of-Preview-tp14828p14848.html Sent from the OpenSCAD mailing list archive at Nabble.com.
TP
Torsten Paul
Mon, Nov 30, 2015 11:00 PM

On 11/30/2015 11:44 PM, jpmendes wrote:

Hi Torsten, may I use the script directly in the CYGWIN Windows environment?

That might work, if some basic unix tools (in this case bash, seq, printf)
are installed.

Otherwise you could just generate a batch file using a good text editor,
excel, libreoffice... anything that makes it easy to generate lots of
lines and replace the number in the -D parameter.

(Not sure if the -D needs some quotes on Windows)

openscad.com --imgsize=1920,1080 --camera=0,0,0,60,0,40,300 -D$t=0/200 -o 0001.png animation.scad
openscad.com --imgsize=1920,1080 --camera=0,0,0,60,0,40,300 -D$t=1/200 -o 0002.png animation.scad
openscad.com --imgsize=1920,1080 --camera=0,0,0,60,0,40,300 -D$t=2/200 -o 0003.png animation.scad
.
.
.
openscad.com --imgsize=1920,1080 --camera=0,0,0,60,0,40,300 -D$t=199/200 -o 0199.png animation.scad

ciao,
Torsten.

On 11/30/2015 11:44 PM, jpmendes wrote: > Hi Torsten, may I use the script directly in the CYGWIN Windows environment? > That might work, if some basic unix tools (in this case bash, seq, printf) are installed. Otherwise you could just generate a batch file using a good text editor, excel, libreoffice... anything that makes it easy to generate lots of lines and replace the number in the -D parameter. (Not sure if the -D needs some quotes on Windows) openscad.com --imgsize=1920,1080 --camera=0,0,0,60,0,40,300 -D$t=0/200 -o 0001.png animation.scad openscad.com --imgsize=1920,1080 --camera=0,0,0,60,0,40,300 -D$t=1/200 -o 0002.png animation.scad openscad.com --imgsize=1920,1080 --camera=0,0,0,60,0,40,300 -D$t=2/200 -o 0003.png animation.scad . . . openscad.com --imgsize=1920,1080 --camera=0,0,0,60,0,40,300 -D$t=199/200 -o 0199.png animation.scad ciao, Torsten.