Hello,
I created a scene by linking libraries and made proxies so I can modify objects (pos/rot/scale)
JME or Unity dont seem to be able to load such a setup,
so I wanted to write a script to export a scene configuration(list all objects with them rot/loc/scale and their libraries of origin)
but as I tried this,
import bpy
print("---------------------------------------------------");
li=list(bpy.data.objects)
for obj in li:
if (obj.library):
print(obj.name+" "+obj.library.filepath)
else:
print(obj.name+" [LOCAL]")
print("loc "+str(obj.location))
print("sca "+str(obj.scale))
print(obj.rotation_euler)
print(obj.rotation_quaternion)
print(str(obj.rotation_axis_angle[0])+","+ \
str(obj.rotation_axis_angle[1])+","+ \
str(obj.rotation_axis_angle[2])+","+ \
str(obj.rotation_axis_angle[3]))
print("");
1 - it lists objects that are not in the scene anymore, nor the outliner (yep, I closed/reopened the blend file)
2 - I cant find a way to tell if an object has been rotated XYZ XZY ZXY wise…cos “order” is always equal to “XYZ” (or maybe I should just export the quaternion but it is always set to 0…)
3 - x and y coordinates seem inverted for rotation
Camera [LOCAL]
loc <Vector (7.4811, -6.5076, 5.3437)>
sca <Vector (1.0000, 1.0000, 1.0000)>
<Euler (x=1.1093, y=0.0108, z=0.8149), order='XYZ'>
<Quaternion (w=1.0000, x=0.0000, y=0.0000, z=0.0000)>
0.0,0.0,1.0,0.0
Ground [LOCAL]
loc <Vector (0.0000, 0.0000, 0.0000)>
sca <Vector (10.9069, 10.9069, 10.9069)>
<Euler (x=0.8523, y=0.3220, z=-1.2235), order='XYZ'>
<Quaternion (w=1.0000, x=0.0000, y=0.0000, z=0.0000)>
0.0,0.0,1.0,0.0
Rock1_proxy [LOCAL]
loc <Vector (5.4372, -1.4416, -0.2492)>
sca <Vector (0.6617, 0.6617, 0.6617)>
<Euler (x=1.7993, y=0.1293, z=1.1936), order='XYZ'>
<Quaternion (w=1.0000, x=0.0000, y=0.0000, z=0.0000)>
0.0,0.0,1.0,0.0
...
is there a python guru kind enough to enlight me on this ?
thanks