MCPcopy Create free account
hub / github.com/WarmUpTill/SceneSwitcher / script_load

Function script_load

scripting/examples.py:114–182  ·  view source on GitHub ↗
(settings)

Source from the content-addressed store, hash-verified

112
113
114def script_load(settings):
115 # Register an example action
116 advss_register_action("My simple Python action", my_python_action)
117
118 # Register an example action with settings
119 advss_register_action(
120 "My Python action with settings",
121 my_python_settings_action,
122 get_action_properties,
123 get_action_defaults(),
124 )
125
126 # This example action demonstrates how to interact with variables
127 advss_register_action("My variable Python action", variable_python_action)
128
129 # Register an example condition
130 advss_register_condition(
131 "My Python condition",
132 my_python_condition,
133 get_condition_properties,
134 get_condition_defaults(),
135 )
136
137 # Register an example condition which registers and sets macro properties
138 advss_register_condition(
139 "My Python condition (Macro properties)",
140 my_temp_var_python_condition,
141 macro_properties=[
142 MacroProperty(
143 "random_int",
144 "Random number",
145 "A random number generated in the range from 0 to 100",
146 ),
147 MacroProperty("some_other_value", "Another value", ""),
148 ],
149 )
150
151 # Other signals and procedures, which might be useful
152 def plugin_stop_handler(data):
153 obs.script_log(obs.LOG_INFO, "Hello from stop handler!")
154 get_running_status()
155
156 def plugin_start_handler(data):
157 obs.script_log(obs.LOG_INFO, "Hello from start handler!")
158 get_running_status()
159
160 def get_running_status():
161 proc_handler = obs.obs_get_proc_handler()
162 data = obs.calldata_create()
163 obs.proc_handler_call(proc_handler, "advss_plugin_running", data)
164 success = obs.calldata_bool(data, "is_running")
165 obs.script_log(
166 obs.LOG_INFO, f"The advanced scene switcher is currently running: {success}"
167 )
168 obs.calldata_destroy(data)
169
170 def interval_reset_handler(data):
171 obs.script_log(obs.LOG_INFO, "Hello from reset handler!")

Callers

nothing calls this directly

Calls 5

advss_register_actionFunction · 0.85
get_action_defaultsFunction · 0.85
advss_register_conditionFunction · 0.85
get_condition_defaultsFunction · 0.85
MacroPropertyClass · 0.85

Tested by

no test coverage detected