I am new to writing a plugin for Shotgun and I’m trying to write a plugin in Python so that when the “Path to Frames” value is filled in with the Linux path for an entity, the “WIN Path to Frames” value is automatically filled in with the Windows version of that Linux path, and vice-versa.
Can someone give me some guidance or tips for writing this plugin?
I already figured out that I would need to write an event daemon for this, so thanks for the confirmation. And you mentioned that in the link you provided that there are examples in there. Where? I can’t find any examples of that code being used - there’s just codes in there…
And as for the event daemon, I’m guessing that I’ll have to make a “registerCallbacks(reg)” function like the following skeleton code?:
def registerCallbacks(reg):
args = {...}
event_filter = {f'Shotgun_{args.get("entity_type")}_Change': [args.get('sg_p2f'),
args.get('sg_p2m')]}
# Register our callback with the Shotgun_%s_Change event and tell the logger
# about it.
reg.registerCallback(SCRIPT_NAME, SCRIPT_KEY, lin2win, event_filter, args)
reg.logger.debug("Registered callback: lin2win.py")
def lin2win(sg, logger, event, args):
...
If there’s anything you can suggest I add to the above skeleton code, I’d love to hear it.