Fix #30376: cycles ignores camera override from sequencer.
This commit is contained in:
@@ -250,7 +250,7 @@ static void blender_camera_sync(Camera *cam, BlenderCamera *bcam, int width, int
|
||||
|
||||
/* Sync Render Camera */
|
||||
|
||||
void BlenderSync::sync_camera(int width, int height)
|
||||
void BlenderSync::sync_camera(BL::Object b_override, int width, int height)
|
||||
{
|
||||
BlenderCamera bcam;
|
||||
blender_camera_init(&bcam);
|
||||
@@ -264,6 +264,9 @@ void BlenderSync::sync_camera(int width, int height)
|
||||
/* camera object */
|
||||
BL::Object b_ob = b_scene.camera();
|
||||
|
||||
if(b_override)
|
||||
b_ob = b_override;
|
||||
|
||||
if(b_ob) {
|
||||
blender_camera_from_object(&bcam, b_ob);
|
||||
bcam.matrix = get_transform(b_ob.matrix_world());
|
||||
|
@@ -96,7 +96,7 @@ void BlenderSession::create_session()
|
||||
if(b_rv3d)
|
||||
sync->sync_view(b_v3d, b_rv3d, width, height);
|
||||
else
|
||||
sync->sync_camera(width, height);
|
||||
sync->sync_camera(b_engine.camera_override(), width, height);
|
||||
|
||||
/* create session */
|
||||
session = new Session(session_params);
|
||||
@@ -314,7 +314,7 @@ void BlenderSession::synchronize()
|
||||
if(b_rv3d)
|
||||
sync->sync_view(b_v3d, b_rv3d, width, height);
|
||||
else
|
||||
sync->sync_camera(width, height);
|
||||
sync->sync_camera(b_engine.camera_override(), width, height);
|
||||
|
||||
/* unlock */
|
||||
session->scene->mutex.unlock();
|
||||
|
@@ -55,7 +55,7 @@ public:
|
||||
/* sync */
|
||||
bool sync_recalc();
|
||||
void sync_data(BL::SpaceView3D b_v3d, const char *layer = 0);
|
||||
void sync_camera(int width, int height);
|
||||
void sync_camera(BL::Object b_override, int width, int height);
|
||||
void sync_view(BL::SpaceView3D b_v3d, BL::RegionView3D b_rv3d, int width, int height);
|
||||
|
||||
/* get parameters */
|
||||
|
@@ -356,6 +356,10 @@ static void rna_def_render_engine(BlenderRNA *brna)
|
||||
prop = RNA_def_property(srna, "is_preview", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "flag", RE_ENGINE_PREVIEW);
|
||||
|
||||
prop= RNA_def_property(srna, "camera_override", PROP_POINTER, PROP_NONE);
|
||||
RNA_def_property_pointer_sdna(prop, NULL, "camera_override");
|
||||
RNA_def_property_struct_type(prop, "Object");
|
||||
|
||||
/* registration */
|
||||
|
||||
prop = RNA_def_property(srna, "bl_idname", PROP_STRING, PROP_NONE);
|
||||
|
@@ -84,6 +84,7 @@ typedef struct RenderEngine {
|
||||
void *py_instance;
|
||||
|
||||
int flag;
|
||||
struct Object *camera_override;
|
||||
|
||||
struct Render *re;
|
||||
ListBase fullresult;
|
||||
|
@@ -311,6 +311,7 @@ int RE_engine_render(Render *re, int do_all)
|
||||
engine->flag |= RE_ENGINE_ANIMATION;
|
||||
if (re->r.scemode & R_PREVIEWBUTS)
|
||||
engine->flag |= RE_ENGINE_PREVIEW;
|
||||
engine->camera_override = re->camera_override;
|
||||
|
||||
if ((re->r.scemode & (R_NO_FRAME_UPDATE|R_PREVIEWBUTS))==0)
|
||||
scene_update_for_newframe(re->main, re->scene, re->lay);
|
||||
|
Reference in New Issue
Block a user