Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-07-13 23:09:13 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-07-13 23:09:13 +0400
commit41fb3626f3d7c1e75a31aebeb1e488f59aeedf68 (patch)
tree3a8498514cc822ab4adfe924400efbdad94bbab8 /source/blender/editors/space_buttons
parent689abe000dae8a36e4afe29ad01528408ae20e8c (diff)
2.5: Render
* UI layout for scene buttons has quite some changes, I tried to better organize things according to the pipeline, and also showing important properties by default, and collapsing less important ones. Some changes compared to 2.4x: * Panorama is now a Camera property. * Sequence and Compositing are now enabled by default, but will only do something when there is a node tree using nodes, or a strip in the sequence editor. * Enabling Full Sample now automatically enables Save Buffers too. * Stamp option to include info in file is removed, it now simply always does this if one of the stamp infos is enabled. * Xvid, H.264 and Ogg Theora are now directly in the file format menu, but still using FFMPEG. Unfortunately Ogg is broken at the moment (also in 2.4x), so that's disabled. And Xvid crashes on 64bit linux, maybe solvable by upgrading extern/xvidcore/, using ubuntu libs makes it work. * Organized file format menu by image/movie types. Added: * Render layers RNA wrapped, operatorized, layouted. * FFMPEG format/codec options are now working. Defaults changed: * Compositing & Sequencer enabled. * Tiles set to 8x8. * Time/Date/Frame/Scene/Camera/Filename enabled for stamp.
Diffstat (limited to 'source/blender/editors/space_buttons')
-rw-r--r--source/blender/editors/space_buttons/buttons_intern.h3
-rw-r--r--source/blender/editors/space_buttons/buttons_ops.c74
-rw-r--r--source/blender/editors/space_buttons/space_buttons.c3
3 files changed, 80 insertions, 0 deletions
diff --git a/source/blender/editors/space_buttons/buttons_intern.h b/source/blender/editors/space_buttons/buttons_intern.h
index f16a232f26d..f09f35589b9 100644
--- a/source/blender/editors/space_buttons/buttons_intern.h
+++ b/source/blender/editors/space_buttons/buttons_intern.h
@@ -80,5 +80,8 @@ void PARTICLE_OT_remove_keyed_target(struct wmOperatorType *ot);
void PARTICLE_OT_keyed_target_move_up(struct wmOperatorType *ot);
void PARTICLE_OT_keyed_target_move_down(struct wmOperatorType *ot);
+void SCENE_OT_render_layer_add(struct wmOperatorType *ot);
+void SCENE_OT_render_layer_remove(struct wmOperatorType *ot);
+
#endif /* ED_BUTTONS_INTERN_H */
diff --git a/source/blender/editors/space_buttons/buttons_ops.c b/source/blender/editors/space_buttons/buttons_ops.c
index 6fb52c61131..fb1e9d1214d 100644
--- a/source/blender/editors/space_buttons/buttons_ops.c
+++ b/source/blender/editors/space_buttons/buttons_ops.c
@@ -33,6 +33,7 @@
#include "DNA_curve_types.h"
#include "DNA_object_types.h"
#include "DNA_material_types.h"
+#include "DNA_node_types.h"
#include "DNA_texture_types.h"
#include "DNA_scene_types.h"
#include "DNA_world_types.h"
@@ -43,7 +44,9 @@
#include "BKE_library.h"
#include "BKE_main.h"
#include "BKE_material.h"
+#include "BKE_node.h"
#include "BKE_particle.h"
+#include "BKE_scene.h"
#include "BKE_texture.h"
#include "BKE_utildefines.h"
#include "BKE_world.h"
@@ -689,3 +692,74 @@ void PARTICLE_OT_keyed_target_move_down(wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
}
+/********************** render layer operators *********************/
+
+static int render_layer_add_exec(bContext *C, wmOperator *op)
+{
+ Scene *scene= CTX_data_scene(C);
+
+ scene_add_render_layer(scene);
+ scene->r.actlay= BLI_countlist(&scene->r.layers) - 1;
+
+ WM_event_add_notifier(C, NC_SCENE|ND_RENDER_OPTIONS, scene);
+
+ return OPERATOR_FINISHED;
+}
+
+void SCENE_OT_render_layer_add(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Add Render Layer";
+ ot->idname= "SCENE_OT_render_layer_add";
+
+ /* api callbacks */
+ ot->exec= render_layer_add_exec;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+}
+
+static int render_layer_remove_exec(bContext *C, wmOperator *op)
+{
+ Scene *scene= CTX_data_scene(C);
+ SceneRenderLayer *rl;
+ int act= scene->r.actlay;
+
+ if(BLI_countlist(&scene->r.layers) <= 1)
+ return OPERATOR_CANCELLED;
+
+ rl= BLI_findlink(&scene->r.layers, scene->r.actlay);
+ BLI_remlink(&scene->r.layers, rl);
+ MEM_freeN(rl);
+
+ scene->r.actlay= 0;
+
+ if(scene->nodetree) {
+ bNode *node;
+ for(node= scene->nodetree->nodes.first; node; node= node->next) {
+ if(node->type==CMP_NODE_R_LAYERS && node->id==NULL) {
+ if(node->custom1==act)
+ node->custom1= 0;
+ else if(node->custom1>act)
+ node->custom1--;
+ }
+ }
+ }
+
+ WM_event_add_notifier(C, NC_SCENE|ND_RENDER_OPTIONS, scene);
+
+ return OPERATOR_FINISHED;
+}
+
+void SCENE_OT_render_layer_remove(wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Remove Render Layer";
+ ot->idname= "SCENE_OT_render_layer_remove";
+
+ /* api callbacks */
+ ot->exec= render_layer_remove_exec;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+}
diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c
index 6cdb4dbf93d..17f55c9395e 100644
--- a/source/blender/editors/space_buttons/space_buttons.c
+++ b/source/blender/editors/space_buttons/space_buttons.c
@@ -228,6 +228,9 @@ void buttons_operatortypes(void)
WM_operatortype_append(PARTICLE_OT_remove_keyed_target);
WM_operatortype_append(PARTICLE_OT_keyed_target_move_up);
WM_operatortype_append(PARTICLE_OT_keyed_target_move_down);
+
+ WM_operatortype_append(SCENE_OT_render_layer_add);
+ WM_operatortype_append(SCENE_OT_render_layer_remove);
}
void buttons_keymap(struct wmWindowManager *wm)