Simply Maya User Community

Simply Maya User Community (https://simplymaya.com/forum/index.php)
-   Programming (https://simplymaya.com/forum/forumdisplay.php?f=32)
-   -   maya script to delete hidden objects (https://simplymaya.com/forum/showthread.php?t=45265)

PratikAnimator 25-05-2018 04:12 AM

maya script to delete hidden objects
 
Hi all,
Please tell if anyone have some script to delete hidden objects at once..
Thanks

Jackkd88 03-09-2020 02:11 PM

select text to view
Code:

import maya.cmds as mc

allTransforms = mc.ls(tr=1)
polyMeshes = mc.filterExpand(allTransforms, sm=12)
toDel = []
for i in polyMeshes:
    if mc.getAttr(i+'.visibility') != True:
        toDel.append(i)
mc.delete(toDel)



All times are GMT. The time now is 02:03 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Simply Maya 2018