====== Differences ====== This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
stamp [2015/08/18 11:25] damien created |
stamp [2015/08/20 10:29] (current) damien |
||
---|---|---|---|
Line 3: | Line 3: | ||
====== Usage ====== | ====== Usage ====== | ||
- | At the moment, the Blender binary has to be downloaded from the [[https://builder.blender.org/|Blender Buildbot]], or compiled from the latest git version, as it includes the Text Sequence used in the script. | + | As of august 2015, the Blender binary has to be downloaded from the [[https://builder.blender.org/|Blender Buildbot]], or compiled from the latest git version, as it includes the Text Sequence used in the script. |
Right now, the path to the **blender binary** has to be specified in the stamp.py file, in the ''blender_bin'' variable. | Right now, the path to the **blender binary** has to be specified in the stamp.py file, in the ''blender_bin'' variable. | ||
The script is written in Python, and uses Blender for image marking and rendering. The script is command-line only at the moment. To get usage help, type: | The script is written in Python, and uses Blender for image marking and rendering. The script is command-line only at the moment. To get usage help, type: | ||
<code>python stamp.py --help</code> | <code>python stamp.py --help</code> | ||
- | |||
- | |||
- | ===== Metadata mode ===== | ||
- | pass :) | ||
Line 33: | Line 29: | ||
]</code> | ]</code> | ||
- | You then have to pass arguments to the program according to the template, such as: ''%%--plan P12%%''. Alternatively, you can use the ''%%--default%%'' option to use //all// fields defined in the template, with their default values. | + | You then have to pass arguments to the program according to the template, such as: ''%%--plan P12%%''. **Alternatively**, you can use the ''%%--default%%'' option to use //all// fields defined in the template, with their default values. |
+ | |||
+ | ===== Metadata mode ===== | ||
+ | The **Metadata mode** is similar to the Template Mode, but it uses a json string, passed in command line to the ''%%--metadata%%'' argument, to generate fields. For example, the following string will create an “A text” field and a “Frame” field: | ||
+ | <code>--metadata '[{"field":"A text", "value":"Salut !", "color":[1.0,0.5,0.5]}, {"field":"Frame", "inline":false, "color":"#0137F0"}]'</code> | ||
+ | |||
+ | |||
+ | ===== Special fields ===== | ||
+ | Some fields have a special behaviour. | ||
+ | * **Frame** and **Timecode** respectively print the frame and timecode, read from the file name. | ||
+ | * **Date** prints the specified string, or defaults to today's date in DD/MM/YYYY format. | ||
+ | |||
+ | |||
+ | ===== Example template ===== | ||
+ | <code>{ | ||
+ | "settings": | ||
+ | {"resolution": | ||
+ | [1920,1080] | ||
+ | }, | ||
+ | |||
+ | "metadata": | ||
+ | [ | ||
+ | { | ||
+ | "position": "BOTTOM-LEFT", | ||
+ | "value": "S001", | ||
+ | "size": 15, | ||
+ | "color": "#FF0000", | ||
+ | "inline": false, | ||
+ | "field": "S\u00e9quence" | ||
+ | }, | ||
+ | { | ||
+ | "position": "BOTTOM-LEFT", | ||
+ | "value": "P01", | ||
+ | "size": 15, | ||
+ | "color": [ | ||
+ | 0.0, | ||
+ | 0.0, | ||
+ | 1.0 | ||
+ | ], | ||
+ | "inline": true, | ||
+ | "field": "Plan" | ||
+ | }, | ||
+ | { | ||
+ | "position": "BOTTOM-LEFT", | ||
+ | "value": null, | ||
+ | "size": 15, | ||
+ | "color": [ | ||
+ | 0.0, | ||
+ | 0.0, | ||
+ | 1.0 | ||
+ | ], | ||
+ | "inline": false, | ||
+ | "field": "Frame" | ||
+ | }, | ||
+ | { | ||
+ | "position": "BOTTOM-LEFT", | ||
+ | "value": null, | ||
+ | "size": 15, | ||
+ | "color": [ | ||
+ | 0.0, | ||
+ | 0.0, | ||
+ | 0.0 | ||
+ | ], | ||
+ | "inline": true, | ||
+ | "field": "Timecode" | ||
+ | }, | ||
+ | { | ||
+ | "position": "TOP-LEFT", | ||
+ | "value": "today", | ||
+ | "size": 15, | ||
+ | "color": "#00FF00", | ||
+ | "inline": false, | ||
+ | "field": "Date" | ||
+ | } | ||
+ | ] | ||
+ | }</code> | ||
+ | |||
+ | This template generates the following image: | ||
+ | |||
+ | {{::template_0018.png}} | ||
====== External Links ====== | ====== External Links ====== | ||
[[https://github.com/LesFeesSpeciales/tools/tree/master/various_scripts/stamp/|Script on GitHub]] | [[https://github.com/LesFeesSpeciales/tools/tree/master/various_scripts/stamp/|Script on GitHub]] |