Notifications
Clear all

[Closed] How to remove "SimpleFaceData"?

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)

5 Replies
1 Reply
 MZ1
(@mz1)
Joined: 11 months ago

Posts: 0

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

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
***************************************/

Thank you for your reply.

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

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