def setPolyData(self, polyData): if polyData.GetNumberOfPoints(): originPose = self.getProperty('Origin') pos, quat = originPose[:3], originPose[3:] t = transformUtils.transformFromPose(pos, quat) polyData = filterUtils.transformPolyData(polyData, t.GetLinearInverse()) PolyDataItem.setPolyData(self, polyData)
def __init__(self, name, polyData, view): PolyDataItem.__init__(self, name, polyData, view) self.params = {} self.addProperty('uuid', newUUID(), attributes=om.PropertyAttributes(hidden=True)) self.addProperty('Collision Enabled', True) self.addProperty('Origin', [0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0], attributes=om.PropertyAttributes(hidden=True)) self.addProperty('Camera Texture Enabled', False) self.properties.setPropertyIndex('Collision Enabled', 0) self.setProperty('Icon', om.Icons.Hammer)
def onRemoveFromObjectModel(self): PolyDataItem.onRemoveFromObjectModel(self)
def _onPropertyChanged(self, propertySet, propertyName): PolyDataItem._onPropertyChanged(self, propertySet, propertyName) if propertyName == 'Origin': self.updateGeometryFromProperties()