コード例 #1
0
    def get_selected_assets(self):
        """Add all selected items from the current scene"""

        with lib.preserve_expanded_rows(self.view):
            with lib.preserve_selection(self.view):
                self.clear()
                nodes = commands.get_selected_nodes()
                items = commands.create_items_from_nodes(nodes)
                self.add_items(items)
コード例 #2
0
    def on_all_loaded(self):
        """Add all items from the current scene"""

        with lib.preserve_expanded_rows(self.view):
            with lib.preserve_selection(self.view):
                self.clear()
                nodes = commands.get_all_asset_nodes()
                items = commands.create_items(nodes)
                self.add_items(items)

        return len(items) > 0