chinedufn / blender-actions-to-json

Write the joint data for all of a `.blend` file's actions to a JSON file
17 stars 8 forks source link

attribute "action" from "AnimData" is read-only #3

Closed kevzettler closed 6 years ago

kevzettler commented 6 years ago

Hi chinedufn,

unfortunately, I didn't document my animation export pipeline at all and now I'm trying to reconstruct from memory and our old conversations.

I'm hitting this error when trying to export from both the command line and blender console:

>> bpy.ops.import_export.actions2json(filepath='.')
Error: Traceback (most recent call last):
  File "/var/root/Library/Application Support/Blender/2.78/scripts/addons/actions-to-json.py", line 107, in execute
    activeArmature.animation_data.action = bpy.data.actions.get(actionInfo.name)
AttributeError: bpy_struct: attribute "action" from "AnimData" is read-only

location: /Applications/Blender.app/Contents/MacOS/../Resources/2.78/scripts/modules/bpy/ops.py:189

Traceback (most recent call last):
  File "<blender_console>", line 1, in <module>
  File "/Applications/Blender.app/Contents/MacOS/../Resources/2.78/scripts/modules/bpy/ops.py", line 189, in __call__
    ret = op_call(self.idname_py(), None, kw)
RuntimeError: Error: Traceback (most recent call last):
  File "/var/root/Library/Application Support/Blender/2.78/scripts/addons/actions-to-json.py", line 107, in execute
    activeArmature.animation_data.action = bpy.data.actions.get(actionInfo.name)
AttributeError: bpy_struct: attribute "action" from "AnimData" is read-only

location: /Applications/Blender.app/Contents/MacOS/../Resources/2.78/scripts/modules/bpy/ops.py:189

I remember seeing this previously and working around it but don't remember what I did. I feel like it was related to not having an armature selected in the blend file, but I have an armature selected in the blender file

chinedufn commented 6 years ago

I've never seen this but did a quick google of the error and found this:

I have the same problem but and google it and got here, in my case I had renamed an Action and there was an action assigned to the mesh with this name and there were an action with the same name assigned to the armature. It has to be assigned to just one, even though I think it should always be assigned to the armature. On the outliner you can unlink the actions, it solved my problem. I hope this can be usefull to you.

source

Does that help at all by any chance?

kevzettler commented 6 years ago

huh ok i'm not 100% sure what fixed it. I had one action that I had to click the F button on: screenshot 2018-05-13 15 56 49

I also made sure to select the full armature

kevzettler commented 6 years ago

on second confirmation seems the armature wasn't selected

alcoalco commented 5 months ago

Hello, I also encountered this problem. How did you solve it? I didn’t find any solution online. I hope to get your guidance. Thank you very much.

alcoalco commented 5 months ago

I think I know how to do, renaming really helps, thank you!

DrIgnatiusCole commented 2 months ago

Hi I came here with the same problem. I am not 100% sure what it is but it is related to the NLA editor. If you have baked an action, deleted it and then tried to rebake you get this error.

TBH, the NLA is a mystery wrapped in an enigma when it comes to naming. The conflict is with pushed-down action I am fairly sure. Random angry clicking on things with much shouting should resolve it. Hth.