How to remove "SimpleFaceData"?


#1

I got a script from online that can remove “day1refCAs”. But how to remove"SimpleFaceData" with the script?
Thank you!

for i = custAttributes.count rootscene to 1 by -1 do custAttributes.delete rootscene 1


Here is the max file.
abc.max (452 KB)


#2

for i = custAttributes.count rootscene to 1 by -1 do custAttributes.delete rootscene i


#3
fn deleteCustAttributeInstances ca_class = 
(
	cas = getclassinstances ca_class
	deleted = [cas.count, 0]
	for ca in cas do
	(
		owner = custattributes.getowner ca
		if isvalidobj owner do
		(
			n = finditem owner.custattributes ca
			if (n > 0) do 
			(
				deleteitem owner.custattributes n
				deleted[2] += 1
			)
		)
	)
	deleted
)
/************* using ********************** 
deleteCustAttributeInstances SimpleFaceData
******************************************/

#4

Thank you for your reply.


#5

Thank you for your reply. It works perfectly so far.


#6

In case anyone visits here…

The SimpleFaceData custom attributes are not scripted custom attributes, rather they are c++ custom attributes. The custattributes struct methods work only on scripted custom attributes.

The SimpleFaceData custom attributes can be removed by running:

for i = rootscene.custattributes.count to 1 by -1 where ((classof rootscene.custattributes[i]) == SimpleFaceData) do
	deleteitem rootscene.custattributes i