Unable to transfer animation from audio2face to blender

I’m struggling to export an audio driven blend shape animation from A2F into Blender. I’ve succeeded in doing a character transfer to a custom character created in Blender, and I’ve gotten the A2F generated blend shapes back into Blender and transferred them to my rigged character as shape keys.

When i import animation clip i get the error’
"USDA not a weights animation cache: C:/Users/U/Desktop/CACHE_DATA/fILE.TEST/a2f_export_bsweight.usda
Unable to load data from file C:/Users/U/Desktop/CACHE_DATA/fILE.TEST/a2f_export_bsweight.usda
"

@murumalik i am not with the dev, so take what i am about to say with a grain of salt. with that being said, someone on Discord has experienced similar error report, and what they had to do is to change one of the python files to affect how the usda is being loaded back into Blender.

do you mind uploading the python file so i can see whether it’s the same situation? you can find the “operators.py” in C:\Users\%username%\AppData\Roaming\Blender Foundation\Blender\3.6\scripts\addons\omni_audio2face

1 Like

operators.zip (8.6 KB)

I’m another user with the same problem! Is there any solution??

@harlaz108 below is the workaround found by the other user on Discord. you could give it a try, but i personally did not encounter this issue and
would suggest you err on the side of caution since it does require you to tweak the python code.

look for the definition for loading usda (more than half way down the script) and comment out the line with token[] and float[] by putting # in front of each line:

def load_animation_usda(self, clip_name:str, file_path:str) -> AnimData:
		"""
		Do a quick parse of the input USDA file in plain text, as we can't use the USD Python API yet.
		!TODO: When the USD Python API is available, switch to it instead.
		"""

		with open(file_path, "r") as fp:
			source = fp.read().strip()

			## quick sanity checks; not robust!
			if not all([
					source.startswith("#usda"),
					"framesPerSecond = " in source,
					"uniform token[] blendShapes = [" in source,
					"float[] blendShapeWeights.timeSamples = {" in source,
					#"token[] custom:mh_curveNames = [" in source,
					#"float[] custom:mh_curveValues.timeSamples = {" in source
                    ]):
				self.report({"ERROR"}, f"USDA not a weights animation cache: {file_path}")
				return None

see if that works. if it doesn’t, i would suggest reverting back and see if the mods/devs have other suggestions.

I did it but it make “Audio2Face” removed from “Omniverse” tab in blender.

in all honesty, i would defer to the dev and see if this is a known issue. even though the reported workaround worked for the other user, i cannot say it’s the solution (regardless of versions), especially if it requires tweaking to the code.

i think there was a mistake on the code in my last reply, i believe you will want to make a new line after “source” on the float[] line. try matching to the image above.

1 Like

Work perfectly!!! 4.0 version btw! I’m thankful!
i make a new line after “source” as you notice and A2F was at place
i did everything from the beginning import and was everything there, work perfectly!

2 Likes

Hey folks – I’m the person writing the add-on. :)

You shouldn’t have to edit the code. I’ll run through a test export over here and see what I can find, but if you wouldn’t mind, I’d love to see the .blend file and the .usd / .usda files you’re using that have the error. Thanks!

Alright! I was able to verify the bug and apply the same fix. It looks like those two parameters were removed in one of the recent versions of Audio2Face, but are no longer necessary. Thanks for the report! Next release should have the fix.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.