0

I want to export the rotation of all objects to a .txt file, but I dont know the actual python ommands in Blender. Made some try with google's help:

import bpy

ob = bpy.context.object

for ob in bpy.data.objects:

     f=open('output.txt','w')
     f.write(ob.rotation.euler[0])
f.close()
brockmann
  • 12,613
  • 4
  • 50
  • 93
  • 1
    How the output should look like? Have a look into Templates > Python > Operator File Export. – brockmann Jun 18 '18 at 11:49
  • It should be a table with the rotation factor for every object. Thanks for help ;-) – Steffen Jun 18 '18 at 11:53
  • No problem @Steffen. Text files can not contain tables. Ascii table? What exactly do you mean by "factor"? – brockmann Jun 18 '18 at 11:55
  • I mean the rotation (for xyz) which defines the mesh object. There are the Location and the Rotation to define every object. And what i need is a export file (maybe txt) where every angle is in. Because i need it for 1000 objects after a rigid body simulation, i dont want to make it by hand (click every object and write down ist from the 3D viewport) – Steffen Jun 18 '18 at 12:03
  • Ok, I get it. Please add that to your post (edit button below) and ideally also add how the text file should look like at the end @Steffen. – brockmann Jun 18 '18 at 12:19
  • Thank you very much....with the script you gave as hint it is working – Steffen Jun 19 '18 at 06:28

0 Answers0