3D-FRONT-FUTURE/3D-FRONT-ToolBox

Question about dependency(mathutils,bpy).

nobodypengium opened this issue · 2 comments

Hi,

I'm rendering using scripts/render.py. There is an error on LINE 57

direction = target - loc

Errrors shown here:

Traceback (most recent call last):
  File "render.py", line 223, in <module>
    render_function(mesh_list,tex_list,cam_info, os.path.join(args.scene_path, scene))
  File "render.py", line 182, in render_function
    point_at(cam, (info['target'][0],3.2,info['target'][1]))
  File "render.py", line 59, in point_at
    direction = target - loc
AttributeError: Vector subtraction: (Vector - Vector) invalid type for this operation

Then, I debug render.py from LINE 57. By running type(target) and type(loc), the results are all Vector. However, by running isinstance(target, mathutils.Vector) and isinstance(loc, mathutils.Vector), the results are True and False respectively. i.e. The

I find a way to solve this:

if not isinstance(loc, mathutils.Vector):
        loc = mathutils.Vector(loc.to_tuple())

But this is somewhat unnature.

I think this caused by the inappropriate version of mathutils and bpy.
So could you please tell me the version of these two packages you are using?

Thanks a lot.

Besides, I wonder that do you use the python interpreter embeded in blender?

Yes, we use the python in the blender, maybe it caused by the different version of blender. We use 2.7x