View Single Post
# 1 18-07-2016 , 08:36 PM
Registered User
Join Date: Jul 2016
Posts: 1

[Python-Scripting]Deleting non-default read-only cameras.

So i'm writing a python script that saves different shots from a scene in different .ma files.For each shot,only its camera should exist in its .ma file(besides the default ones like persp,front,etc...).Everything was working fine until i tested in one scene where there is this orthographic cameras that i never saw before(they were probably created by the artist).When my script tries to delete it, this message shows up:

# Error: Cannot delete 'Camera4:left' as it has locked or read-only children. #

and the script simply ignore this cameras e continue doing its work.

I tried use the command maya.cmds.lockNode(cam,lock = False) before the maya.cmds.delete(cam) but it seems that the real problem is that this cameras are read-only type.

Any way to delete them? thanks!