Apply scale on scene reconstruction when applying scale on camera

This means when you've got reconstructed scene assigned to a
3d camera (via camera solver constraint) and applies scale on
this camera from Ctrl-A menu, scale will be applied on the
reconstructed scene and reset camera size to identity.

This is very useful feature for scene orientation, when you'll
just scale camera by S in the viewport to match bundles
some points in the space, and then you'll easiy make camera
have identity scale (which is needed for nice working moblur
and other things mentioning by Sebastian :) without loosing
scale of bundles themselves.

Behavior of apply scale for cameras without clip assigned
to them does not change at all.
This commit is contained in:
2013-05-13 13:37:05 +00:00
parent 2914d15241
commit 682da3ac98
3 changed files with 60 additions and 1 deletions

View File

@@ -58,6 +58,7 @@
#include "BKE_multires.h"
#include "BKE_armature.h"
#include "BKE_lattice.h"
#include "BKE_tracking.h"
#include "RNA_define.h"
#include "RNA_access.h"
@@ -549,8 +550,21 @@ static int apply_objects_internal(bContext *C, ReportList *reports, int apply_lo
}
}
}
else
else if (ob->type == OB_CAMERA) {
MovieClip *clip = BKE_object_movieclip_get(scene, ob, FALSE);
/* applying scale on camera actually scales clip's reconstruction.
* of there's clip assigned to camera nothing to do actually.
*/
if (!clip)
continue;
if (apply_scale)
BKE_tracking_reconstruction_scale(&clip->tracking, ob->size);
}
else {
continue;
}
if (apply_loc)
zero_v3(ob->loc);