Hello,
I have written a script that reads from a specific .txt all the actions that my imported models from make human are supposed to do…
bpy.ops.object.select_all(action='DESELECT')
# Open activityoutput.txt and import all the actions
f = open('./activityoutput.txt')
lines = [line.strip() for line in open('./activityoutput.txt')]
for line in f:
# Check if it is action
var = ","
line = line.replace(' ', '-')
if not var in line:
if not line in interactions:
if not line in actions:
line = line.capitalize()
line = line.replace('
', '')
name = line + "_proxy"
bpy.ops.object.select_name(name=name, extend = False)
print("human")
print(line)
if line in actions:
print("action")
print(line)
a = actions.index(line)+1
print("actions[a] = " + actions[a])
actions[a] = actions[a].replace('
', '')
bpy.ops.mhx.mocap_load_retarget_simplify('EXEC_DEFAULT', filepath = './actions' + actions[a])
bpy.ops.object.select_all(action='DESELECT')
# Check if it is interaction (by checking if there is comma in the line)
if var in line:
# print("True")
line = line.replace(' ,', ',')
line = line.replace(' ', '-')
line = line.replace('
', '')
ls = line
ls = ls.split(',')
#bpy.ops.object.select_name(name=ls[0] + "_proxy", extend = False)
#bpy.ops.object.select_name(name=ls[1] + "_proxy", extend = False)
if line in interactions:
print("Interaction")
a = interactions.index(line)+1
ls[0] = ls[0].capitalize()
#bpy.ops.object.select_name(name=ls[0] + "_proxy", extend = False)
print(interactions[a])
#bpy.ops.mhx.mocap_load_retarget_simplify('EXEC_DEFAULT', filepath = './interactions' + interactions[a])
#bpy.ops.object.select_all(action='DESELECT')
a = interactions.index(line)+2
ls[1] = ls[1].capitalize()
print(ls[1])
#bpy.ops.object.select_name(name=ls[1] + "_proxy", extend = False)
print(interactions[a])
#bpy.ops.mhx.mocap_load_retarget_simplify('EXEC_DEFAULT', filepath = './interactions' + interactions[a])
#bpy.ops.object.select_all(action='DESELECT')
f.close()
But I get an error in bpy.ops.object.select_all(action=‘DESELECT’), although I run it through blender…
Do you have any idea what could I be doing wrong?