I'm writing a script to create a cubical object out of several joined planes. After joining the meshes into one object (shadow_catcher), I need to set its origin to center of mass, so I call the following commands:
bpy.ops.object = bpy.data.objects["shadow_catcher"]
bpy.ops.object.origin_set(type='ORIGIN_CENTER_OF_MASS', center='MEDIAN')
However, I get the following error:
AttributeError: 'Object' object has no attribute 'origin_set'
Strangely, this operation does work using the GUI. I have been searching for a solution for hours but alas no luck.. Any help would be greatly appreciated!
