diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-09-13 17:34:12 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-09-13 17:34:12 +0400 |
commit | ed2343270cca67b866876e1474f928b3315d1875 (patch) | |
tree | e817bf3b684c879fcb4417b4349bb840c145469a /source/blender/editors/render/render_internal.c | |
parent | b938293576dd7eb2ca8d9149cfe2f9783883fbb1 (diff) |
Related to #36710: add a "use_viewport" option to the render operator, to specify
if the layers and camera of the 3d viewport should be used. Python scripts don't
always want this behavior.
Diffstat (limited to 'source/blender/editors/render/render_internal.c')
-rw-r--r-- | source/blender/editors/render/render_internal.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c index f59c5d6af8d..0f83316edca 100644 --- a/source/blender/editors/render/render_internal.c +++ b/source/blender/editors/render/render_internal.c @@ -571,14 +571,15 @@ static int screen_render_invoke(bContext *C, wmOperator *op, const wmEvent *even Main *mainp; Scene *scene = CTX_data_scene(C); SceneRenderLayer *srl = NULL; - View3D *v3d = CTX_wm_view3d(C); Render *re; wmJob *wm_job; RenderJob *rj; Image *ima; int jobflag; - const short is_animation = RNA_boolean_get(op->ptr, "animation"); - const short is_write_still = RNA_boolean_get(op->ptr, "write_still"); + const bool is_animation = RNA_boolean_get(op->ptr, "animation"); + const bool is_write_still = RNA_boolean_get(op->ptr, "write_still"); + const bool use_viewport = RNA_boolean_get(op->ptr, "use_viewport"); + View3D *v3d = use_viewport ? CTX_wm_view3d(C) : NULL; struct Object *camera_override = v3d ? V3D_CAMERA_LOCAL(v3d) : NULL; const char *name; Object *active_object = CTX_data_active_object(C); @@ -737,6 +738,7 @@ void RENDER_OT_render(wmOperatorType *ot) RNA_def_boolean(ot->srna, "animation", 0, "Animation", "Render files from the animation range of this scene"); RNA_def_boolean(ot->srna, "write_still", 0, "Write Image", "Save rendered the image to the output path (used only when animation is disabled)"); + RNA_def_boolean(ot->srna, "use_viewport", 0, "Use 3D Viewport", "When inside a 3D viewport, use layers and camera of the viewport"); prop = RNA_def_string(ot->srna, "layer", "", RE_MAXNAME, "Render Layer", "Single render layer to re-render (used only when animation is disabled)"); RNA_def_property_flag(prop, PROP_SKIP_SAVE); prop = RNA_def_string(ot->srna, "scene", "", MAX_ID_NAME - 2, "Scene", "Scene to render, current scene if not specified"); |