change the scene opengl sequence rendering to be a global option with rendering and scrubbing settings.

still need to do a do_versions for this to work right without changing settings.
(commit 27442 by Campbell from render25 branch)
This commit is contained in:
2010-03-16 17:37:34 +00:00
parent f12ef12021
commit 5c9c50e13b
13 changed files with 83 additions and 25 deletions

View File

@@ -361,6 +361,28 @@ class SEQUENCER_PT_edit(SequencerButtonsPanel):
col.prop(strip, "end_still", text="End")
class SEQUENCER_PT_preview(bpy.types.Panel):
bl_label = "Scene Preview/Render"
bl_space_type = 'SEQUENCE_EDITOR'
bl_region_type = 'UI'
def draw(self, context):
layout = self.layout
render = context.scene.render
col = layout.column()
col.prop(render, "use_sequencer_gl_preview", text="Open GL Preview")
col = layout.column()
col.active = render.use_sequencer_gl_preview
col.prop(render, "sequencer_gl_preview", text="")
col = layout.column()
col.prop(render, "use_sequencer_gl_render", text="Open GL Render")
col = layout.column()
col.active = render.use_sequencer_gl_render
col.prop(render, "sequencer_gl_render", text="")
class SEQUENCER_PT_effect(SequencerButtonsPanel):
bl_label = "Effect Strip"
@@ -621,8 +643,6 @@ class SEQUENCER_PT_scene(SequencerButtonsPanel):
layout.label(text="Camera Override")
layout.template_ID(strip, "scene_camera")
layout.prop(strip, "use_opengl")
class SEQUENCER_PT_filter(SequencerButtonsPanel):
bl_label = "Filter"
@@ -731,6 +751,7 @@ classes = [
SEQUENCER_MT_strip,
SEQUENCER_PT_edit, # sequencer panels
SEQUENCER_PT_preview,
SEQUENCER_PT_effect,
SEQUENCER_PT_input_movie,
SEQUENCER_PT_input_image,

View File

@@ -234,7 +234,7 @@ struct Sequence *sequencer_add_sound_strip(struct bContext *C, ListBase *seqbase
struct Sequence *sequencer_add_movie_strip(struct bContext *C, ListBase *seqbasep, struct SeqLoadInfo *seq_load);
/* view3d draw callback, run when not in background view */
typedef struct ImBuf *(*SequencerDrawView)(struct Scene *, int, int);
typedef struct ImBuf *(*SequencerDrawView)(struct Scene *, int, int, int);
extern SequencerDrawView sequencer_view3d_cb;
/* copy/paste */

View File

@@ -365,7 +365,11 @@ Scene *add_scene(char *name)
sce->r.scemode= R_DOCOMP|R_DOSEQ|R_EXTENSION;
sce->r.stamp= R_STAMP_TIME|R_STAMP_FRAME|R_STAMP_DATE|R_STAMP_SCENE|R_STAMP_CAMERA|R_STAMP_RENDERTIME;
sce->r.stamp_font_id= 12;
sce->r.seq_prev_type= OB_SOLID;
sce->r.seq_rend_type= OB_SOLID;
sce->r.seq_flag= R_SEQ_GL_PREV;
sce->r.threads= 1;
sce->r.simplify_subsurf= 6;

View File

@@ -2152,6 +2152,9 @@ static void do_build_seq_ibuf(Scene *scene, Sequence * seq, TStripElem *se, int
int rendering = 1;
int doseq;
int doseq_gl= G.rendering ? (scene->r.seq_flag & R_SEQ_GL_REND) : (scene->r.seq_flag & R_SEQ_GL_PREV);
printf("%d\n", G.rendering);
/* prevent eternal loop */
doseq= scene->r.scemode & R_DOSEQ;
@@ -2167,10 +2170,10 @@ static void do_build_seq_ibuf(Scene *scene, Sequence * seq, TStripElem *se, int
seq->scene->markers.first= seq->scene->markers.last= NULL;
#endif
if(sequencer_view3d_cb && (seq->flag & SEQ_USE_SCENE_OPENGL) && (seq->scene == scene || have_seq==0)) {
if(sequencer_view3d_cb && doseq_gl && (seq->scene == scene || have_seq==0)) {
/* opengl offscreen render */
scene_update_for_newframe(seq->scene, seq->scene->lay);
se->ibuf= sequencer_view3d_cb(seq->scene, seqrectx, seqrecty);
se->ibuf= sequencer_view3d_cb(seq->scene, seqrectx, seqrecty, scene->r.seq_prev_type);
}
else {
Render *re;

View File

@@ -161,7 +161,7 @@ void ED_view3d_draw_offscreen(struct Scene *scene, struct View3D *v3d, struct AR
int winx, int winy, float viewmat[][4], float winmat[][4]);
struct ImBuf *ED_view3d_draw_offscreen_imbuf(struct Scene *scene, struct View3D *v3d, struct ARegion *ar, int sizex, int sizey);
struct ImBuf *ED_view3d_draw_offscreen_imbuf_simple(Scene *scene, int width, int height);
struct ImBuf *ED_view3d_draw_offscreen_imbuf_simple(Scene *scene, int width, int height, int drawtype);
void view3d_clipping_local(struct RegionView3D *rv3d, float mat[][4]);

View File

@@ -2078,7 +2078,7 @@ ImBuf *ED_view3d_draw_offscreen_imbuf(Scene *scene, View3D *v3d, ARegion *ar, in
}
/* creates own 3d views, used by the sequencer */
ImBuf *ED_view3d_draw_offscreen_imbuf_simple(Scene *scene, int width, int height)
ImBuf *ED_view3d_draw_offscreen_imbuf_simple(Scene *scene, int width, int height, int drawtype)
{
View3D v3d;
ARegion ar;
@@ -2095,7 +2095,7 @@ ImBuf *ED_view3d_draw_offscreen_imbuf_simple(Scene *scene, int width, int height
v3d.camera= scene->camera;
v3d.lay= scene->lay;
v3d.drawtype = OB_SOLID; /* should be able to configure */
v3d.drawtype = drawtype;
rv3d.persp= RV3D_CAMOB;

View File

@@ -360,6 +360,12 @@ typedef struct RenderData {
float fg_stamp[4];
float bg_stamp[4];
/* sequencer options */
char seq_prev_type;
char seq_rend_type;
char seq_flag; /* flag use for sequence render/draw */
char pad5[5];
/* render simplify */
int simplify_flag;
short simplify_subsurf;
@@ -838,6 +844,10 @@ typedef struct Scene {
#define R_TOUCH 0x800000 /* touch files before rendering */
#define R_SIMPLIFY 0x1000000
/* seq_flag */
#define R_SEQ_GL_PREV 1
#define R_SEQ_GL_REND 2
/* displaymode */
#define R_OUTPUT_SCREEN 0
@@ -979,6 +989,9 @@ typedef struct Scene {
/* simplify_flag */
#define R_SIMPLE_NO_TRIANGULATE 1
/* sequencer seq_prev_type seq_rend_type */
/* **************** SCENE ********************* */
/* for general use */

View File

@@ -275,8 +275,6 @@ typedef struct SpeedControlVars {
#define SEQ_USE_PROXY_CUSTOM_FILE 2097152
#define SEQ_USE_EFFECT_DEFAULT_FADE 4194304
#define SEQ_USE_SCENE_OPENGL 8388608
/* deprecated, dont use a flag anymore*/
/*#define SEQ_ACTIVE 1048576*/

View File

@@ -84,6 +84,8 @@ extern EnumPropertyItem wm_report_items[];
extern EnumPropertyItem property_type_items[];
extern EnumPropertyItem property_unit_items[];
extern EnumPropertyItem viewport_shading_items[];
struct bContext;
struct PointerRNA;
EnumPropertyItem *rna_TransformOrientation_itemf(struct bContext *C, struct PointerRNA *ptr, int *free);

View File

@@ -26,6 +26,7 @@
#include "RNA_define.h"
#include "RNA_types.h"
#include "RNA_enum_types.h"
#include "rna_internal.h"
@@ -2504,6 +2505,27 @@ static void rna_def_scene_render_data(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Stamp Background", "Color to use behind stamp text");
RNA_def_property_update(prop, NC_SCENE|ND_RENDER_OPTIONS, NULL);
/* sequencer draw options */
prop= RNA_def_property(srna, "use_sequencer_gl_preview", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "seq_flag", R_SEQ_GL_PREV);
RNA_def_property_ui_text(prop, "Sequencer OpenGL", "");
prop= RNA_def_property(srna, "use_sequencer_gl_render", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "seq_flag", R_SEQ_GL_REND);
RNA_def_property_ui_text(prop, "Sequencer OpenGL", "");
prop= RNA_def_property(srna, "sequencer_gl_preview", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "seq_prev_type");
RNA_def_property_enum_items(prop, viewport_shading_items);
RNA_def_property_ui_text(prop, "Sequencer Preview Shading", "Method to draw in the sequencer view");
prop= RNA_def_property(srna, "sequencer_gl_render", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "seq_rend_type");
RNA_def_property_enum_items(prop, viewport_shading_items);
RNA_def_property_ui_text(prop, "Sequencer Preview Shading", "Method to draw in the sequencer view");
/* layers */
prop= RNA_def_property(srna, "layers", PROP_COLLECTION, PROP_NONE);

View File

@@ -926,11 +926,6 @@ static void rna_def_scene(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Camera Override", "Override the scenes active camera");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
prop= RNA_def_property(srna, "use_opengl", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_USE_SCENE_OPENGL);
RNA_def_property_ui_text(prop, "Use OpenGL", "Use OpenGL preview rather then rendering the scene");
RNA_def_property_update(prop, NC_SCENE|ND_SEQUENCER, "rna_Sequence_update");
rna_def_filter_video(srna);
rna_def_proxy(srna);
rna_def_input(srna);

View File

@@ -90,6 +90,14 @@ EnumPropertyItem autosnap_items[] = {
{SACTSNAP_MARKER, "MARKER", 0, "Nearest Marker", "Snap to nearest marker"},
{0, NULL, 0, NULL, NULL}};
EnumPropertyItem viewport_shading_items[] = {
{OB_BOUNDBOX, "BOUNDBOX", ICON_BBOX, "Bounding Box", "Display the object's local bounding boxes only"},
{OB_WIRE, "WIREFRAME", ICON_WIRE, "Wireframe", "Display the object as wire edges"},
{OB_SOLID, "SOLID", ICON_SOLID, "Solid", "Display the object solid, lit with default OpenGL lights"},
//{OB_SHADED, "SHADED", ICON_SMOOTH, "Shaded", "Display the object solid, with preview shading interpolated at vertices"},
{OB_TEXTURE, "TEXTURED", ICON_POTATO, "Textured", "Display the object solid, with face-assigned textures"},
{0, NULL, 0, NULL, NULL}};
#ifdef RNA_RUNTIME
#include "DNA_anim_types.h"
@@ -814,14 +822,6 @@ static void rna_def_space_3dview(BlenderRNA *brna)
StructRNA *srna;
PropertyRNA *prop;
int matrix_dimsize[]= {4, 4};
static EnumPropertyItem viewport_shading_items[] = {
{OB_BOUNDBOX, "BOUNDBOX", ICON_BBOX, "Bounding Box", "Display the object's local bounding boxes only"},
{OB_WIRE, "WIREFRAME", ICON_WIRE, "Wireframe", "Display the object as wire edges"},
{OB_SOLID, "SOLID", ICON_SOLID, "Solid", "Display the object solid, lit with default OpenGL lights"},
//{OB_SHADED, "SHADED", ICON_SMOOTH, "Shaded", "Display the object solid, with preview shading interpolated at vertices"},
{OB_TEXTURE, "TEXTURED", ICON_POTATO, "Textured", "Display the object solid, with face-assigned textures"},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem pivot_items[] = {
{V3D_CENTER, "BOUNDING_BOX_CENTER", ICON_ROTATE, "Bounding Box Center", ""},

View File

@@ -1028,7 +1028,7 @@ int main(int argc, char **argv)
* Update: now this function also inits the bpymenus, which also depend
* on U.pythondir.
*/
// TODO - U.pythondir
#endif