im trying to write some python to delete all annotations i have in my maya scene. The problem is i don't know what flag to put as 'type' so i can select all to delete.
i did cmds.objectType and found it was a 'transform' type. but this keyword doesn't work as a flag. so a bit confused
here is my current code:
#######################################
import maya.cmds as cmds
selection=cmds.select(cmds.listRelatives(cmds.ls(type='transform'), p=True, path=True), r=True)
cmds.delete()
######################################
if anyone could tell me the correct flag to delete the annotations i have created it would be awesome,
thanks,
Sam
You can lookup the available types here:
http://help.autodesk.com/cloudhelp/2015/ENU/Maya-Tech-Docs/Nodes/index.html
In this case, you’re looking for “camera”. You can also see it in the attribute editor, next to it’s name.
Pro tip: for fancy code-formatting via the list or gmail, like this:
import maya.cmds as cmds
selection=cmds.select(cmds.listRelatives(cmds.ls(type='transform'), p=True, path=True), r=True)
cmds.delete()
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/c3e4b964-2c39-42cb-9a98-2c4cbbad2c8d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Sorry, not sure why I thought you were looking for cameras. :) Have a look at the type of annotation in the Attribute editor and put that in the type field.
#========
import pymel.core as pm
pm.delete( pm.ls( type="annotationShape" ) )
#========