mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 08:54:53 +01:00
loads values from instances
This commit is contained in:
parent
d5889a0cec
commit
333e7c37ae
2 changed files with 13 additions and 4 deletions
|
|
@ -110,11 +110,12 @@ class PublisherController:
|
|||
instance = instances[0]
|
||||
output = []
|
||||
for attr_def in instance.family_attribute_defs:
|
||||
output.append((attr_def, [instance]))
|
||||
value = instance.data["family_attributes"][attr_def.key]
|
||||
output.append((attr_def, [instance], [value]))
|
||||
return output
|
||||
|
||||
# TODO mulsiselection
|
||||
return ([], [])
|
||||
return ([], [], [])
|
||||
|
||||
def get_publish_attribute_definitions(self, instances):
|
||||
families = set()
|
||||
|
|
|
|||
|
|
@ -100,13 +100,21 @@ class FamilyAttrsWidget(QtWidgets.QWidget):
|
|||
|
||||
content_widget = QtWidgets.QWidget(self._scroll_area)
|
||||
content_layout = QtWidgets.QFormLayout(content_widget)
|
||||
for attr_def, _instances in result:
|
||||
for attr_def, attr_instances, values in result:
|
||||
widget = create_widget_for_attr_def(attr_def, content_widget)
|
||||
if len(values) == 1:
|
||||
value = values[0]
|
||||
if value is not None:
|
||||
widget.set_value(values[0])
|
||||
else:
|
||||
# TODO multiselection
|
||||
pass
|
||||
|
||||
label = attr_def.label or attr_def.key
|
||||
content_layout.addRow(label, widget)
|
||||
widget.value_changed.connect(self._input_value_changed)
|
||||
|
||||
self._attr_def_id_to_instances[attr_def.id] = _instances
|
||||
self._attr_def_id_to_instances[attr_def.id] = attr_instances
|
||||
self._attr_def_id_to_attr_def[attr_def.id] = attr_def
|
||||
|
||||
self._scroll_area.setWidget(content_widget)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue