{"action":"created","issue":{"url":"https://api.github.com/repos/pyblish/pyblish-qml/issues/279","repository_url":"https://api.github.com/repos/pyblish/pyblish-qml","labels_url":"https://api.github.com/repos/pyblish/pyblish-qml/issues/279/labels{/name}","comments_url":"https://api.github.com/repos/pyblish/pyblish-qml/issues/279/comments","events_url":"https://api.github.com/repos/pyblish/pyblish-qml/issues/279/events","html_url":"https://github.com/pyblish/pyblish-qml/issues/279","id":301406301,"number":279,"title":"Instances with same family under separate group","user":{"login":"asztalosdani","id":9664767,"avatar_url":"https://avatars2.githubusercontent.com/u/9664767?v=4","gravatar_id":"","url":"https://api.github.com/users/asztalosdani","html_url":"https://github.com/asztalosdani","followers_url":"https://api.github.com/users/asztalosdani/followers","following_url":"https://api.github.com/users/asztalosdani/following{/other_user}","gists_url":"https://api.github.com/users/asztalosdani/gists{/gist_id}","starred_url":"https://api.github.com/users/asztalosdani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asztalosdani/subscriptions","organizations_url":"https://api.github.com/users/asztalosdani/orgs","repos_url":"https://api.github.com/users/asztalosdani/repos","events_url":"https://api.github.com/users/asztalosdani/events{/privacy}","received_events_url":"https://api.github.com/users/asztalosdani/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-01T13:35:37Z","updated_at":"2018-03-01T13:37:59Z","closed_at":null,"author_association":"NONE","body":"### Description\r\nI have two collectors that return instances with same family. On the GUI it is shown under separate group.\r\n![image](https://user-images.githubusercontent.com/9664767/36846882-b96794dc-1d5c-11e8-80a1-4efe418e5b67.png)\r\nClicking on the family group toggles both of the instances.\r\nFurther investigation revealed, it occurs if an instance with another family is created between the two instances with common family.\r\n\r\n### Expected result\r\nThey should be placed under one group.\r\n### How to reproduce\r\nPlease note the order and the family of the plugins.\r\n```python\r\nimport pyblish.api\r\nclass ACollector(pyblish.api.ContextPlugin):\r\n    order = pyblish.api.CollectorOrder - 0.1\r\n    def process(self, context):\r\n        context.create_instance(\"A instance\", family=\"common_family\")\r\n        \r\nclass BCollector(pyblish.api.ContextPlugin):\r\n    order = pyblish.api.CollectorOrder\r\n    def process(self, context):\r\n        context.create_instance(\"B instance\", family=\"another_family\")\r\n        \r\nclass CCollector(pyblish.api.ContextPlugin):\r\n    order = pyblish.api.CollectorOrder + 0.1\r\n    def process(self, context):\r\n        context.create_instance(\"C instance\", family=\"common_family\")\r\n\r\npyblish.api.register_plugin(ACollector)\r\npyblish.api.register_plugin(BCollector)\r\npyblish.api.register_plugin(CCollector)\r\n\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/pyblish/pyblish-qml/issues/comments/369593560","html_url":"https://github.com/pyblish/pyblish-qml/issues/279#issuecomment-369593560","issue_url":"https://api.github.com/repos/pyblish/pyblish-qml/issues/279","id":369593560,"user":{"login":"mottosso","id":2152766,"avatar_url":"https://avatars1.githubusercontent.com/u/2152766?v=4","gravatar_id":"","url":"https://api.github.com/users/mottosso","html_url":"https://github.com/mottosso","followers_url":"https://api.github.com/users/mottosso/followers","following_url":"https://api.github.com/users/mottosso/following{/other_user}","gists_url":"https://api.github.com/users/mottosso/gists{/gist_id}","starred_url":"https://api.github.com/users/mottosso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mottosso/subscriptions","organizations_url":"https://api.github.com/users/mottosso/orgs","repos_url":"https://api.github.com/users/mottosso/repos","events_url":"https://api.github.com/users/mottosso/events{/privacy}","received_events_url":"https://api.github.com/users/mottosso/received_events","type":"User","site_admin":false},"created_at":"2018-03-01T13:37:59Z","updated_at":"2018-03-01T13:37:59Z","author_association":"OWNER","body":"Thanks @asztalosdani, this is actually the intended and expected behaviour. The instances are sorted in the order they are run.\r\n\r\nIf you add the two instances to the `context` one after the other, they will appear in the expected order. You can also add a collector at the end of your collectors that explicitly sort them, if you want."}}
{"actor":{"display_login":"mottosso"}}