Posted on Leave a comment

What is interpBlendShape?

interpBlendShape is a custom Maya deformer, similar in purpose to Maya’s built-in blendShape deformer, but with surface UV interpolation, in-between support, and Bezier-style blending instead of traditional linear interpolation. It supports both meshes and curves.

The tool is designed for high-end facial rigging and special deformation cases where you want the deformation to slide across a surface while keeping the result smooth, clean, and controllable. In some cases, it can also help achieve a more graphic or 2D-style deformation look.

One of the most common challenges in facial rigging is handling large mouth shapes. Traditional linear blendShape interpolation can often produce unpleasant or unnatural in-betweens. With surface-based blending, you can focus mainly on sculpting the final target shape, while the in-between motion slides across the NURBS surface or mesh surface you provide.

Continue reading What is interpBlendShape?
Posted on Leave a comment

only one column of a QTreeView/QTreeWidget editable只让一列可以编辑

如果你不写gui,可能不会在意maya channelBox的ui是如何实现的。最近一个工具需要用属性栏来显示和设置参数,当然思路有很多种。我使用QTreeView and QStandardItemModel 来实现的。因为我需要选择设置参数时能同时选中它的标签,但是标签那一栏需要设置为不可编辑,只做显示用。

只要override flags 方法即可

1
2
3
4
5
    def flags(self,index):
        flags = QtCore.Qt.ItemIsEnabled|QtCore.Qt.ItemIsSelectable
        if index.isValid() and index.column()==1:
            flags|= QtCore.Qt.ItemIsEditable
        return flags

如果使用的是QTreeWidget只有使用openPersistentEditor()和closePersistentEditor()来解决这一问题

1
2
3
4
5
6
7
8
9
10
11
        self._lastOpen = None
        self.itemDoubleClicked.connect(self.openEditStatus)
        self.itemSelectionChanged.connect(self.closeEditStatus)
    def closeEditStatus(self):
        if self._lastOpen:
            self.closePersistentEditor(self._lastOpen,1)
            self._lastOpen = None
    def openEditStatus(self):
        if self.currentColumn() == 1:
            self.openPersistentEditor(self.currentItem(),1)
            self._lastOpen = self.currentItem()