{"id":2699,"date":"2024-01-29T19:36:35","date_gmt":"2024-01-29T19:36:35","guid":{"rendered":"https:\/\/devicejockey.de\/?page_id=2699"},"modified":"2024-02-14T06:27:33","modified_gmt":"2024-02-14T06:27:33","slug":"swap-table-basics","status":"publish","type":"page","link":"https:\/\/devicejockey.de\/?page_id=2699","title":{"rendered":"Swap Table"},"content":{"rendered":"<div class=\"wpb-content-wrapper\"><p>[vc_row][vc_column][vc_cta h2=&#8221;&#8221; style=&#8221;custom&#8221; custom_background=&#8221;rgba(15,0,0,0.14)&#8221;]<\/p>\n<h1>Swaps and Swap Table<\/h1>\n<p>Swaps allow you to dynamically change values in commands, events, or titles.<br \/>\nYou can modify values without having to edit the command, event, or title.[\/vc_cta][\/vc_column][\/vc_row][vc_row css=&#8221;.vc_custom_1703005440459{background-color: rgba(15,0,0,0.3) !important;*background-color: rgb(15,0,0) !important;}&#8221; el_class=&#8221;.grayBox&#8221;][vc_column][vc_column_text]<\/p>\n<h2>A brief example<\/h2>\n<p>Suppose you&#8217;ve created a button to select a scene in OBS Studio.[\/vc_column_text][vc_row_inner][vc_column_inner width=&#8221;1\/2&#8243;][vc_column_text]In the JSON of the command, you specify the value &#8220;Scene1&#8221; for the &#8220;sceneName&#8221; attribute.[\/vc_column_text][\/vc_column_inner][vc_column_inner width=&#8221;1\/2&#8243;][vc_single_image image=&#8221;2708&#8243; img_size=&#8221;&#8221;][\/vc_column_inner][\/vc_row_inner][vc_row_inner][vc_column_inner width=&#8221;1\/2&#8243;][vc_column_text]If you want to select a different scene with the button, you edit the command in the button and update the value &#8220;Scene1&#8221; to &#8220;Scene2&#8221;. From now on, the button calls &#8220;Scene2&#8243; in OBS.[\/vc_column_text][\/vc_column_inner][vc_column_inner width=&#8221;1\/2&#8243;][vc_single_image image=&#8221;2709&#8243; img_size=&#8221;&#8221;][\/vc_column_inner][\/vc_row_inner][\/vc_column][\/vc_row][vc_row css=&#8221;.vc_custom_1703005440459{background-color: rgba(15,0,0,0.3) !important;*background-color: rgb(15,0,0) !important;}&#8221; el_class=&#8221;.grayBox&#8221;][vc_column][vc_column_text]<\/p>\n<h3>Create A Swap<\/h3>\n<p>Let&#8217;s use a swap instead of the specific scene value in &#8220;sceneName&#8221;.[\/vc_column_text][vc_row_inner][vc_column_inner width=&#8221;1\/2&#8243;][vc_column_text]To do this, first go to the main menu and tap on &#8220;Swap tables&#8221; once.[\/vc_column_text][\/vc_column_inner][vc_column_inner width=&#8221;1\/2&#8243;][vc_single_image image=&#8221;2710&#8243; img_size=&#8221;&#8221;][\/vc_column_inner][\/vc_row_inner][vc_row_inner][vc_column_inner width=&#8221;1\/2&#8243;][vc_column_text]Now tap on the &#8220;Globals&#8221; entry to display the list of global swap tables.[\/vc_column_text][\/vc_column_inner][vc_column_inner width=&#8221;1\/2&#8243;][vc_single_image image=&#8221;2711&#8243; img_size=&#8221;&#8221;][\/vc_column_inner][\/vc_row_inner][vc_row_inner][vc_column_inner width=&#8221;1\/2&#8243;][vc_column_text]Use the plus button at the top right to add a new table.<\/p>\n<p>Name this table &#8220;Scenes&#8221;.[\/vc_column_text][\/vc_column_inner][vc_column_inner width=&#8221;1\/2&#8243;][vc_single_image image=&#8221;2712&#8243; img_size=&#8221;&#8221;][\/vc_column_inner][\/vc_row_inner][vc_row_inner][vc_column_inner width=&#8221;1\/2&#8243;][vc_column_text]Then tap on &#8220;Scenes&#8221; and create a new entry using the plus button.<\/p>\n<p>In the &#8220;Swap&#8221; field, enter the name for the swap as &#8220;SceneA&#8221;.<\/p>\n<p>In the &#8220;Value&#8221; field, enter the value of the swap as &#8220;Scene1&#8221;.<\/p>\n<p>Confirm the input with &#8220;OK&#8221;.[\/vc_column_text][\/vc_column_inner][vc_column_inner width=&#8221;1\/2&#8243;][vc_single_image image=&#8221;2713&#8243; img_size=&#8221;&#8221;][\/vc_column_inner][\/vc_row_inner][vc_column_text]You can now leave the swap tables using the checkmark at the top right and return to the panel.[\/vc_column_text][\/vc_column][\/vc_row][vc_row css=&#8221;.vc_custom_1703005440459{background-color: rgba(15,0,0,0.3) !important;*background-color: rgb(15,0,0) !important;}&#8221; el_class=&#8221;.grayBox&#8221;][vc_column][vc_column_text]<\/p>\n<h3>Use The Swap<\/h3>\n<p>[\/vc_column_text][vc_row_inner][vc_column_inner width=&#8221;1\/2&#8243;][vc_column_text]Go to the button&#8217;s command and change the value of the &#8220;inputName&#8221; attribute to &#8220;<strong>\\(SceneA)<\/strong>&#8220;.<\/p>\n<p><strong>Look at the syntax for using swaps.<\/strong><\/p>\n<p>Swaps always start with &#8220;<strong>\\(<\/strong> &#8220;.<br \/>\nThen comes the name of the swap, followed by &#8220;<strong>)<\/strong>&#8220;.<\/p>\n<p>If you&#8217;ve correctly specified the swap, it will appear in blue font. Complete the input using the checkmark at the top right.[\/vc_column_text][vc_message message_box_color=&#8221;success&#8221; icon_fontawesome=&#8221;far fa-hand-point-up&#8221;]<strong>\\(SWAP)<\/strong><\/p>\n<p>This syntax is important. It&#8217;s the way swaps are inserted.[\/vc_message][\/vc_column_inner][vc_column_inner width=&#8221;1\/2&#8243;][vc_single_image image=&#8221;2714&#8243; img_size=&#8221;&#8221;][\/vc_column_inner][\/vc_row_inner][vc_column_text]When you tap the button now, the swap will be replaced by the stored value during the execution of the command.<\/p>\n<p>If you want to change the value, you can do so via the swap table where you saved it.<br \/>\nThis can be done through the main menu.[\/vc_column_text][\/vc_column][\/vc_row][vc_row css=&#8221;.vc_custom_1703005440459{background-color: rgba(15,0,0,0.3) !important;*background-color: rgb(15,0,0) !important;}&#8221; el_class=&#8221;.grayBox&#8221;][vc_column][vc_column_text]<\/p>\n<h3>Advanced Use<\/h3>\n<p>There are also other interesting ways to change the value of the swap. For example, through another button on the panel.[\/vc_column_text][vc_row_inner][vc_column_inner width=&#8221;1\/2&#8243;][vc_column_text]Create a new button and add a tap command to the button named &#8220;Set global swap value&#8221;.<\/p>\n<p>Select your &#8220;Scenes&#8221; table.<\/p>\n<p>Then, in the Swap field, enter the name of the swap.[\/vc_column_text][vc_message message_box_color=&#8221;success&#8221; icon_fontawesome=&#8221;far fa-hand-point-up&#8221;]<strong>Important<\/strong><\/p>\n<p>The swap is not formatted with &#8220;\\( ) &#8221; here.[\/vc_message][vc_column_text]You can also use the button on the far right.<\/p>\n<p>In the Value field, enter the new value for the swap.[\/vc_column_text][vc_message message_box_color=&#8221;success&#8221; icon_fontawesome=&#8221;far fa-hand-point-up&#8221;]You can also use the button on the far right to display an input window for live input of the value.<\/p>\n<p><strong>Let&#8217;s do that.<\/strong>[\/vc_message][vc_column_text]Leave the &#8220;Panel check Status&#8221; switch turned on.<\/p>\n<p>Complete the input using the checkmark at the top right.[\/vc_column_text][\/vc_column_inner][vc_column_inner width=&#8221;1\/2&#8243;][vc_single_image image=&#8221;2724&#8243; img_size=&#8221;350&#215;650&#8243;][\/vc_column_inner][\/vc_row_inner][\/vc_column][\/vc_row][vc_row css=&#8221;.vc_custom_1703005440459{background-color: rgba(15,0,0,0.3) !important;*background-color: rgb(15,0,0) !important;}&#8221; el_class=&#8221;.grayBox&#8221;][vc_column][vc_column_text]<\/p>\n<h3>Test The Swap<\/h3>\n<p>Go to the live mode and press the button.<\/p>\n<p>An input window appears, showing you the current value of the swap.<\/p>\n<p>You can now change this value to &#8220;Scene2&#8221; and confirm with &#8220;OK&#8221;.<\/p>\n<p>Now, when you tap the button, OBS switches to Scene2 instead of Scene1.[\/vc_column_text][\/vc_column][\/vc_row][vc_row css=&#8221;.vc_custom_1703005440459{background-color: rgba(15,0,0,0.3) !important;*background-color: rgb(15,0,0) !important;}&#8221; el_class=&#8221;.grayBox&#8221;][vc_column][vc_column_text]<\/p>\n<h3>Use Swaps in Titles<\/h3>\n<p>Now let&#8217;s display the scene name in the title of the button.[\/vc_column_text][vc_row_inner][vc_column_inner width=&#8221;1\/2&#8243;][vc_column_text]To do this, edit the button.<br \/>\nEnter &#8220;\\(SceneA)&#8221; in the title field.<br \/>\nComplete the edit using the checkmark.<\/p>\n<p>Now the scene name will be displayed on the button.[\/vc_column_text][\/vc_column_inner][vc_column_inner width=&#8221;1\/2&#8243;][vc_single_image image=&#8221;2732&#8243; img_size=&#8221;&#8221;][\/vc_column_inner][\/vc_row_inner][\/vc_column][\/vc_row][vc_row color=&#8221;&#8221; message_box_style=&#8221;standard&#8221; style=&#8221;rounded&#8221; message_box_color=&#8221;success&#8221; icon_type=&#8221;fontawesome&#8221; icon_the7=&#8221;&#8221; icon_fontawesome=&#8221;fas fa-check&#8221; icon_monosocial=&#8221;vc-mono vc-mono-fivehundredpx&#8221; icon_openiconic=&#8221;&#8221; icon_typicons=&#8221;&#8221; icon_entypo=&#8221;&#8221; icon_linecons=&#8221;&#8221; icon_pixelicons=&#8221;&#8221;][vc_column][vc_message message_box_color=&#8221;success&#8221; icon_fontawesome=&#8221;far fa-hand-point-up&#8221;]This was just an example of how useful the use of swaps can be for you. The possibilities are great, and over time, you&#8217;ll surely find many uses for swaps.[\/vc_message][\/vc_column][\/vc_row]<\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>[vc_row][vc_column][vc_cta h2=&#8221;&#8221; style=&#8221;custom&#8221; custom_background=&#8221;rgba(15,0,0,0.14)&#8221;] Swaps and Swap Table Swaps allow you to dynamically change values in commands, events, or titles. You can modify values without having to edit the command, event, or title.[\/vc_cta][\/vc_column][\/vc_row][vc_row css=&#8221;.vc_custom_1703005440459{background-color: rgba(15,0,0,0.3) !important;*background-color: rgb(15,0,0) !important;}&#8221; el_class=&#8221;.grayBox&#8221;][vc_column][vc_column_text] A brief example Suppose you&#8217;ve created a button to select a scene in OBS Studio.[\/vc_column_text][vc_row_inner][vc_column_inner width=&#8221;1\/2&#8243;][vc_column_text]In&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1634,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-2699","page","type-page","status-publish","hentry","description-off"],"_links":{"self":[{"href":"https:\/\/devicejockey.de\/index.php?rest_route=\/wp\/v2\/pages\/2699","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devicejockey.de\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/devicejockey.de\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/devicejockey.de\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/devicejockey.de\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2699"}],"version-history":[{"count":30,"href":"https:\/\/devicejockey.de\/index.php?rest_route=\/wp\/v2\/pages\/2699\/revisions"}],"predecessor-version":[{"id":3199,"href":"https:\/\/devicejockey.de\/index.php?rest_route=\/wp\/v2\/pages\/2699\/revisions\/3199"}],"up":[{"embeddable":true,"href":"https:\/\/devicejockey.de\/index.php?rest_route=\/wp\/v2\/pages\/1634"}],"wp:attachment":[{"href":"https:\/\/devicejockey.de\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2699"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}