def copy_shader(self): cp_sel = pm.ls(selection=True) sel_shader = None sh_eng = pm.ls(pm.listHistory(cp_sel[0], f=1), type="shadingEngine")[0] if sh_eng: sel_shader = pm.listConnections(str(sh_eng) + ".surfaceShader")[0] if sel_shader: pm.hyperShade(cp_sel[1], assign=sel_shader) return None
def get_history_list(self, **kwargs): hist_lst = [] sel_obj = kwargs.get("sel_obj", None) if not isinstance(sel_obj, list): sel_obj = [sel_obj] for obj in sel_obj: hist = pm.listHistory(obj) if not hist_lst: hist_lst = hist else: for nd in hist: hist_lst.append(nd) return hist_lst
def findSkinCluster(self, mesh): skincluster = None for each in pmc.listHistory(mesh): if isinstance(each, pmc.nodetypes.SkinCluster): skincluster = each return skincluster