In a previous version of blender I had script that applied a bevel to a curve, but now cannot get it to work in 2.92. or above. I want to apply the bevel to an object referenced by the variable curveOB1 and have tried the following.
bpy.data.objects[curveOB1.name].select_set(True)
bpy.context.object.data.bevel_mode = 'OBJECT'
bpy.context.object.data.bevel_object = bpy.data.objects['BezCirc-001']
Everything else in my script works but the above, seems to do nothing and no errors. As an alternative I have aslo tried
bpy.ops.object.select_pattern(pattern=curveOB1.name)
in place of the first line.
The old code was:
bpy.context.scene.objects.active = curveOB1
bpy.context.object.data.bevel_object = bpy.data.objects['BezCirc-001']
This gives an error on the first line.
If I use the object data properties manually it works fine.
Any help would be appreciated.
John