mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 00:44:52 +01:00
data are collected from all parts now
This commit is contained in:
parent
d39f8b79fa
commit
fd394c64f9
5 changed files with 35 additions and 3 deletions
|
|
@ -148,7 +148,8 @@ class Window(QtWidgets.QDialog):
|
|||
data = {}
|
||||
data.update(self.widget_assets.collect_data())
|
||||
data.update(self.widget_family.collect_data())
|
||||
|
||||
data.update(self.widget_components.collect_data())
|
||||
|
||||
return data
|
||||
|
||||
def show(parent=None, debug=False, context=None):
|
||||
|
|
|
|||
|
|
@ -179,12 +179,24 @@ class AssetWidget(QtWidgets.QWidget):
|
|||
return self.parent_widget.db
|
||||
|
||||
def collect_data(self):
|
||||
project = self.db.find_one({'type': 'project'})
|
||||
asset = self.db.find_one({'_id': self.get_active_asset()})
|
||||
data = {
|
||||
'project': self.combo_projects.currentText(),
|
||||
'asset': get_active_asset
|
||||
'project': project,
|
||||
'asset': asset,
|
||||
'parents': self.get_parents(asset)
|
||||
}
|
||||
return data
|
||||
|
||||
def get_parents(self, entity):
|
||||
output = []
|
||||
if entity.get('data', {}).get('visualParent', None) is None:
|
||||
return output
|
||||
parent = self.db.find_one({'_id': entity['data']['visualParent']})
|
||||
output.append(parent)
|
||||
output.extend(self.get_parents(parent))
|
||||
return output
|
||||
|
||||
def _set_projects(self):
|
||||
projects = list()
|
||||
for project in self.db.projects():
|
||||
|
|
|
|||
|
|
@ -230,3 +230,13 @@ class ComponentItem(QtWidgets.QFrame):
|
|||
|
||||
def change_preview(self, hover=True):
|
||||
self.preview.change_checked(hover)
|
||||
|
||||
def collect_data(self):
|
||||
data = {
|
||||
'ext': self.in_data['ext'],
|
||||
'representation': self.input_repre.text(),
|
||||
'files': self.in_data['files'],
|
||||
'thumbnail': self.is_thumbnail(),
|
||||
'preview': self.is_preview()
|
||||
}
|
||||
return data
|
||||
|
|
|
|||
|
|
@ -45,6 +45,9 @@ class ComponentsWidget(QtWidgets.QWidget):
|
|||
def process_mime_data(self, mime_data):
|
||||
self.drop_frame.process_ent_mime(mime_data)
|
||||
|
||||
def collect_data(self):
|
||||
return self.drop_frame.collect_data()
|
||||
|
||||
def _browse(self):
|
||||
options = [
|
||||
QtWidgets.QFileDialog.DontResolveSymlinks,
|
||||
|
|
|
|||
|
|
@ -313,3 +313,9 @@ class DropDataFrame(QtWidgets.QFrame):
|
|||
|
||||
if found is False:
|
||||
self._add_item(data)
|
||||
|
||||
def collect_data(self):
|
||||
data = {'components' : []}
|
||||
for item in self.items:
|
||||
data['components'].append(item.collect_data())
|
||||
return data
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue