Skip to content

Commit

Permalink
Update Builder Action feature
Browse files Browse the repository at this point in the history
  • Loading branch information
ccaillot committed Nov 2, 2023
1 parent 9ee3db2 commit 0f546ea
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
3 changes: 3 additions & 0 deletions openpype/hosts/maya/api/workfile_template_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ def create_placeholder(self, placeholder_data):
if parent:
placeholder = cmds.parent(placeholder, selection[0])[0]

if placeholder_data['action'] is None:
placeholder_data.pop('action')

imprint(placeholder, placeholder_data)

# Add helper attributes to keep placeholder info
Expand Down
8 changes: 4 additions & 4 deletions openpype/hosts/maya/plugins/builder/builder_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
from openpype.pipeline.action import BuilderAction


class ConnectGeometry(BuilderAction):
"""Connect geometries within containers.
class ConnectShape(BuilderAction):
"""Connect Shape within containers.
Source container will connect to the target containers, by searching for
matching geometry IDs (cbid).
Source containers are of family; "animation" and "pointcache".
The connection with be done with a live world space blendshape.
"""

label = "Connect Geometry"
label = "Connect Shape"
icon = "link"
color = "white"

def process(self):
self.log.info("CONNECT GEOMETRY")
self.log.info("Connect Shape")
print(cmds.ls())
11 changes: 3 additions & 8 deletions openpype/tools/attribute_defs/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ def current_value(self):
attr_def = widget.attr_def
if not isinstance(attr_def, UIDef):
output[attr_def.key] = widget.current_value()

return output


Expand Down Expand Up @@ -410,6 +411,7 @@ def set_value(self, value, multivalue=False):
class EnumAttrWidget(_BaseAttrDefWidget):
def __init__(self, *args, **kwargs):
self._multivalue = False
self._parent = args[1]
super(EnumAttrWidget, self).__init__(*args, **kwargs)

@property
Expand All @@ -436,24 +438,17 @@ def _ui_init(self):
if idx >= 0:
input_widget.setCurrentIndex(idx)

if self.multiselection:
input_widget.value_changed.connect(self._on_value_change)

if self.attr_def.on_value_changed_callback:
self._on_value_change_custom = self.attr_def.on_value_changed_callback

input_widget.currentIndexChanged.connect(self._on_value_change)


self._input_widget = input_widget

self.main_layout.addWidget(input_widget, 0)

def _on_value_change(self):
new_value = self.current_value()
if self._multivalue:
self._multivalue = False
self._input_widget.set_custom_text(None)

self.value_changed.emit(new_value, self.attr_def.id)

def current_value(self):
Expand Down

0 comments on commit 0f546ea

Please sign in to comment.