def __init__(self, *args, **kwargs): super(PiperMenu, self).__init__(*args, **kwargs) self.setTearOffEnabled(True) self.icon = QtGui.QIcon( os.path.join(pcu.getPiperDirectory(), 'icons', 'piper.png')) self.actions = [ ] # stores QWidgets so that they are not garbage collected
def reloadPiper(self): manager.closeAll() pcu.removeModules(path=pcu.getPiperDirectory()) self.deleteLater() import setup setup.piperTools()
def createMaterial(self): """ Creates the material. In this instance, it imports a shaderFX material made by Pontus Canback. https://pontus-canback.artstation.com/pages/norrsken-pbr Returns: (pm.nodetypes.ShaderfxShader): Material """ # get the path to the material to import hdr_image_path = self.getHdrImagePath() piper_directory = pcu.getPiperDirectory() norrsken_material_path = os.path.join(piper_directory, 'maya', 'scenes', 'NorrskenPBR.mb') nodes = pm.importFile(norrsken_material_path, rnn=True) # the material is the only ShaderfxShader imported, set the HDR image attribute material = pm.ls(nodes, type='ShaderfxShader')[0] material.HDRI.set(hdr_image_path) # delete all the other nodes that might have been imported self.materials.append(material) nodes.remove(material) pm.delete(nodes) return material
def loadAll(): """ Loads all the plug-ins in the plug-ins directory inside Piper. """ piper_directory = pcu.getPiperDirectory() plugins_directory = os.path.join(piper_directory, 'maya', 'plug-ins', str(pm.about(version=True))) extensions = ('.mll', '.py') plugins = pcu.getAllFilesEndingWithWord(extensions, plugins_directory) [load(os.path.basename(plugin)) for plugin in plugins]
def __init__(self): """ Example: import piper.mayapy.rig.skin as skin binder = skin.Binder() binder.unbind() # move joints around, delete joints, parent joints, etc. binder.rebind() """ self.info = {} self.directory = os.path.join(pcu.getPiperDirectory(), 'temp').replace('\\', '/')
def getPath(self): """ Gets the path to the stored settings .json file. Returns: (string): """ if self._path: return self._path piper_directory = pcu.getPiperDirectory() app = self.getApp() self._path = os.path.join(piper_directory, 'settings', app + '.json') return self._path
def __init__(self, dcc_store=None, *args, **kwargs): super(Switcher, self).__init__(*args, **kwargs) piper_directory = pcu.getPiperDirectory() self.icons_directory = os.path.join(piper_directory, 'maya', 'icons') self.setWindowTitle('Switcher') self.store = dcc_store self.self_update = None self.keyframe_box = None self.match_only = None self.translate = None self.rotate = None self.orient = None self.scale = None self.spaces_list = None self.switcher_list = None self.pivots_list = None self.rest_list = None self.all_controls_button = None self.all_inner_button = None self.selected_inner_button = None self.joints_button = None self.hide_play_button = None self.build() self.store_data = { self.self_update: pcfg.switcher_update_box, self.keyframe_box: pcfg.switcher_key_box, self.match_only: pcfg.switcher_match_box, self.translate: pcfg.switcher_translate_box, self.rotate: pcfg.switcher_rotate_box, self.orient: pcfg.switcher_orient_box, self.scale: pcfg.switcher_scale_box } self.restorePrevious()
def openPiperDirectoryInOS(): piper_directory = pcu.getPiperDirectory() pcu.openWithOS(piper_directory)