In continuation to the discussion to this question on Stackoverflow sambler suggested me to switch here since the questions got more Blender specific.
To sum up, I have to create a Human animation, given frame by frame 3D joint coordinates. Following the answer to my previous post, this is what I have done ->
- Opened blender and deleted all the already present objects in it.
- Created a new empty and named in 'myrig'
Ran the following code ->
import csv import numpy as np import bpy mocap_data = {} # The mocapdata dictionary is properly created here, I checked that scn = bpy.context.scene objs = bpy.data.objects rig = objs['myrig'] for m in mocap_data.keys(): o = objs.new(m, None) scn.objects.link(o) c = rig.pose.bones[m].constraints.new('CHILD_OF') # Line 34 c.target = o
I got the following error,
In line 34 - AttributeError: 'NoneType' object has no attribute 'bones'
What went wrong? As I said in previous post, sorry for not understanding every aspect of the code but I am on a deadline right now. Thanks for the help.