Skip to content

Commit

Permalink
Added bake on selected controls checkbox
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrilleMZ committed Jan 10, 2024
1 parent ff1dd7c commit 8362c24
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 1 deletion.
1 change: 1 addition & 0 deletions mocap_clipper/mocap_clipper_constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def __init__(self):
self.run_euler_filter = False
self.set_time_range = False
self.run_adjustment_blend = False
self.bake_selected = False
self.save_clip = False

self.target_rig = None
Expand Down
3 changes: 2 additions & 1 deletion mocap_clipper/mocap_clipper_dcc_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def get_pose_files(self):
self.log_missing_implementation(self.get_pose_files)
return FAKE_DATA.get("pose_files") # list of paths

def bake_to_rig(self, mocap_ns, rig_name, start_frame, end_frame):
def bake_to_rig(self, mocap_ns, rig_name, start_frame, end_frame, bake_selected=False):
self.log_missing_implementation(self.bake_to_rig)
return [] # rig controls, gets sent to rebuild_pose_anim_layer

Expand Down Expand Up @@ -176,6 +176,7 @@ def main_bake_function(self, clip_data, bake_config):
rig_name=rig_name,
start_frame=start_frame,
end_frame=end_frame,
bake_selected=bake_config.bake_selected,
)

if bake_config.run_euler_filter:
Expand Down
1 change: 1 addition & 0 deletions mocap_clipper/mocap_clipper_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,7 @@ def bake_to_rig(self):
bake_config.run_euler_filter = self.ui.euler_filter_CHK.isChecked()
bake_config.set_time_range = self.ui.set_time_range_CHK.isChecked()
bake_config.run_adjustment_blend = self.ui.adjustment_blend_CHK.isChecked()
bake_config.bake_selected = self.ui.bake_on_selected_ctrl_CHK.isChecked()
bake_config.save_clip = self.ui.save_clip_CHK.isChecked()

bake_config.target_rig = self.get_active_rig()
Expand Down
9 changes: 9 additions & 0 deletions mocap_clipper/ui/mocap_clipper_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,11 @@ def setupUi(self, MocapClipperWidget):

self.bake_configs.addWidget(self.adjustment_blend_CHK)

self.bake_on_selected_ctrl_CHK = QCheckBox(self.bake_configuration_widget)
self.bake_on_selected_ctrl_CHK.setObjectName(u"bake_on_selected_ctrl_CHK")

self.bake_configs.addWidget(self.bake_on_selected_ctrl_CHK)

self.horizontalLayout_6 = QHBoxLayout()
self.horizontalLayout_6.setSpacing(2)
self.horizontalLayout_6.setObjectName(u"horizontalLayout_6")
Expand Down Expand Up @@ -575,6 +580,10 @@ def retranslateUi(self, MocapClipperWidget):
self.adjustment_blend_CHK.setToolTip(QCoreApplication.translate("MocapClipperWidget", u"Blend the Start and End pose layer using the intensity of the base animation", None))
#endif // QT_CONFIG(tooltip)
self.adjustment_blend_CHK.setText(QCoreApplication.translate("MocapClipperWidget", u"Run Adjustment Blend", None))
#if QT_CONFIG(tooltip)
self.bake_on_selected_ctrl_CHK.setToolTip(QCoreApplication.translate("MocapClipperWidget", u"Bake only selected controls", None))
#endif // QT_CONFIG(tooltip)
self.bake_on_selected_ctrl_CHK.setText(QCoreApplication.translate("MocapClipperWidget", u"Bake On Selected Controls", None))
#if QT_CONFIG(tooltip)
self.save_clip_CHK.setToolTip(QCoreApplication.translate("MocapClipperWidget", u"Enable this to automatically save the clip into the selected folder", None))
#endif // QT_CONFIG(tooltip)
Expand Down
10 changes: 10 additions & 0 deletions mocap_clipper/ui/mocap_clipper_widget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,16 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="bake_on_selected_ctrl_CHK">
<property name="toolTip">
<string>Bake only selected controls</string>
</property>
<property name="text">
<string>Bake On Selected Controls</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<property name="spacing">
Expand Down

0 comments on commit 8362c24

Please sign in to comment.