Maya - delete reference edits not working

Hey guys,

I have something very easy but can’t figure it out.

I want to delete some reference edits, and exactly nothing is happening.

refEdits = cmds.referenceQuery(rn, es=True)

contains:

[u'setAttr |test:CHAR|test:geo:geo|test:geo:body|test:geo:head_c_geo|test:geo:head_c_geoShape.uvSet -s 2',
 u'setAttr |test:CHAR|test:geo:geo|test:geo:body|test:geo:head_c_geo|test:geo:head_c_geoShape.uvSet[0].uvSetName -type "string" "map1"',
 u'setAttr |test:CHAR|test:geo:geo|test:geo:body|test:geo:head_c_geo|test:geo:head_c_geoShape.uvSet[1].uvSetName -type "string" "autoUVs"',
 u'setAttr |test:CHAR|test:geo:geo|test:geo:hair|test:geo:headEyelashes_c_geo|test:geo:headEyelashes_c_geoShape.uvSet -s 2',
 u'setAttr |test:CHAR|test:geo:geo|test:geo:hair|test:geo:headEyelashes_c_geo|test:geo:headEyelashes_c_geoShape.uvSet[0].uvSetName -type "string" "map1"',
 u'setAttr |test:CHAR|test:geo:geo|test:geo:hair|test:geo:headEyelashes_c_geo|test:geo:headEyelashes_c_geoShape.uvSet[1].uvSetName -type "string" "map11"',
 u'connectAttr "|test:CHAR.instObjGroups" "ArnoldStandInDefaultLightSet.dagSetMembers" -nextAvailable']

and remove doesn’t do anything


for edit in refEdits:
    print cmds.referenceEdit(edit.lstrip('setAttr '), editCommand='setAttr', removeEdits=True)

I also tried unloading the reference before and reloading it, but aparently this line is already wrong.

And from the help files I can’t seem to figure out how to delete a specific set of reference edits.
I queried them exactly like this before, an intuitive solution would be to be able to provide a certain list to a command with exactly the previously queried and intended query command.

anyone any experience?

thanks.
B.

ok nevermind. aparently you need to provide the set attr name only. So some weird gay string ops can help.

edit = edit.lstrip('setAttr ‘)
edit = edit.split (’ ')[0]

there’s prob. a better way but not that I know of atm.

also this two flags are important apparently:
cmds.referenceEdit(edit, failedEdits=True, successfulEdits=True, editCommand=‘setAttr’, removeEdits=True)