Thread: Python to MEL
View Single Post
# 1 20-11-2015 , 05:00 PM
Registered User
Join Date: Oct 2015
Posts: 4

Python to MEL

Hi all

So still having trouble with the whole more from Python to MEL. All I want to do is convert this basic script into MEL but the different syntax is doing my head in!

I have a load of nodes in the scene called removeKids_xxxxx and all I want to do is find them and delete all the children. Simple I thought. Works fine in Python, just cant figure it out in MEL.

Thanks in advance user added image

import maya.cmds as cmds

cmds.select("removeKids_*")

meshes = cmds.ls(sl=True, typ="transform")

for x in range (len(meshes)):
children = cmds.listRelatives(meshes[x])
for i in range (len(children)-1):
cmds.delete(children[i+1])