<commit_before>== Appendices anchor:appendices_appendices[]

This section contains additional material to be referenced whilst using Gaffer.

It is composed of the following appendices:

* xref:appendices_hotkeys[Appendix A: Hotkeys]




=== Hotkeys anchor:appendices_hotkeys[]

.Global Hotkeys
[options="header",cols="20%,80%"]
|=======================
|Keypress|Result
|right-arrow|Increment current frame
|left-arrow |Decrement current frame
|`          |Set Gaffer to run in full-screen mode
|CTRL+z     |Undo last action
|SHIFT+CTRL+z|Redo last undone action
|CTRL+n     |Create blank script in new Gaffer session
|CTRL+o     |Launch dialog to open .gfr script file
|CTRL+s     |Save current script
|SHIFT+CTRL+s|Launch dialog to save current script with new file name
|CTRL-q     |Quit application
|======================

.NodeGraph Hotkeys
[options="header",cols="20%,80%"]
|=======================
|Keypress|Result
|f         |Frame current node selection, or all nodes if nothing selected
|d         |Disable/enable current node selection 
|+         |Zoom in !!!!not yet implemented!!!!
|-         |Zoom out !!!!not yet implemented!!!!
|tab       |Raise node creation menu and searchbox
|delete    |Delete current node selection
|backspace |Delete current node selection
|CTRL+a    |Select all nodes
|SHIFT+CTRL+a|Clear selection
|CTRL+x    |Cut current node selection
|CTRL+c    |Copy current node selection
|CTRL+v    |Paste node(s)
|=======================

[NOTE]
The copy/paste buffer for nodes persists between instances of gaffer, allowing you to quickly duplicate nodes between different scripts.
Also, as nodes are described by plain text you can cut and paste into emails/IM communications to share nodes with other users.

.Viewer Hotkeys - 3D mode
[options="header",cols="20%,80%"]
|=======================
|Keypress|Result
|f         |Frame current selection, or whole scene if nothing selected
|up-arrow  |Expand hierarchy of any selected bounding boxes
|down-arrow|Collapse hierarchy of any selected items/bounding boxes
|+         |Zoom in !!!!not yet implemented!!!!
|-         |Zoom out !!!!not yet implemented!!!!
|=======================

.NodeEditor Hotkeys
[options="header",cols="20%,80%"]
|=======================
|Keypress|Result
|up-arrow  |When focus is set to a numerical input field, this will increment the value of the field
|down-arrow|When focus is set to a numerical input field, this will decrement the value of the field
|tab       |Move focus to the next input field
|=======================

.ScriptEditor Hotkeys
[options="header",cols="20%,80%"]
|=======================
|Keypress|Result
|CTRL+a    |Select all text
|SHIFT+CTRL+a|Clear selection
|CTRL+x    |Cut current selection
|CTRL+c    |Copy current selection
|CTRL+v    |Paste
|enter     |Execute selected input text
|=======================<commit_msg>adding a few scripting nuggets to the appe<commit_after>== Appendices anchor:appendices_appendices[]

This section contains additional material to be referenced whilst using Gaffer.

It is composed of the following appendices:

* xref:appendices_hotkeys[Appendix A: Hotkeys]
* xref:appendices_scriptingNuggets[Appendix B: Scripting Nuggets]




=== Hotkeys anchor:appendices_hotkeys[]

.Global Hotkeys
[options="header",cols="20%,80%"]
|=======================
|Keypress|Result
|right-arrow|Increment current frame
|left-arrow |Decrement current frame
|`          |Set Gaffer to run in full-screen mode
|CTRL+z     |Undo last action
|SHIFT+CTRL+z|Redo last undone action
|CTRL+n     |Create blank script in new Gaffer session
|CTRL+o     |Launch dialog to open .gfr script file
|CTRL+s     |Save current script
|SHIFT+CTRL+s|Launch dialog to save current script with new file name
|CTRL-q     |Quit application
|======================

.NodeGraph Hotkeys
[options="header",cols="20%,80%"]
|=======================
|Keypress|Result
|f         |Frame current node selection, or all nodes if nothing selected
|d         |Disable/enable current node selection 
|+         |Zoom in !!!!not yet implemented!!!!
|-         |Zoom out !!!!not yet implemented!!!!
|tab       |Raise node creation menu and searchbox
|delete    |Delete current node selection
|backspace |Delete current node selection
|CTRL+a    |Select all nodes
|SHIFT+CTRL+a|Clear selection
|CTRL+x    |Cut current node selection
|CTRL+c    |Copy current node selection
|CTRL+v    |Paste node(s)
|=======================

[NOTE]
The copy/paste buffer for nodes persists between instances of gaffer, allowing you to quickly duplicate nodes between different scripts.
Also, as nodes are described by plain text you can cut and paste into emails/IM communications to share nodes with other users.

.Viewer Hotkeys - 3D mode
[options="header",cols="20%,80%"]
|=======================
|Keypress|Result
|f         |Frame current selection, or whole scene if nothing selected
|up-arrow  |Expand hierarchy of any selected bounding boxes
|down-arrow|Collapse hierarchy of any selected items/bounding boxes
|+         |Zoom in !!!!not yet implemented!!!!
|-         |Zoom out !!!!not yet implemented!!!!
|=======================

.NodeEditor Hotkeys
[options="header",cols="20%,80%"]
|=======================
|Keypress|Result
|up-arrow  |When focus is set to a numerical input field, this will increment the value of the field
|down-arrow|When focus is set to a numerical input field, this will decrement the value of the field
|tab       |Move focus to the next input field
|=======================

.ScriptEditor Hotkeys
[options="header",cols="20%,80%"]
|=======================
|Keypress|Result
|CTRL+a    |Select all text
|SHIFT+CTRL+a|Clear selection
|CTRL+x    |Cut current selection
|CTRL+c    |Copy current selection
|CTRL+v    |Paste
|enter     |Execute selected input text
|=======================


=== Scripting Nuggets anchor:appendices_scriptingNuggets[]
These one or two-liners achieve simple tasks via the python scripting interface, and serve as examples to build from.
More complete details of the gaffer api are available !!!!HERE!!!!

* Using the current frame to drive a plug. Enter in an expression for constant update.
[source, python]
------------------------------------
parent['RenderManOptions']['options']['pixelSamples']['value']['y'] = int(context.getFrame())
------------------------------------

* Looping over a frame range.
[source, python]
------------------------------------
for i in range(1,120):
	script.context().setFrame(i)
------------------------------------

* Execute an named executable node - i.e. render
[source, python]
------------------------------------
script['RenderManRender'].execute( [script.context()] )
------------------------------------

{'fraction_non_alphanumeric': 0.1914417772476517, 'fraction_numerical': 0.006858506038467273, 'mean_word_length': 4.089529590288316, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4658714', 'n_tokens_mistral': 1845, 'n_tokens_neox': 1754, 'n_words': 697}