Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_operators/clip.py
| Show First 20 Lines • Show All 480 Lines • ▼ Show 20 Lines | def _bake_object(self, scene, ob): | ||||
| if con.type == 'FOLLOW_TRACK' and con.use_3d_position: | if con.type == 'FOLLOW_TRACK' and con.use_3d_position: | ||||
| mat = ob.matrix_world.copy() | mat = ob.matrix_world.copy() | ||||
| ob.constraints.remove(con) | ob.constraints.remove(con) | ||||
| ob.matrix_world = mat | ob.matrix_world = mat | ||||
| return {'FINISHED'} | return {'FINISHED'} | ||||
| # Find start and end frames. | # Find start and end frames. | ||||
| for track in clip.tracking.tracks: | mtobject = clip.tracking.objects[con.object] | ||||
| tracks = clip.tracking.tracks if mtobject.is_camera else mtobject.tracks | |||||
| for track in tracks: | |||||
| if sfra is None: | if sfra is None: | ||||
sergey: Never catch generic exception, catch only what you expect to be a "good" failure.
My guess is… | |||||
| sfra = track.markers[0].frame | sfra = track.markers[0].frame | ||||
Done Inline ActionsGive human readable and regular human being understandable error message. I am quite sure it's onyl a handful of artists for whom this error message will give clues. sergey: Give human readable and regular human being understandable error message. I am quite sure it's… | |||||
| else: | else: | ||||
| sfra = min(sfra, track.markers[0].frame) | sfra = min(sfra, track.markers[0].frame) | ||||
| if efra is None: | if efra is None: | ||||
| efra = track.markers[-1].frame | efra = track.markers[-1].frame | ||||
| else: | else: | ||||
| efra = max(efra, track.markers[-1].frame) | efra = max(efra, track.markers[-1].frame) | ||||
| ▲ Show 20 Lines • Show All 593 Lines • Show Last 20 Lines | |||||
Never catch generic exception, catch only what you expect to be a "good" failure.
My guess is that you're trying to deal with possibly bad object name reference. Why not to do `tracking_object = clip.tracking.objects.get(con.object, None) ?