but Blender doesn’t seem to like this, as it spits the following error
message out:
Traceback (most recent call last):
File "xport03.py", line 54, in EventGUI
File "xport03.py", line 163, in Xport
SystemError: error return without exception set
Line, 163 being
Xloc = round(OorCam.LocX,3)
Any suggestions? I would have thought this would have worked…
Fabrizio: actually, the matrix is always the good solution, since it updates itself even if the object is linked to an armature, which doesn’t always hapen when using .Loc*
Becareful though printing the matrix might crash Blender!
also, it is not a list of list of float, like one might expect. To convert it to a list of list, just use the folowing function:
def convert_float(mtx):
final = []
row = []
for oRow in mtx:
row = [x for x in oRow]
final.append(row)
return final
Cheers Fabrizio. Copied that in to the code, and it works!
thanks.
brian
I’m the king of the road, baby !!!
Joking aside, make sure you double x100 check it. I’d take Martin’s advice over mine anytime when it cames to python and he was probably anticipating something my still-developing-python-mind cannot yet fathom. It might prevent some nasty bug in your script turning out later on!
There doesn’t seem to be any error in that bit of code! It is certainly exporting the camera location OK!
The main problem I’m having is that the file format for RenderBitch isn’t documented, so I’m having to look at the demo scene files, and look through the source code! :-?
Oh, and the RenderBitch website seems to be down as the author has exceeded his monthly bandwidth limit :x
You don’t really have to pay attention to this, since everything works now as you say, but just to inform:
Blender.Camera.Get() gets you the camera data only, that is, things like Lens, clipping values and so on. To get the location you want the data from the object, which is done with Blender.Object.Get(cameraname).
So it would be something like: