[Bf-codereview] Camera tracking integration (issue 5285047)

ideasman42 at gmail.com ideasman42 at gmail.com
Sat Oct 22 15:50:26 CEST 2011


Just looked over python scripts and added some notes, will look over C
source next.


http://codereview.appspot.com/5285047/diff/26003/release/scripts/startup/bl_operators/clip.py
File release/scripts/startup/bl_operators/clip.py (right):

http://codereview.appspot.com/5285047/diff/26003/release/scripts/startup/bl_operators/clip.py#newcode49
release/scripts/startup/bl_operators/clip.py:49: if
bpy.data.objects[track.name].type == 'Empty':
This cant work - its called 'EMPTY'. Also, matching object/track names
seems a bit flaky,

http://codereview.appspot.com/5285047/diff/26003/release/scripts/startup/bl_operators/clip.py#newcode95
release/scripts/startup/bl_operators/clip.py:95: mesh.vertices.add(1)
Adding verts one by one like this realloc's the array every time, better
to build the list first and add all verts at once. Though in this case
its probably not a perfomance hit.

http://codereview.appspot.com/5285047/diff/26003/release/scripts/startup/bl_ui/space_clip.py
File release/scripts/startup/bl_ui/space_clip.py (right):

http://codereview.appspot.com/5285047/diff/26003/release/scripts/startup/bl_ui/space_clip.py#newcode70
release/scripts/startup/bl_ui/space_clip.py:70:
layout.label(text="Average solve error: %.4f" % \
You dont need '\' when surrounded by brackets in python. (other places
use this too)

http://codereview.appspot.com/5285047/diff/26003/release/scripts/startup/bl_ui/space_clip.py#newcode351
release/scripts/startup/bl_ui/space_clip.py:351: op =
row.operator("clip.camera_preset_add", text="", icon="ZOOMOUT")
normally this var is called 'props' since its operator properties.
(other cases like this in this file)

http://codereview.appspot.com/5285047/diff/26003/release/scripts/startup/bl_ui/space_clip.py#newcode651
release/scripts/startup/bl_ui/space_clip.py:651: ratios = [[1, 8], [1,
4], [1, 2], [1, 1], [2, 1], [4, 1], [8, 1]]
suggest to use tuples in cases when the values dont need to be modified
later.

http://codereview.appspot.com/5285047/diff/26003/release/scripts/startup/bl_ui/space_clip.py#newcode803
release/scripts/startup/bl_ui/space_clip.py:803: class
CLIP_MT_select_grouped(Menu):
Not sure this menu is needed at all, there are UI functions to make a
menu from an operators enum.

http://codereview.appspot.com/5285047/


More information about the Bf-codereview mailing list