Add template reply to the url /
Add for the server the url: /json
Result the state of plugins.
[[{"callbacks": [{"matchevents": {"Shotgun_Entity_Change": "sg_status_list"}, "stoponerror": true, "name": "check_entity_schema", "args": {"operator": "+", "field_to_update": "sg_description", "field_a": "id", "field_b": 1, "entity_type": "Project"}}], "name": "calc_field", "isactive": true, "mtime": "Tue Oct 01 21:55:29 2019"}, {"callbacks": [], "name": "calc_summaries", "isactive": false, "mtime": "Sat Jan 12 00:07:12 2019"}]]
add to conf :
[syspath]
paths:C:/STUFF;C:
Add to sys path then you don't have to add sys path in your plugins.
python sgeventlogcli.py --help
Usage: sgeventlogcli.py [OPTIONS] COMMAND [ARGS]...
Options:
--help Show this message and exit.
Commands:
info
listplugin
process option --id eventlogid --name nameplugin
python sgeventlogcli.py info
shotgun url : https://xxx.shotgunstudio.com/
plugin path : ['C:\\XXX\\plugins']
python sgeventlogcli.py listplugin
calc_field:
PATH: ...\plugins\calc_field.py
MATCHEVENT: {'Shotgun_Project_Change': ['id', 1]}
ARGS: {'operator': '+', 'field_to_update': 'sg_description', 'field_a': 'id', 'field_b': 1, 'entity_type': 'Project'}
Stop On Error: True
entity_status_update_task_status:
PATH: ...\plugins\entity_status_update_task_status.py
MATCHEVENT: {'Shotgun_entity_type_Change': 'entity_status_field'}
ARGS: {'target_status': 'hld', 'skip_statuses': ['fin', 'na', 'hld'], 'entity_status_field': 'sg_status_list', 'entity_type': 'Asset'}
Stop On Error: True
init_entity:
PATH: ...\src\plugins\init_entity.py
MATCHEVENT: {'Shotgun_Asset_New': None}
ARGS: {'initial_data': {'description': 'Brand new Asset.'}, 'force': False, 'filters': [], 'entity_type': 'Asset'}
Stop On Error: True
version_status_update_task_status:
PATH: ...\plugins\version_status_update_task_status.py
MATCHEVENT: {'Shotgun_Version_Change': ['sg_status_list']}
ARGS: {'date_approved_timezone': 'US/Pacific', 'date_approved_field': 'client_approved_at', 'approved_status_code': 'apr'}
Stop On Error: True
You can process unit test , donwloading the json of the eventlogid, and then test your python's event.
This software was originaly developed by Patrick Boucher with support from Rodeo Fx and Oblique. It is now part of Shotgun Software's open source initiative.
This software is provided under the MIT License that can be found in the LICENSE file or at the [Open Source Initiative](http://www.opensource.org/licenses/mit- license.php) website.
When you want to access the Shotgun event stream, the preferred way to do so it to monitor the events table, get any new events, process them and repeat.
A lot of stuff is required for this process to work successfully, stuff that may not have any direct bearing on the business rules that need to be applied.
The role of the framework is to keep any tedious monitoring tasks out of the hands of the business logic implementor.
The framework is a daemon process that runs on a server and monitors the Shotgun event stream. When events are found, the daemon hands the events out to a series of registered plugins. Each plugin can process the event as it wishes.
The daemon handles:
- Registering plugins from one or more specified paths.
- Deactivate any crashing plugins.
- Reloading plugins when they change on disk.
- Monitoring the Shotgun event stream.
- Remembering the last processed event id and any backlog.
- Starting from the last processed event id on daemon startup.
- Catching any connection errors.
- Logging information to stdout, file or email as required.
- Creating a connection to Shotgun that will be used by the callback.
- Handing off events to registered callbacks.
A plugin handles:
- Registering any number of callbacks into the framework.
- Processing a single event when one is provided by the framework.
- Only deal with a single monitoring mechanism for all scripts, not one per script.
- Minimize network and database load (only one monitor that supplies event to many event processing plugins).
See the GitHub Wiki.
