diff options
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/CMakeLists.txt | 1 | ||||
-rw-r--r-- | source/blender/editors/render/SConscript | 2 | ||||
-rw-r--r-- | source/blender/editors/render/render_intern.h | 4 | ||||
-rw-r--r-- | source/blender/editors/render/render_ops.c | 5 | ||||
-rw-r--r-- | source/blender/editors/render/render_shading.c | 122 | ||||
-rw-r--r-- | source/blender/editors/space_outliner/outliner.c | 5 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_edit.c | 4 | ||||
-rw-r--r-- | source/blender/editors/transform/transform.c | 6 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_orientations.c | 1 |
9 files changed, 138 insertions, 12 deletions
diff --git a/source/blender/editors/CMakeLists.txt b/source/blender/editors/CMakeLists.txt index 86085aa0573..58a52f7041d 100644 --- a/source/blender/editors/CMakeLists.txt +++ b/source/blender/editors/CMakeLists.txt @@ -39,6 +39,7 @@ SET(INC ../windowmanager ../../../intern/audaspace/intern ../nodes ../gpu + ../freestyle ../blenfont ../ikplugin ) diff --git a/source/blender/editors/render/SConscript b/source/blender/editors/render/SConscript index 2b9737557cd..5526194eab4 100644 --- a/source/blender/editors/render/SConscript +++ b/source/blender/editors/render/SConscript @@ -5,7 +5,7 @@ sources = env.Glob('*.c') incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf' incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include' -incs += ' ../../gpu' +incs += ' ../../gpu ../../freestyle' incs += ' ../../makesrna ../../render/extern/include #/intern/elbeem/extern' incs += ' ../../blenloader' diff --git a/source/blender/editors/render/render_intern.h b/source/blender/editors/render/render_intern.h index a0441155629..11c2ff6e6f4 100644 --- a/source/blender/editors/render/render_intern.h +++ b/source/blender/editors/render/render_intern.h @@ -50,6 +50,10 @@ void MATERIAL_OT_paste(struct wmOperatorType *ot); void SCENE_OT_render_layer_add(struct wmOperatorType *ot); void SCENE_OT_render_layer_remove(struct wmOperatorType *ot); +void SCENE_OT_freestyle_module_add(struct wmOperatorType *ot); +void SCENE_OT_freestyle_module_remove(struct wmOperatorType *ot); +void SCENE_OT_freestyle_module_move_up(struct wmOperatorType *ot); +void SCENE_OT_freestyle_module_move_down(struct wmOperatorType *ot); void TEXTURE_OT_slot_copy(struct wmOperatorType *ot); diff --git a/source/blender/editors/render/render_ops.c b/source/blender/editors/render/render_ops.c index b1cb1d9c2f1..b3375bcc371 100644 --- a/source/blender/editors/render/render_ops.c +++ b/source/blender/editors/render/render_ops.c @@ -57,6 +57,11 @@ void ED_operatortypes_render(void) WM_operatortype_append(SCENE_OT_render_layer_add); WM_operatortype_append(SCENE_OT_render_layer_remove); + WM_operatortype_append(SCENE_OT_freestyle_module_add); + WM_operatortype_append(SCENE_OT_freestyle_module_remove); + WM_operatortype_append(SCENE_OT_freestyle_module_move_up); + WM_operatortype_append(SCENE_OT_freestyle_module_move_down); + #if (defined(WITH_QUICKTIME) && !defined(USE_QTKIT)) WM_operatortype_append(SCENE_OT_render_data_set_quicktime_codec); #endif diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index efd579735e0..75a220d0e50 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -65,6 +65,8 @@ #include "GPU_material.h" +#include "FRS_freestyle.h" + #include "RNA_access.h" #include "WM_api.h" @@ -705,6 +707,126 @@ void SCENE_OT_render_layer_remove(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } +static int freestyle_module_add_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + SceneRenderLayer *srl = (SceneRenderLayer*) BLI_findlink(&scene->r.layers, scene->r.actlay); + + FRS_add_module(&srl->freestyleConfig); + + WM_event_add_notifier(C, NC_SCENE|ND_RENDER_OPTIONS, scene); + + return OPERATOR_FINISHED; +} + +void SCENE_OT_freestyle_module_add(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Add Freestyle Module"; + ot->idname= "SCENE_OT_freestyle_module_add"; + ot->description="Add a style module into the list of modules."; + + /* api callbacks */ + ot->exec= freestyle_module_add_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +static int freestyle_module_remove_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + SceneRenderLayer *srl = (SceneRenderLayer*) BLI_findlink(&scene->r.layers, scene->r.actlay); + PointerRNA ptr= CTX_data_pointer_get_type(C, "freestyle_module", &RNA_FreestyleModuleSettings); + FreestyleModuleConfig *module= ptr.data; + + FRS_delete_module(&srl->freestyleConfig, module); + + WM_event_add_notifier(C, NC_SCENE|ND_RENDER_OPTIONS, scene); + + return OPERATOR_FINISHED; +} + +void SCENE_OT_freestyle_module_remove(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Remove Freestyle Module"; + ot->idname= "SCENE_OT_freestyle_module_remove"; + ot->description="Remove the style module from the stack."; + + /* api callbacks */ + ot->exec= freestyle_module_remove_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +static int freestyle_module_move_up_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + SceneRenderLayer *srl = (SceneRenderLayer*) BLI_findlink(&scene->r.layers, scene->r.actlay); + PointerRNA ptr= CTX_data_pointer_get_type(C, "freestyle_module", &RNA_FreestyleModuleSettings); + FreestyleModuleConfig *module= ptr.data; + int active = RNA_boolean_get(op->ptr, "active"); + + if(active) + FRS_move_up_module(&srl->freestyleConfig, module); + + WM_event_add_notifier(C, NC_SCENE|ND_RENDER_OPTIONS, scene); + + return OPERATOR_FINISHED; +} + +void SCENE_OT_freestyle_module_move_up(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Move Up Freestyle Module"; + ot->idname= "SCENE_OT_freestyle_module_move_up"; + ot->description="Move the style module up in the stack."; + + /* api callbacks */ + ot->exec= freestyle_module_move_up_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* props */ + RNA_def_boolean(ot->srna, "active", 0, "Active", "True if the operator is enabled."); +} + +static int freestyle_module_move_down_exec(bContext *C, wmOperator *op) +{ + Scene *scene= CTX_data_scene(C); + SceneRenderLayer *srl = (SceneRenderLayer*) BLI_findlink(&scene->r.layers, scene->r.actlay); + PointerRNA ptr= CTX_data_pointer_get_type(C, "freestyle_module", &RNA_FreestyleModuleSettings); + FreestyleModuleConfig *module= ptr.data; + int active = RNA_boolean_get(op->ptr, "active"); + + if(active) + FRS_move_down_module(&srl->freestyleConfig, module); + + WM_event_add_notifier(C, NC_SCENE|ND_RENDER_OPTIONS, scene); + + return OPERATOR_FINISHED; +} + +void SCENE_OT_freestyle_module_move_down(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Move Down Freestyle Module"; + ot->idname= "SCENE_OT_freestyle_module_move_down"; + ot->description="Move the style module down in the stack."; + + /* api callbacks */ + ot->exec= freestyle_module_move_down_exec; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* props */ + RNA_def_boolean(ot->srna, "active", 0, "Active", "True if the operator is enabled."); +} + static int texture_slot_move(bContext *C, wmOperator *op) { ID *id= CTX_data_pointer_get_type(C, "texture_slot", &RNA_TextureSlot).id.data; diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c index 291c67d22ff..40a671c1306 100644 --- a/source/blender/editors/space_outliner/outliner.c +++ b/source/blender/editors/space_outliner/outliner.c @@ -4352,11 +4352,6 @@ static void outliner_draw_iconrow(bContext *C, uiBlock *block, Scene *scene, Spa int active; for(te= lb->first; te; te= te->next) { - - /* exit drawing early */ - if((*offsx) - OL_X > xmax) - break; - tselem= TREESTORE(te); /* object hierarchy always, further constrained on level */ diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 6f97bc04395..4e41314ef20 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -747,7 +747,7 @@ void VIEW3D_OT_rotate(wmOperatorType *ot) /* api callbacks */ ot->invoke= viewrotate_invoke; ot->modal= viewrotate_modal; - ot->poll= ED_operator_view3d_rotate; + ot->poll= ED_operator_view3d_active; /* flags */ ot->flag= OPTYPE_BLOCKING|OPTYPE_GRAB_POINTER; @@ -1992,7 +1992,7 @@ void VIEW3D_OT_view_orbit(wmOperatorType *ot) /* api callbacks */ ot->exec= vieworbit_exec; - ot->poll= ED_operator_view3d_rotate; + ot->poll= ED_operator_view3d_active; /* flags */ ot->flag= 0; diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index e4061a30af1..df024a4b3d9 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -537,9 +537,6 @@ int transformEvent(TransInfo *t, wmEvent *event) if (event->type == MOUSEMOVE) { - if (t->modifiers & MOD_CONSTRAINT_SELECT) - t->con.mode |= CON_SELECT; - t->mval[0] = event->x - t->ar->winrct.xmin; t->mval[1] = event->y - t->ar->winrct.ymin; @@ -1670,6 +1667,9 @@ void transformApply(const bContext *C, TransInfo *t) { if ((t->redraw & TREDRAW_HARD) || (t->draw_handle_apply == NULL && (t->redraw & TREDRAW_SOFT))) { + if (t->modifiers & MOD_CONSTRAINT_SELECT) + t->con.mode |= CON_SELECT; + selectConstraint(t); if (t->transform) { t->transform(t, t->mval); // calls recalcData() diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c index d509ce97015..253f6689e1d 100644 --- a/source/blender/editors/transform/transform_orientations.c +++ b/source/blender/editors/transform/transform_orientations.c @@ -510,7 +510,6 @@ void initTransformOrientation(bContext *C, TransInfo *t) switch(t->current_orientation) { case V3D_MANIP_GLOBAL: - unit_m3(t->spacemtx); strcpy(t->spacename, "global"); break; |