3

the question is simple - how to copy all the attributes of the curve data to another curve object by python? I need to make it look the same - same cutom bevel, same extrude, same offset... same attributes. Is there any simple python solution?

enter image description here

  • Just to make sure: You'd like to transfer all properties of one curve to another? – brockmann Jun 26 '21 at 07:13
  • Yes - I've just uploaded the blend file as well. I am thinking about looping over all the attributes and copy them one by one by script. Or somehow replace just the curve itself and keep the attributes - that would be the most elegant solution - but I have no idea how to do that... If it would be Maya - you would just switch one node for another node - but in blender? – Ban Podhorsky Jun 26 '21 at 08:37

2 Answers2

1

I think I've solved it! Instead of copying all the attributes (that would be overkill) I discovered - If I will join the curve into original curve - it will inherit all the properties. So I do that in python and then delete old curve data. Of course first I have to match all transforms... If I won't move the pivot, it seams like it's working!

  • Would be great to attach also the python code, so others can learn from you (including me :) ). Thank you – vklidu Jul 28 '21 at 19:21
-1

if you hover over the menu entry with "python tooltips" checked in preferences, you see:

enter image description here

So ...

bpy.ops.object.make_links_data(type='OBDATA') should work.

Chris
  • 59,454
  • 6
  • 30
  • 84
  • This was the first thing I've tried. But it doesn't work - it will replace the curve completely, I need to keep the curve (squares) and transfer only "attributes" - bevel, offset, extrude etc... https://gyazo.com/2e975a14963aa69ff1d55175d8fbf75d – Ban Podhorsky Jun 25 '21 at 10:32