Python: Show by type in active modelPanel
# Show by type in active modelPanel
def _modelEditor():
import maya.cmds as mc;
mod = mc.getModifiers();
val = 1;
if mod: val = 0;
aPnl = mc.getPanel(wf=1);
mPnl = "modelPanel";
num = len(mPnl);
if len(aPnl)>=num and aPnl[0:num]==mPnl:
attrs = [
"controllers",
"nurbsCurves",
"nurbsSurfaces",
"cv",
"hulls",
"polymeshes",
"subdivSurfaces",
"planes",
"lights",
"cameras",
"imagePlane",
"joints",
"ikHandles",
"deformers",
"dynamics",
"particleInstancers",
"fluids",
"hairSystems",
"follicles",
"nCloths",
"nParticles",
"nRigids",
"dynamicConstraints",
"locators",
"dimensions",
"pivots",
"handles",
"textures",
"strokes",
"motionTrails",
"pluginShapes",
"clipGhosts",
"greasePencils",
"manipulators",
"grid",
"hud",
"hos",
"sel"];
for attr in attrs:
exec("mc.modelEditor(\""+aPnl+"\",e=1,"+attr+"="+str(val)+")");
_modelEditor();
def _modelEditor():
import maya.cmds as mc;
mod = mc.getModifiers();
val = 1;
if mod: val = 0;
aPnl = mc.getPanel(wf=1);
mPnl = "modelPanel";
num = len(mPnl);
if len(aPnl)>=num and aPnl[0:num]==mPnl:
attrs = [
"controllers",
"nurbsCurves",
"nurbsSurfaces",
"cv",
"hulls",
"polymeshes",
"subdivSurfaces",
"planes",
"lights",
"cameras",
"imagePlane",
"joints",
"ikHandles",
"deformers",
"dynamics",
"particleInstancers",
"fluids",
"hairSystems",
"follicles",
"nCloths",
"nParticles",
"nRigids",
"dynamicConstraints",
"locators",
"dimensions",
"pivots",
"handles",
"textures",
"strokes",
"motionTrails",
"pluginShapes",
"clipGhosts",
"greasePencils",
"manipulators",
"grid",
"hud",
"hos",
"sel"];
for attr in attrs:
exec("mc.modelEditor(\""+aPnl+"\",e=1,"+attr+"="+str(val)+")");
_modelEditor();
Comments
Post a Comment