PDA

View Full Version : Voodoo to Blender 2.55 problem..



Postrock
22-Dec-10, 12:23
I'm a newbie about Blender so pls excuse if this is a banal issue, i did a series of searches and havent found my solution....
When i try to open a Voodoo tracking python export i saved, it returns the following error:

AttributeError: 'Scene' object has no attribute ' set_frame'
location: <unknown location>:-1


Below is a part of the exported script itself:

# blender export (blender version 2.5x and higher)
# created by voodoo camera tracker - www.digilab.uni-hannover.de
# Creation date: Mon Dec 20 18:33:23 2010
# USAGE: load this python script into Blender's text editor and execute the script with ALT-P
# use the 'voodoo_render_cam' for rendering your scene
# use the helper object 'voodoo_scene' to rotate, translate and scale the scene

import bpy
import mathutils
import string
import math
scene = bpy.context.scene
dummy = bpy.data.objects.new('voodoo_scene', None)
dummy.location = (0.0, 0.0, 0.0)
dummy.rotation_euler = ( -3.141593/2, 0.0, 0.0)
dummy.scale = (0.2, 0.2, 0.2)
scene.objects.link(dummy)
data = bpy.data.cameras.new('voodoo_render_cam')
data.lens_unit = 'DEGREES'
vcam = bpy.data.objects.new('voodoo_render_cam', data)
vcam.location = (0.0, 0.0, 0.0)
vcam.rotation_euler = (0.0, 0.0, 0.0)
vcam.scale = (1.0, 1.0, 1.0)
data.lens = 35.0
data.shift_x = 0.0
data.shift_y = 0.0
data.dof_distance = 0.0
data.clip_start = 0.1
data.clip_end = 1000.0
data.draw_size = 0.5
scene.objects.link(vcam)
vcam.parent = dummy
data = bpy.data.meshes.new('voodoo_FP3D_cloud')
mesh = bpy.data.objects.new('voodoo_FP3D_cloud', data)
mesh.location = (0.0, 0.0, 0.0)
mesh.rotation_euler = (0.0, 0.0, 0.0)
mesh.scale = (1.0, 1.0, 1.0)
scene.objects.link(mesh)
mesh.parent = dummy

#Camera Parameters
scene.set_frame(0)
vcam.data.lens = 42.927190
vcam.matrix_world = mathutils.Matrix([0.999458,-0.003389,-0.032760,0.000000], [-0.002443,-0.999580,0.028874,0.000000], [-0.032844,-0.028779,-0.999046,0.000000], [0.268443,-0.906921,-0.898772,1.000000])
vcam.keyframe_insert('location')
vcam.keyframe_insert('scale')
vcam.keyframe_insert('rotation_euler')
vcam.data.keyframe_insert('lens')

scene.set_frame(1)
vcam.data.lens = 42.927190
vcam.matrix_world = mathutils.Matrix([0.999165,-0.006664,-0.040320,0.000000], [-0.005498,-0.999566,0.028948,0.000000], [-0.040495,-0.028702,-0.998767,0.000000], [0.078954,-0.888576,-0.821536,1.000000])
vcam.keyframe_insert('location')
vcam.keyframe_insert('scale')
vcam.keyframe_insert('rotation_euler')
vcam.data.keyframe_insert('lens')

organic
22-Dec-10, 17:48
I get the same error:-


Traceback (most recent call last):
File "test.py", line 42, in <module>
AttributeError: 'Scene' object has no attribute 'set_frame'

location:<unknown location>:-1

I guess something has changed in Blender or the Voodoo export needs updated.

fobos
22-Dec-10, 18:11
I had a same problem with the officiele 2.55 the problem is the api changed but lukily its a easy fix
just replace in your saved py file every

"set_frame"

with

"frame_set"

example:
scene.set_frame(1)
to
scene.frame_set(1)

and then try to run it

at least it fixed for me... good luck

http://www.lfi.uni-hannover.de/digilabforum/viewtopic.php?f=2&t=1072&sid=a49bc3b0bc676bdf5c57a08a7dd0c60e

organic
22-Dec-10, 18:56
It doesn't seem to work for the most recent Blender build.

The import script you link to gives this error:-

Traceback (most recent call last):
File "/home/organic/install/linux2/2.55/scripts/addons/io_import_voodoo_camera.py", line 220, in invoke
wm.add_fileselect(self)
AttributeError: 'WindowManager' object has no attribute 'add_fileselect'

location:<unknown location>:-1and the change you suggested imports the camera, empty and point cloud successfully, but the camera orientation is wrong.

I guess everything will be updated and working eventually though. I don't intend to complain about anything not working until Blender is finished, stable and released. :D

Postrock
23-Dec-10, 05:50
Many thanks to fobos, replacing "set_frame" did it!! I just composited in AE a basic Blender render and it looks......well it looks like s*** but that's my own fault, its just a cube tracked in front of my house.. :D .. The tracking works though..

Btw..hey organic..camera orient looks nice to me..

Uncle Entity
23-Dec-10, 09:18
add_fileselect now is fileselect_add

Verblender
25-Dec-10, 05:35
That's funny because Blender tolds me:
AttributeError: 'WindowManager' object has no attribute 'fileselect_add'
It occurs in io_import_scene_mhx.py, line 2446, when I try to import a .mhx-file.
:>

Verblender
25-Dec-10, 05:38
Cool, I changed in the script to add_fileselect and it works! :)
Thanks again!

JAKOB
15-Jan-11, 12:14
frame_set work for me to get the tracking in BUT how to fix the problem with the camera orientation after you bring in the voodoo tracking ?

Uncle Entity
15-Jan-11, 14:29
I'm pretty sure the camera orientation thing is a bug in Voodoo itself.

and since there's no way to get a gander at the source...