kristin Posted June 19, 2018 Report Share Posted June 19, 2018 Hey there! I'm hoping to get an example/explanation of this Tip on https://help.ftrack.com/developing-with-ftrack/key-concepts/actions Quote TipTo group actions together, give them the same label and specify a unique variant per action. I input the same label and set the "variant" attribute on 2 of my actions to different strings, but there are still 2 icons appearing, labeled with the same name. What is the actual outcome of this when done correctly? Is there an example you can provide so I can troubleshoot what I'm doing wrong? Thanks! Link to comment Share on other sites More sharing options...
Lorenzo Angeli Posted June 20, 2018 Report Share Posted June 20, 2018 Hi Kristing ! I've been looking now at the example you posted, and looks like it's missing something in order to cope with what you are after. Here how I got it working. In: ~/.local/ftrack-connect-plugins/testactions/hook * first.py * second.py each of these files contains a copy of the linked example. Here is how the classes are initialised: class MyCustomAction(object): '''Custom action.''' label = 'My Action' identifier = 'my.custom.action' description = 'This is an example action' variant = 'first' class MyCustomAction(object): '''Custom action.''' label = 'My Action' identifier = 'my.custom.action' description = 'This is an example action' variant = 'second' Then change in (both) the discover function to include the variant : return { 'items': [{ 'label': self.label, 'description': self.description, 'actionIdentifier': self.identifier, 'variant': self.variant }] } rather than : return { 'items': [{ 'label': self.label, 'description': self.description, 'actionIdentifier': self.identifier, }] } If you then restart connect , this is how the action should show up: To simplify further though, I would also suggest you to have a look at : https://bitbucket.org/ftrack/ftrack-action-handler Which aims to simplify the implementation of custom actions (http://ftrack-action-handler.rtd.ftrack.com/en/stable/). Please let me know if you have any further issue or questions. Cheers. L. Link to comment Share on other sites More sharing options...
kristin Posted June 20, 2018 Author Report Share Posted June 20, 2018 Yup you're right, I hadn't included variant in the discover function. Thank you very much! Link to comment Share on other sites More sharing options...
Lorenzo Angeli Posted June 21, 2018 Report Share Posted June 21, 2018 Cheers ! Let me know if you have any other issue or question. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.