[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [27333] trunk/blender: move render operators into their own files, render_internal. c & render_opengl.c, rather then have them in the screen module.

Campbell Barton ideasman42 at gmail.com
Mon Mar 8 17:36:54 CET 2010


Revision: 27333
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=27333
Author:   campbellbarton
Date:     2010-03-08 17:36:53 +0100 (Mon, 08 Mar 2010)

Log Message:
-----------
move render operators into their own files, render_internal.c & render_opengl.c, rather then have them in the screen module.
also rename render operators SCREEN_OT_ --> RENDER_OT_

Modified Paths:
--------------
    trunk/blender/release/scripts/io/netrender/ui.py
    trunk/blender/release/scripts/ui/properties_render.py
    trunk/blender/release/scripts/ui/space_info.py
    trunk/blender/release/scripts/ui/space_view3d.py
    trunk/blender/source/blender/editors/include/ED_screen.h
    trunk/blender/source/blender/editors/render/render_intern.h
    trunk/blender/source/blender/editors/render/render_ops.c
    trunk/blender/source/blender/editors/screen/screen_edit.c
    trunk/blender/source/blender/editors/screen/screen_intern.h
    trunk/blender/source/blender/editors/screen/screen_ops.c
    trunk/blender/source/blender/editors/space_node/drawnode.c

Added Paths:
-----------
    trunk/blender/source/blender/editors/render/render_internal.c
    trunk/blender/source/blender/editors/render/render_opengl.c

Modified: trunk/blender/release/scripts/io/netrender/ui.py
===================================================================
--- trunk/blender/release/scripts/io/netrender/ui.py	2010-03-08 15:44:26 UTC (rev 27332)
+++ trunk/blender/release/scripts/io/netrender/ui.py	2010-03-08 16:36:53 UTC (rev 27333)
@@ -188,8 +188,8 @@
             layout.operator("render.netclientsend", icon='FILE_BLEND')
             if netsettings.job_id:
                 row = layout.row()
-                row.operator("screen.render", text="Get Image", icon='RENDER_STILL')
-                row.operator("screen.render", text="Get Animation", icon='RENDER_ANIMATION').animation = True
+                row.operator("render.render", text="Get Image", icon='RENDER_STILL')
+                row.operator("render.render", text="Get Animation", icon='RENDER_ANIMATION').animation = True
 
         split = layout.split(percentage=0.3)
 

Modified: trunk/blender/release/scripts/ui/properties_render.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_render.py	2010-03-08 15:44:26 UTC (rev 27332)
+++ trunk/blender/release/scripts/ui/properties_render.py	2010-03-08 16:36:53 UTC (rev 27333)
@@ -53,11 +53,11 @@
         split = layout.split()
 
         col = split.column()
-        col.operator("screen.render", text="Image", icon='RENDER_STILL')
+        col.operator("render.render", text="Image", icon='RENDER_STILL')
 
         if wide_ui:
             col = split.column()
-        col.operator("screen.render", text="Animation", icon='RENDER_ANIMATION').animation = True
+        col.operator("render.render", text="Animation", icon='RENDER_ANIMATION').animation = True
 
         layout.prop(rd, "display_mode", text="Display")
 

Modified: trunk/blender/release/scripts/ui/space_info.py
===================================================================
--- trunk/blender/release/scripts/ui/space_info.py	2010-03-08 15:44:26 UTC (rev 27332)
+++ trunk/blender/release/scripts/ui/space_info.py	2010-03-08 16:36:53 UTC (rev 27333)
@@ -275,18 +275,18 @@
 
         # rd = context.scene.render
 
-        layout.operator("screen.render", text="Render Image", icon='RENDER_STILL')
-        layout.operator("screen.render", text="Render Animation", icon='RENDER_ANIMATION').animation = True
+        layout.operator("render.render", text="Render Image", icon='RENDER_STILL')
+        layout.operator("render.render", text="Render Animation", icon='RENDER_ANIMATION').animation = True
 
         layout.separator()
 
-        layout.operator("screen.opengl_render", text="OpenGL Render Image")
-        layout.operator("screen.opengl_render", text="OpenGL Render Animation").animation = True
+        layout.operator("render.opengl", text="OpenGL Render Image")
+        layout.operator("render.opengl", text="OpenGL Render Animation").animation = True
 
         layout.separator()
 
-        layout.operator("screen.render_view_show")
-        layout.operator("screen.play_rendered_anim")
+        layout.operator("render.view_show")
+        layout.operator("render.play_rendered_anim")
 
 
 class INFO_MT_help(bpy.types.Menu):

Modified: trunk/blender/release/scripts/ui/space_view3d.py
===================================================================
--- trunk/blender/release/scripts/ui/space_view3d.py	2010-03-08 15:44:26 UTC (rev 27332)
+++ trunk/blender/release/scripts/ui/space_view3d.py	2010-03-08 16:36:53 UTC (rev 27333)
@@ -96,8 +96,8 @@
 
         # OpenGL render
         row = layout.row(align=True)
-        row.operator("screen.opengl_render", text="", icon='RENDER_STILL')
-        props = row.operator("screen.opengl_render", text="", icon='RENDER_ANIMATION')
+        row.operator("render.opengl", text="", icon='RENDER_STILL')
+        props = row.operator("render.opengl", text="", icon='RENDER_ANIMATION')
         props.animation = True
 
         # Pose

Modified: trunk/blender/source/blender/editors/include/ED_screen.h
===================================================================
--- trunk/blender/source/blender/editors/include/ED_screen.h	2010-03-08 15:44:26 UTC (rev 27332)
+++ trunk/blender/source/blender/editors/include/ED_screen.h	2010-03-08 16:36:53 UTC (rev 27333)
@@ -102,6 +102,7 @@
 int		ED_screen_full_newspace(struct bContext *C, ScrArea *sa, int type);
 void	ED_screen_full_prevspace(struct bContext *C, ScrArea *sa);
 void	ED_screen_full_restore(struct bContext *C, ScrArea *sa);
+struct ScrArea *ED_screen_full_toggle(struct bContext *C, struct wmWindow *win, struct ScrArea *sa);
 
 void	ED_screen_new_window(struct bContext *C, struct rcti *position, int type);
 

Modified: trunk/blender/source/blender/editors/render/render_intern.h
===================================================================
--- trunk/blender/source/blender/editors/render/render_intern.h	2010-03-08 15:44:26 UTC (rev 27332)
+++ trunk/blender/source/blender/editors/render/render_intern.h	2010-03-08 16:36:53 UTC (rev 27333)
@@ -30,6 +30,8 @@
 #define RENDER_INTERN_H
 
 struct wmOperatorType;
+struct RenderResult;
+struct Scene;
 
 /* render_shading.c */
 void OBJECT_OT_material_slot_add(struct wmOperatorType *ot);
@@ -51,6 +53,17 @@
 
 void TEXTURE_OT_slot_move(struct wmOperatorType *ot);
 
+/* render_internal.c */
+void RENDER_OT_view_show(struct wmOperatorType *ot);
+void RENDER_OT_render(struct wmOperatorType *ot);
+void RENDER_OT_view_cancel(struct wmOperatorType *ot);
 
+/*render_opengl.c uses these */
+void image_buffer_rect_update(struct Scene *scene, struct RenderResult *rr, struct ImBuf *ibuf, volatile struct rcti *renrect);
+void screen_set_image_output(struct bContext *C, int mx, int my);
+
+/* render_opengl.c */
+void RENDER_OT_opengl(struct wmOperatorType *ot);
+
 #endif /* RENDER_INTERN_H */
 

Added: trunk/blender/source/blender/editors/render/render_internal.c
===================================================================
--- trunk/blender/source/blender/editors/render/render_internal.c	                        (rev 0)
+++ trunk/blender/source/blender/editors/render/render_internal.c	2010-03-08 16:36:53 UTC (rev 27333)
@@ -0,0 +1,791 @@
+/**
+ * $Id:
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2008 Blender Foundation.
+ * All rights reserved.
+ *
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <math.h>
+#include <string.h>
+#include <stddef.h>
+
+#include "MEM_guardedalloc.h"
+
+#include "BLI_math.h"
+#include "BLI_blenlib.h"
+#include "BLI_editVert.h"
+#include "BLI_dlrbTree.h"
+
+#include "DNA_armature_types.h"
+#include "DNA_image_types.h"
+#include "DNA_lattice_types.h"
+#include "DNA_object_types.h"
+#include "DNA_mesh_types.h"
+#include "DNA_curve_types.h"
+#include "DNA_scene_types.h"
+#include "DNA_meta_types.h"
+
+#include "BKE_blender.h"
+#include "BKE_colortools.h"
+#include "BKE_context.h"
+#include "BKE_customdata.h"
+#include "BKE_global.h"
+#include "BKE_image.h"
+#include "BKE_idprop.h"
+#include "BKE_library.h"
+#include "BKE_main.h"
+#include "BKE_mesh.h"
+#include "BKE_multires.h"
+#include "BKE_report.h"
+#include "BKE_scene.h"
+#include "BKE_screen.h"
+#include "BKE_utildefines.h"
+#include "BKE_sound.h"
+#include "BKE_writeavi.h"
+
+#include "WM_api.h"
+#include "WM_types.h"
+
+#include "ED_util.h"
+#include "ED_screen.h"
+#include "ED_mesh.h"
+#include "ED_object.h"
+#include "ED_screen_types.h"
+#include "ED_keyframes_draw.h"
+
+#include "RE_pipeline.h"
+#include "IMB_imbuf.h"
+#include "IMB_imbuf_types.h"
+
+#include "RNA_access.h"
+#include "RNA_define.h"
+
+#include "UI_interface.h"
+#include "UI_resources.h"
+
+#include "wm_window.h"
+
+#include "render_intern.h"
+
+static ScrArea *biggest_area(bContext *C);
+static ScrArea *biggest_non_image_area(bContext *C);
+static ScrArea *find_area_showing_r_result(bContext *C);
+static ScrArea *find_area_image_empty(bContext *C);
+
+/* called inside thread! */
+void image_buffer_rect_update(Scene *scene, RenderResult *rr, ImBuf *ibuf, volatile rcti *renrect)
+{
+	float x1, y1, *rectf= NULL;
+	int ymin, ymax, xmin, xmax;
+	int rymin, rxmin;
+	char *rectc;
+
+	/* if renrect argument, we only refresh scanlines */
+	if(renrect) {
+		/* if ymax==recty, rendering of layer is ready, we should not draw, other things happen... */
+		if(rr->renlay==NULL || renrect->ymax>=rr->recty)
+			return;
+
+		/* xmin here is first subrect x coord, xmax defines subrect width */
+		xmin = renrect->xmin + rr->crop;
+		xmax = renrect->xmax - xmin - rr->crop;
+		if (xmax<2) return;
+
+		ymin= renrect->ymin + rr->crop;
+		ymax= renrect->ymax - ymin - rr->crop;
+		if(ymax<2)
+			return;
+		renrect->ymin= renrect->ymax;
+
+	}
+	else {
+		xmin = ymin = rr->crop;
+		xmax = rr->rectx - 2*rr->crop;
+		ymax = rr->recty - 2*rr->crop;
+	}
+
+	/* xmin ymin is in tile coords. transform to ibuf */
+	rxmin= rr->tilerect.xmin + xmin;
+	if(rxmin >= ibuf->x) return;
+	rymin= rr->tilerect.ymin + ymin;
+	if(rymin >= ibuf->y) return;
+
+	if(rxmin + xmax > ibuf->x)
+		xmax= ibuf->x - rxmin;
+	if(rymin + ymax > ibuf->y)
+		ymax= ibuf->y - rymin;
+
+	if(xmax < 1 || ymax < 1) return;
+
+	/* find current float rect for display, first case is after composit... still weak */
+	if(rr->rectf)
+		rectf= rr->rectf;
+	else {
+		if(rr->rect32)
+			return;
+		else {
+			if(rr->renlay==NULL || rr->renlay->rectf==NULL) return;
+			rectf= rr->renlay->rectf;
+		}
+	}
+	if(rectf==NULL) return;
+
+	if(ibuf->rect==NULL)
+		imb_addrectImBuf(ibuf);
+
+	rectf+= 4*(rr->rectx*ymin + xmin);
+	rectc= (char *)(ibuf->rect + ibuf->x*rymin + rxmin);
+
+	/* XXX make nice consistent functions for this */
+	if (scene && (scene->r.color_mgt_flag & R_COLOR_MANAGEMENT)) {
+		for(y1= 0; y1<ymax; y1++) {
+			float *rf= rectf;
+			float srgb[3];

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list