NatronGitHub / Natron

Open-source video compositing software. Node-graph based. Similar in functionalities to Adobe After Effects and Nuke by The Foundry.
http://NatronGitHub.github.io
GNU General Public License v2.0
4.68k stars 340 forks source link

Natron as Flipbooker (enhancement) [Add cmd line parameters] #151

Open devernay opened 6 years ago

devernay commented 6 years ago

From @nicholascarroll on March 28, 2016 22:56

Natron is a good flipbooker. Once it loads it is really fast and it accepts a lot of file types. Please implement command line arguments for read file start and end frames, and frame rate, so that from terminal it can be called, something like

natron myfile####.exr 1-100 24

EXAMPLE USE CASE You can configure Natron to be the Animation Player for Blender (Blender Preferences > System). This allows a convenient way to play the render output and if you want then save it and comp using Natron instead of the Blender compositor. This already works but... ...WITHOUT THIS ENHANCEMENT you have to manually adjust the frame range in Natron, because it plays all frames matching the mask myfile####.exr, and that can include frames from previous renders.

Copied from original issue: MrKepzie/Natron#1265

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/57509971-natron-as-flipbooker-enhancement-add-cmd-line-parameters?utm_campaign=plugin&utm_content=tracker%2F83915136&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F83915136&utm_medium=issues&utm_source=github).
devernay commented 6 years ago

From @olear on March 31, 2016 10:16

This could be scripted:

#!/bin/sh
NATRON="Natron"
TMP="/tmp/flipbook$$.py"
SEQ="$1"
FPS="$2"
FSTART="$3"
FSTOP="$4"

if [ -z "$SEQ" ] && [ -z "$FPS" ] && [ -z "$FSTART" ] && [ -z "$FSTOP" ]; then
  echo "Usage: flipbook.sh image_sequence fps start_frame end_frame"
  exit 1
fi

cat <<EOF >> "$TMP"
import NatronGui
reader = app.createNode("fr.inria.openfx.ReadOIIO")
viewer = app.getViewer("Viewer1")
reader = app.ReadOIIO1
reader.filename.set("${SEQ}")
reader.customFps.set(True)
reader.frameRate.set(${FPS})
viewer.setFrameRange(${FSTART},${FSTOP})
#viewer.connectInput(0,reader)
EOF

$NATRON -l "$TMP"
rm -f $TMP
exit 0

The only problem is that I don't know how to connect a node to a viewer ...

devernay commented 6 years ago

From @nicholascarroll on April 1, 2016 1:1

Yes that is a better way, thanks. I will try to expand on that, with Blender as use case. I'll upload what I make here.

devernay commented 6 years ago

From @nicholascarroll on April 1, 2016 23:37

looks like there is a bug attaching viewer to readers

devernay commented 6 years ago

From @nicholascarroll on April 3, 2016 1:44

I had a play and realized that in OSX the best way to do this is with the open command: open -a /Applications/Natron.app/Contents/MacOS/Natron myimage.exr So it probably would be best to implement the framerange and fps params compiled into the natron binary.

Cheers

devernay commented 6 years ago

From @nicholascarroll on January 18, 2017 17:8

I noticed that Natron has a universal launch shell script now, and also I realized its of only marginal benefit to have OSX specific functionality for the open command. So, is it actually best to put this in the binary or just use the universal shell script?

devernay commented 6 years ago

From @nicholascarroll on February 23, 2017 0:3

Closing this because it the solution by olear is acceptable.

devernay commented 6 years ago

From @mangopipeline on February 23, 2017 0:56

While Olear solution is good, I'm not sure it should be acceptable, as this is very much tied to the the os... people will have a need for this on all OS, windows for example would require a much different .bat solution.

A better solution might be to put together a python script, or a second binary that could simplify natron gui down to via more dedicated viewer like...

devernay commented 6 years ago

From @nicholascarroll on February 23, 2017 17:0

OK I will reopen this so that @MrKepzie can comment. My main concern about using Natron as a flipbooker is the startup time of the application.

devernay commented 6 years ago

From @mangopipeline on February 23, 2017 17:38

Yes it's a fair enough concern, I think if there was a option in the executable to launch in "fast" mode that be great. it would be a much larger scope, but ideally the frame flipper would not need all the same components as full on natron... I like you think that with all the open source frame flippers having t been abandoned, Natron could be super useful in this space. and even if the startup is a bit slow, it would be a descent trade of for an open source solution :)

devernay commented 6 years ago

From @nicholascarroll on February 23, 2017 18:50

Maybe it could just open in existing natron instance as a reader.