diff options
author | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2011-02-26 23:21:09 +0300 |
---|---|---|
committer | Tamito Kajiyama <rd6t-kjym@asahi-net.or.jp> | 2011-02-26 23:21:09 +0300 |
commit | 63b31ef91b562a1a4aa95991323555a140dd6ede (patch) | |
tree | 4287fcc7edc5e01efbd4b26d7c923c9b0cd8d830 /source/blender/editors | |
parent | 745e396d63ed15fa69203e04840597112498ec3b (diff) | |
parent | 2f0d93ba563ae2c87a088f21113d5559ab9abfc4 (diff) |
Merged changes in the trunk up to revision 35203.
Conflicts resolved:
source/creator/creator.c
source/blender/python/intern/bpy.c
Diffstat (limited to 'source/blender/editors')
364 files changed, 1832 insertions, 927 deletions
diff --git a/source/blender/editors/animation/CMakeLists.txt b/source/blender/editors/animation/CMakeLists.txt index 66ec9cf75d6..f506d278cae 100644 --- a/source/blender/editors/animation/CMakeLists.txt +++ b/source/blender/editors/animation/CMakeLists.txt @@ -22,6 +22,7 @@ set(INC ../include ../../blenkernel + ../../blenloader ../../blenlib ../../makesdna ../../makesrna diff --git a/source/blender/editors/animation/SConscript b/source/blender/editors/animation/SConscript index 4597a612c7c..96b05b8bccc 100644 --- a/source/blender/editors/animation/SConscript +++ b/source/blender/editors/animation/SConscript @@ -4,6 +4,6 @@ Import ('env') sources = env.Glob('*.c') incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../makesrna ../../imbuf' -incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include' +incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include ../../blenloader' env.BlenderLib ( 'bf_editors_animation', sources, Split(incs), [], libtype=['core'], priority=[125] ) diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index e59acacdcf0..dbabd47157a 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c index 338873c2a80..cbbdb3bdd97 100644 --- a/source/blender/editors/animation/anim_channels_edit.c +++ b/source/blender/editors/animation/anim_channels_edit.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/animation/anim_deps.c b/source/blender/editors/animation/anim_deps.c index 340101612b9..be4110c68b9 100644 --- a/source/blender/editors/animation/anim_deps.c +++ b/source/blender/editors/animation/anim_deps.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c index 8a165b9c71b..9b307b92bec 100644 --- a/source/blender/editors/animation/anim_draw.c +++ b/source/blender/editors/animation/anim_draw.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index 8ab677f0f42..ecb6a1b06ce 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/animation/anim_intern.h b/source/blender/editors/animation/anim_intern.h index 274d33e4833..4f88f3ed194 100644 --- a/source/blender/editors/animation/anim_intern.h +++ b/source/blender/editors/animation/anim_intern.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/animation/anim_ipo_utils.c b/source/blender/editors/animation/anim_ipo_utils.c index 023fd7e4efe..a9ff27e970a 100644 --- a/source/blender/editors/animation/anim_ipo_utils.c +++ b/source/blender/editors/animation/anim_ipo_utils.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c index 4b5d11962b2..eaf7590f7dc 100644 --- a/source/blender/editors/animation/anim_markers.c +++ b/source/blender/editors/animation/anim_markers.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -365,7 +365,7 @@ static void draw_marker(View2D *v2d, TimeMarker *marker, int cfra, int flag) } #ifdef DURIAN_CAMERA_SWITCH - if(marker->camera && marker->camera->restrictflag & OB_RESTRICT_RENDER) { + if(marker->camera && (marker->camera->restrictflag & OB_RESTRICT_RENDER)) { float col[4]; glGetFloatv(GL_CURRENT_COLOR, col); col[3]= 0.4; diff --git a/source/blender/editors/animation/anim_ops.c b/source/blender/editors/animation/anim_ops.c index a641b3d1db4..c08b902a13e 100644 --- a/source/blender/editors/animation/anim_ops.c +++ b/source/blender/editors/animation/anim_ops.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c index ede2e243e4a..11795b76905 100644 --- a/source/blender/editors/animation/drivers.c +++ b/source/blender/editors/animation/drivers.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/animation/fmodifier_ui.c b/source/blender/editors/animation/fmodifier_ui.c index 04e81a7d0bf..0b8619c1f6e 100644 --- a/source/blender/editors/animation/fmodifier_ui.c +++ b/source/blender/editors/animation/fmodifier_ui.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/animation/keyframes_draw.c b/source/blender/editors/animation/keyframes_draw.c index dd7020cecab..a2072a60edf 100644 --- a/source/blender/editors/animation/keyframes_draw.c +++ b/source/blender/editors/animation/keyframes_draw.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/animation/keyframes_edit.c b/source/blender/editors/animation/keyframes_edit.c index e92f903eb0d..4eb0ce2c0b3 100644 --- a/source/blender/editors/animation/keyframes_edit.c +++ b/source/blender/editors/animation/keyframes_edit.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/animation/keyframes_general.c b/source/blender/editors/animation/keyframes_general.c index 5ceb1293a58..aea8c2407b4 100644 --- a/source/blender/editors/animation/keyframes_general.c +++ b/source/blender/editors/animation/keyframes_general.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index d53ec9f13e5..adc580c253d 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/animation/keyingsets.c b/source/blender/editors/animation/keyingsets.c index 930563678dd..d71c494705e 100644 --- a/source/blender/editors/animation/keyingsets.c +++ b/source/blender/editors/animation/keyingsets.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -937,6 +937,14 @@ int ANIM_apply_keyingset (bContext *C, ListBase *dsources, bAction *act, KeyingS int arraylen, i; short kflag2; + /* skip path if no ID pointer is specified */ + if (ksp->id == NULL) { + BKE_reportf(reports, RPT_WARNING, + "Skipping path in Keying Set, as it has no ID (KS = '%s', Path = '%s'[%d])", + ks->name, ksp->rna_path, ksp->array_index); + continue; + } + /* since keying settings can be defined on the paths too, extend the path before using it */ kflag2 = (kflag | ksp->keyingflag); @@ -980,20 +988,18 @@ int ANIM_apply_keyingset (bContext *C, ListBase *dsources, bAction *act, KeyingS } /* set recalc-flags */ - if (ksp->id) { - switch (GS(ksp->id->name)) { - case ID_OB: /* Object (or Object-Related) Keyframes */ - { - Object *ob= (Object *)ksp->id; - - ob->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME; // XXX: only object transforms only? - } - break; + switch (GS(ksp->id->name)) { + case ID_OB: /* Object (or Object-Related) Keyframes */ + { + Object *ob= (Object *)ksp->id; + + ob->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME; // XXX: only object transforms only? } - - /* send notifiers for updates (this doesn't require context to work!) */ - WM_main_add_notifier(NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); + break; } + + /* send notifiers for updates (this doesn't require context to work!) */ + WM_main_add_notifier(NC_ANIMATION|ND_KEYFRAME|NA_EDITED, NULL); } /* return the number of channels successfully affected */ diff --git a/source/blender/editors/armature/BIF_generate.h b/source/blender/editors/armature/BIF_generate.h index e73ba962365..3c9f517726f 100644 --- a/source/blender/editors/armature/BIF_generate.h +++ b/source/blender/editors/armature/BIF_generate.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/armature/BIF_retarget.h b/source/blender/editors/armature/BIF_retarget.h index b1b7c38bddc..fe0ac53cfaf 100644 --- a/source/blender/editors/armature/BIF_retarget.h +++ b/source/blender/editors/armature/BIF_retarget.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/armature/CMakeLists.txt b/source/blender/editors/armature/CMakeLists.txt index 6355cc20617..8bbfc3465e3 100644 --- a/source/blender/editors/armature/CMakeLists.txt +++ b/source/blender/editors/armature/CMakeLists.txt @@ -22,6 +22,7 @@ set(INC ../include ../../blenkernel + ../../blenloader ../../blenlib ../../makesdna ../../makesrna diff --git a/source/blender/editors/armature/SConscript b/source/blender/editors/armature/SConscript index 33e237a14db..beabd912a20 100644 --- a/source/blender/editors/armature/SConscript +++ b/source/blender/editors/armature/SConscript @@ -3,7 +3,7 @@ Import ('env') sources = env.Glob('*.c') -incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf' +incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf ../../blenloader' incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include' incs += ' ../../gpu ../../makesrna #/intern/opennl/extern' diff --git a/source/blender/editors/armature/armature_intern.h b/source/blender/editors/armature/armature_intern.h index d898eddd885..2a1185f99c0 100644 --- a/source/blender/editors/armature/armature_intern.h +++ b/source/blender/editors/armature/armature_intern.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -103,6 +103,7 @@ void POSE_OT_select_hierarchy(struct wmOperatorType *ot); void POSE_OT_select_linked(struct wmOperatorType *ot); void POSE_OT_select_constraint_target(struct wmOperatorType *ot); void POSE_OT_select_grouped(struct wmOperatorType *ot); +void POSE_OT_select_flip_active(struct wmOperatorType *ot); void POSE_OT_group_add(struct wmOperatorType *ot); void POSE_OT_group_remove(struct wmOperatorType *ot); diff --git a/source/blender/editors/armature/armature_ops.c b/source/blender/editors/armature/armature_ops.c index 1abb1c05489..26414e59a3c 100644 --- a/source/blender/editors/armature/armature_ops.c +++ b/source/blender/editors/armature/armature_ops.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -119,6 +119,7 @@ void ED_operatortypes_armature(void) WM_operatortype_append(POSE_OT_select_linked); WM_operatortype_append(POSE_OT_select_constraint_target); WM_operatortype_append(POSE_OT_select_grouped); + WM_operatortype_append(POSE_OT_select_flip_active); WM_operatortype_append(POSE_OT_group_add); WM_operatortype_append(POSE_OT_group_remove); @@ -132,7 +133,7 @@ void ED_operatortypes_armature(void) WM_operatortype_append(POSE_OT_autoside_names); WM_operatortype_append(POSE_OT_flip_names); - + WM_operatortype_append(POSE_OT_quaternions_flip); WM_operatortype_append(POSE_OT_flags_set); @@ -165,23 +166,29 @@ void ED_operatormacros_armature(void) wmOperatorTypeMacro *otmacro; ot= WM_operatortype_append_macro("ARMATURE_OT_duplicate_move", "Duplicate", OPTYPE_UNDO|OPTYPE_REGISTER); - WM_operatortype_macro_define(ot, "ARMATURE_OT_duplicate"); - otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); - RNA_enum_set(otmacro->ptr, "proportional", 0); + if(ot) { + WM_operatortype_macro_define(ot, "ARMATURE_OT_duplicate"); + otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); + RNA_enum_set(otmacro->ptr, "proportional", 0); + } ot= WM_operatortype_append_macro("ARMATURE_OT_extrude_move", "Extrude", OPTYPE_UNDO|OPTYPE_REGISTER); - otmacro=WM_operatortype_macro_define(ot, "ARMATURE_OT_extrude"); - RNA_enum_set(otmacro->ptr, "forked", 0); - otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); - RNA_enum_set(otmacro->ptr, "proportional", 0); + if(ot) { + otmacro=WM_operatortype_macro_define(ot, "ARMATURE_OT_extrude"); + RNA_enum_set(otmacro->ptr, "forked", 0); + otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); + RNA_enum_set(otmacro->ptr, "proportional", 0); + } // XXX would it be nicer to just be able to have standard extrude_move, but set the forked property separate? // that would require fixing a properties bug 19733 ot= WM_operatortype_append_macro("ARMATURE_OT_extrude_forked", "Extrude Forked", OPTYPE_UNDO|OPTYPE_REGISTER); - otmacro=WM_operatortype_macro_define(ot, "ARMATURE_OT_extrude"); - RNA_enum_set(otmacro->ptr, "forked", 1); - otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); - RNA_enum_set(otmacro->ptr, "proportional", 0); + if(ot) { + otmacro=WM_operatortype_macro_define(ot, "ARMATURE_OT_extrude"); + RNA_enum_set(otmacro->ptr, "forked", 1); + otmacro= WM_operatortype_macro_define(ot, "TRANSFORM_OT_translate"); + RNA_enum_set(otmacro->ptr, "proportional", 0); + } } void ED_keymap_armature(wmKeyConfig *keyconf) @@ -212,6 +219,8 @@ void ED_keymap_armature(wmKeyConfig *keyconf) /* only set in editmode armature, by space_view3d listener */ WM_keymap_add_item(keymap, "ARMATURE_OT_hide", HKEY, KM_PRESS, 0, 0); + kmi= WM_keymap_add_item(keymap, "ARMATURE_OT_hide", HKEY, KM_PRESS, KM_SHIFT, 0); + RNA_boolean_set(kmi->ptr, "unselected", 1); WM_keymap_add_item(keymap, "ARMATURE_OT_reveal", HKEY, KM_PRESS, KM_ALT, 0); WM_keymap_add_item(keymap, "ARMATURE_OT_align", AKEY, KM_PRESS, KM_CTRL|KM_ALT, 0); WM_keymap_add_item(keymap, "ARMATURE_OT_calculate_roll", NKEY, KM_PRESS, KM_CTRL, 0); @@ -323,6 +332,7 @@ void ED_keymap_armature(wmKeyConfig *keyconf) WM_keymap_add_item(keymap, "POSE_OT_select_linked", LKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "POSE_OT_select_grouped", GKEY, KM_PRESS, KM_SHIFT, 0); + WM_keymap_add_item(keymap, "POSE_OT_select_flip_active", FKEY, KM_PRESS, KM_SHIFT, 0); WM_keymap_add_item(keymap, "POSE_OT_constraint_add_with_targets", CKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0); WM_keymap_add_item(keymap, "POSE_OT_constraints_clear", CKEY, KM_PRESS, KM_CTRL|KM_ALT, 0); diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index 2bd840e2c1d..5c1d1300599 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -3316,11 +3316,12 @@ void ARMATURE_OT_merge (wmOperatorType *ot) /* ************** END Add/Remove stuff in editmode ************ */ /* *************** Tools in editmode *********** */ -static int armature_hide_exec(bContext *C, wmOperator *UNUSED(op)) +static int armature_hide_exec(bContext *C, wmOperator *op) { Object *obedit= CTX_data_edit_object(C); bArmature *arm= obedit->data; EditBone *ebone; + const int invert= RNA_boolean_get(op->ptr, "unselected") ? BONE_SELECTED : 0; /* cancel if nothing selected */ if (CTX_DATA_COUNT(C, selected_bones) == 0) @@ -3328,7 +3329,7 @@ static int armature_hide_exec(bContext *C, wmOperator *UNUSED(op)) for (ebone = arm->edbo->first; ebone; ebone=ebone->next) { if (EBONE_VISIBLE(arm, ebone)) { - if (ebone->flag & BONE_SELECTED) { + if ((ebone->flag & BONE_SELECTED) != invert) { ebone->flag &= ~(BONE_TIPSEL|BONE_SELECTED|BONE_ROOTSEL); ebone->flag |= BONE_HIDDEN_A; } @@ -3355,6 +3356,9 @@ void ARMATURE_OT_hide(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* props */ + RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected."); } static int armature_reveal_exec(bContext *C, wmOperator *UNUSED(op)) diff --git a/source/blender/editors/armature/editarmature_generate.c b/source/blender/editors/armature/editarmature_generate.c index 527f5ba5e69..dfab2db5307 100644 --- a/source/blender/editors/armature/editarmature_generate.c +++ b/source/blender/editors/armature/editarmature_generate.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/armature/editarmature_retarget.c b/source/blender/editors/armature/editarmature_retarget.c index a0e465525b2..86df851424c 100644 --- a/source/blender/editors/armature/editarmature_retarget.c +++ b/source/blender/editors/armature/editarmature_retarget.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/armature/editarmature_sketch.c b/source/blender/editors/armature/editarmature_sketch.c index c0b77b5feef..c11263810cb 100644 --- a/source/blender/editors/armature/editarmature_sketch.c +++ b/source/blender/editors/armature/editarmature_sketch.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/armature/meshlaplacian.c b/source/blender/editors/armature/meshlaplacian.c index 4d78c9e2f7b..efd671c64b3 100644 --- a/source/blender/editors/armature/meshlaplacian.c +++ b/source/blender/editors/armature/meshlaplacian.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/armature/meshlaplacian.h b/source/blender/editors/armature/meshlaplacian.h index 26aa0a17d1c..74de015e12e 100644 --- a/source/blender/editors/armature/meshlaplacian.h +++ b/source/blender/editors/armature/meshlaplacian.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/armature/poseSlide.c b/source/blender/editors/armature/poseSlide.c index 47e5f734f86..5a7c7ffcaf9 100644 --- a/source/blender/editors/armature/poseSlide.c +++ b/source/blender/editors/armature/poseSlide.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/armature/poseUtils.c b/source/blender/editors/armature/poseUtils.c index 7b1b3b6c5c8..c9ba7583689 100644 --- a/source/blender/editors/armature/poseUtils.c +++ b/source/blender/editors/armature/poseUtils.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/armature/poselib.c b/source/blender/editors/armature/poselib.c index 9577c45de50..13a8cef3d07 100644 --- a/source/blender/editors/armature/poselib.c +++ b/source/blender/editors/armature/poselib.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -141,11 +141,18 @@ static TimeMarker *poselib_get_active_pose (bAction *act) } /* Get object that Pose Lib should be found on */ + /* XXX C can be zero */ static Object *get_poselib_object (bContext *C) { - ScrArea *sa = CTX_wm_area(C); + ScrArea *sa; - if (sa->spacetype == SPACE_BUTS) + /* sanity check */ + if (C == NULL) + return NULL; + + sa = CTX_wm_area(C); + + if (sa && (sa->spacetype == SPACE_BUTS)) return CTX_data_pointer_get_type(C, "object", &RNA_Object).data; else return ED_object_pose_armature(CTX_data_active_object(C)); @@ -342,7 +349,7 @@ void POSELIB_OT_action_sanitise (wmOperatorType *ot) static void poselib_add_menu_invoke__replacemenu (bContext *C, uiLayout *layout, void *UNUSED(arg)) { Object *ob= get_poselib_object(C); - bAction *act= ob->poselib; + bAction *act= (ob) ? ob->poselib : NULL; TimeMarker *marker; /* set the operator execution context correctly */ @@ -473,8 +480,8 @@ void POSELIB_OT_pose_add (wmOperatorType *ot) /* can be called with C == NULL */ static EnumPropertyItem *poselib_stored_pose_itemf(bContext *C, PointerRNA *UNUSED(ptr), int *free) { - Object *ob; - bAction *act; + Object *ob = get_poselib_object(C); + bAction *act = (ob) ? ob->poselib : NULL; TimeMarker *marker; EnumPropertyItem *item= NULL, item_tmp= {0}; int totitem= 0; @@ -484,9 +491,6 @@ static EnumPropertyItem *poselib_stored_pose_itemf(bContext *C, PointerRNA *UNUS return DummyRNA_DEFAULT_items; } - ob= get_poselib_object(C); - act= (ob) ? ob->poselib : NULL; - /* check that the action exists */ if (act) { /* add each marker to the list */ diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c index c122460e5bb..01e534cd538 100644 --- a/source/blender/editors/armature/poseobject.c +++ b/source/blender/editors/armature/poseobject.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -656,6 +656,62 @@ void POSE_OT_select_grouped (wmOperatorType *ot) ot->prop= RNA_def_enum(ot->srna, "type", prop_select_grouped_types, 0, "Type", ""); } + +/* ********************************************** */ + +/* context active object, or weightpainted object with armature in posemode */ +static int pose_bone_flip_active_exec (bContext *C, wmOperator *UNUSED(op)) +{ + Object *ob_act= CTX_data_active_object(C); + Object *ob= ED_object_pose_armature(ob_act); + + if(ob && (ob->mode & OB_MODE_POSE)) { + bArmature *arm= ob->data; + + if(arm->act_bone) { + bPoseChannel *pchanf; + char name[MAXBONENAME]; + flip_side_name(name, arm->act_bone->name, TRUE); + + pchanf= get_pose_channel(ob->pose, name); + if(pchanf && pchanf->bone != arm->act_bone) { + arm->act_bone->flag &= ~BONE_SELECTED; + pchanf->bone->flag |= BONE_SELECTED; + + arm->act_bone= pchanf->bone; + + /* in weightpaint we select the associated vertex group too */ + if(ob_act->mode & OB_MODE_WEIGHT_PAINT) { + ED_vgroup_select_by_name(ob_act, name); + DAG_id_tag_update(&ob_act->id, OB_RECALC_DATA); + } + + WM_event_add_notifier(C, NC_OBJECT|ND_BONE_SELECT, ob); + + return OPERATOR_FINISHED; + } + } + } + + return OPERATOR_CANCELLED; +} + +void POSE_OT_select_flip_active(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Flip Selected Active Bone"; + ot->idname= "POSE_OT_select_flip_active"; + ot->description= "Activate the bone with a flipped name."; + + /* api callbacks */ + ot->exec= pose_bone_flip_active_exec; + ot->poll= ED_operator_posemode; + + /* flags */ + ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; +} + + /* ********************************************** */ #if 0 /* UNUSED 2.5 */ static void pose_copy_menu(Scene *scene) @@ -1562,48 +1618,6 @@ void POSE_OT_autoside_names (wmOperatorType *ot) /* ********************************************** */ -/* context active object, or weightpainted object with armature in posemode */ -static void pose_activate_flipped_bone(Scene *scene) -{ - Object *ob= OBACT; - - if(ob==NULL) return; - - if(ob->mode & OB_MODE_WEIGHT_PAINT) { - ob= modifiers_isDeformedByArmature(ob); - } - - if(ob && (ob->mode & OB_MODE_POSE)) { - bPoseChannel *pchanf; - bArmature *arm= ob->data; - - if(arm->act_bone) { - char name[32]; - flip_side_name(name, arm->act_bone->name, TRUE); - - pchanf= get_pose_channel(ob->pose, name); - if(pchanf && pchanf->bone != arm->act_bone) { - arm->act_bone->flag &= ~BONE_SELECTED; - pchanf->bone->flag |= BONE_SELECTED; - - arm->act_bone= pchanf->bone; - - /* in weightpaint we select the associated vertex group too */ - if(ob->mode & OB_MODE_WEIGHT_PAINT) { - ED_vgroup_select_by_name(OBACT, name); - DAG_id_tag_update(&OBACT->id, OB_RECALC_DATA); - } - - // XXX notifiers need to be sent to other editors to update - - } - } - } -} - - -/* ********************************************** */ - /* Show all armature layers */ static int pose_armature_layers_showall_poll (bContext *C) { diff --git a/source/blender/editors/armature/reeb.c b/source/blender/editors/armature/reeb.c index 0e0be99a88a..61ad5528607 100644 --- a/source/blender/editors/armature/reeb.c +++ b/source/blender/editors/armature/reeb.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/armature/reeb.h b/source/blender/editors/armature/reeb.h index cee42313db6..05fba609041 100644 --- a/source/blender/editors/armature/reeb.h +++ b/source/blender/editors/armature/reeb.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/curve/CMakeLists.txt b/source/blender/editors/curve/CMakeLists.txt index 708908eda2b..a73fb9502a6 100644 --- a/source/blender/editors/curve/CMakeLists.txt +++ b/source/blender/editors/curve/CMakeLists.txt @@ -22,6 +22,7 @@ set(INC ../include ../../blenkernel + ../../blenloader ../../blenlib ../../makesdna ../../makesrna diff --git a/source/blender/editors/curve/SConscript b/source/blender/editors/curve/SConscript index f72fc6c8863..efb56ce5466 100644 --- a/source/blender/editors/curve/SConscript +++ b/source/blender/editors/curve/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 ../../blenloader' incs += ' ../../makesrna ../../render/extern/include #/intern/elbeem/extern' env.BlenderLib ( 'bf_editors_curve', sources, Split(incs), [], libtype=['core'], priority=[45] ) diff --git a/source/blender/editors/curve/curve_intern.h b/source/blender/editors/curve/curve_intern.h index 0867556b7f4..551c03b0ae5 100644 --- a/source/blender/editors/curve/curve_intern.h +++ b/source/blender/editors/curve/curve_intern.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/curve/curve_ops.c b/source/blender/editors/curve/curve_ops.c index bb4b81f3078..43df7fa3528 100644 --- a/source/blender/editors/curve/curve_ops.c +++ b/source/blender/editors/curve/curve_ops.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 857a461e26e..bceb103503c 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c index 4b2b0043f65..9616d452333 100644 --- a/source/blender/editors/curve/editfont.c +++ b/source/blender/editors/curve/editfont.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/curve/lorem.c b/source/blender/editors/curve/lorem.c index b38b24ac33a..1c86acf7b1b 100644 --- a/source/blender/editors/curve/lorem.c +++ b/source/blender/editors/curve/lorem.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/gpencil/CMakeLists.txt b/source/blender/editors/gpencil/CMakeLists.txt index 7b22a5a3171..4269c590a14 100644 --- a/source/blender/editors/gpencil/CMakeLists.txt +++ b/source/blender/editors/gpencil/CMakeLists.txt @@ -22,6 +22,7 @@ set(INC ../include ../../blenkernel + ../../blenloader ../../blenlib ../../imbuf ../../makesdna diff --git a/source/blender/editors/gpencil/SConscript b/source/blender/editors/gpencil/SConscript index 06d78d1e7e0..d2fd9e5fe9d 100644 --- a/source/blender/editors/gpencil/SConscript +++ b/source/blender/editors/gpencil/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 ../../blenloader' incs += ' ../../makesrna ../../render/extern/include #/intern/elbeem/extern' env.BlenderLib ( 'bf_editors_gpencil', sources, Split(incs), [], libtype=['core'], priority=[45] ) diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c index 901542ea2de..7ef17542ea4 100644 --- a/source/blender/editors/gpencil/drawgpencil.c +++ b/source/blender/editors/gpencil/drawgpencil.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/gpencil/editaction_gpencil.c b/source/blender/editors/gpencil/editaction_gpencil.c index 643b6c7082f..6ea8b77cc71 100644 --- a/source/blender/editors/gpencil/editaction_gpencil.c +++ b/source/blender/editors/gpencil/editaction_gpencil.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/gpencil/gpencil_buttons.c b/source/blender/editors/gpencil/gpencil_buttons.c index 6af5e4cd92b..e6d22e3049f 100644 --- a/source/blender/editors/gpencil/gpencil_buttons.c +++ b/source/blender/editors/gpencil/gpencil_buttons.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index 498108e8d0e..b699d27dd89 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/gpencil/gpencil_intern.h b/source/blender/editors/gpencil/gpencil_intern.h index 1bfe65eb36c..7ae68d194b3 100644 --- a/source/blender/editors/gpencil/gpencil_intern.h +++ b/source/blender/editors/gpencil/gpencil_intern.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/gpencil/gpencil_ops.c b/source/blender/editors/gpencil/gpencil_ops.c index a84bf5774f6..55b2d2aa73d 100644 --- a/source/blender/editors/gpencil/gpencil_ops.c +++ b/source/blender/editors/gpencil/gpencil_ops.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index 0ebbe223c3f..db594694e64 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/include/BIF_gl.h b/source/blender/editors/include/BIF_gl.h index aca0e671067..85244a85613 100644 --- a/source/blender/editors/include/BIF_gl.h +++ b/source/blender/editors/include/BIF_gl.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -28,6 +28,10 @@ * os dependent include locations of gl.h */ +/** \file BIF_gl.h + * \ingroup editorui + */ + #ifndef BIF_GL_H #define BIF_GL_H diff --git a/source/blender/editors/include/BIF_glutil.h b/source/blender/editors/include/BIF_glutil.h index 3fa07da0437..c9615204607 100644 --- a/source/blender/editors/include/BIF_glutil.h +++ b/source/blender/editors/include/BIF_glutil.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -25,6 +25,10 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file BIF_glutil.h + * \ingroup editorui + */ + #ifndef BIF_GLUTIL_H #define BIF_GLUTIL_H diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h index 997250b7a2a..4a2711df7dd 100644 --- a/source/blender/editors/include/ED_anim_api.h +++ b/source/blender/editors/include/ED_anim_api.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -26,6 +26,10 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file ED_anim_api.h + * \ingroup editors + */ + #ifndef ED_ANIM_API_H #define ED_ANIM_API_H diff --git a/source/blender/editors/include/ED_armature.h b/source/blender/editors/include/ED_armature.h index be63b1bf1ce..fcd56277b87 100644 --- a/source/blender/editors/include/ED_armature.h +++ b/source/blender/editors/include/ED_armature.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -24,6 +24,11 @@ * * ***** END GPL LICENSE BLOCK ***** */ + +/** \file ED_armature.h + * \ingroup editors + */ + #ifndef ED_ARMATURE_H #define ED_ARMATURE_H diff --git a/source/blender/editors/include/ED_curve.h b/source/blender/editors/include/ED_curve.h index 3d8c5dd7cae..08a63a470c1 100644 --- a/source/blender/editors/include/ED_curve.h +++ b/source/blender/editors/include/ED_curve.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -25,6 +25,11 @@ * * ***** END GPL LICENSE BLOCK ***** */ + +/** \file ED_curve.h + * \ingroup editors + */ + #ifndef ED_CURVE_H #define ED_CURVE_H diff --git a/source/blender/editors/include/ED_datafiles.h b/source/blender/editors/include/ED_datafiles.h index 2c352abcd00..ee29df3fffb 100644 --- a/source/blender/editors/include/ED_datafiles.h +++ b/source/blender/editors/include/ED_datafiles.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -26,6 +26,10 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file ED_datafiles.h + * \ingroup editors + */ + #ifndef ED_DATAFILES_H #define ED_DATAFILES_H diff --git a/source/blender/editors/include/ED_fileselect.h b/source/blender/editors/include/ED_fileselect.h index a7d763ca4c8..6b91779b832 100644 --- a/source/blender/editors/include/ED_fileselect.h +++ b/source/blender/editors/include/ED_fileselect.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -25,6 +25,11 @@ * * ***** END GPL LICENSE BLOCK ***** */ + +/** \file ED_fileselect.h + * \ingroup editors + */ + #ifndef ED_FILES_H #define ED_FILES_H diff --git a/source/blender/editors/include/ED_fluidsim.h b/source/blender/editors/include/ED_fluidsim.h index a1ab3ba2fcc..3388280e5fa 100644 --- a/source/blender/editors/include/ED_fluidsim.h +++ b/source/blender/editors/include/ED_fluidsim.h @@ -1,4 +1,4 @@ -/** +/* * BKE_fluidsim.h * * $Id$ @@ -28,6 +28,11 @@ * * ***** END GPL LICENSE BLOCK ***** */ + +/** \file ED_fluidsim.h + * \ingroup editors + */ + #ifndef ED_FLUIDSIM_H #define ED_FLUIDSIM_H diff --git a/source/blender/editors/include/ED_gpencil.h b/source/blender/editors/include/ED_gpencil.h index 08a015a5271..d06b0d6c4ee 100644 --- a/source/blender/editors/include/ED_gpencil.h +++ b/source/blender/editors/include/ED_gpencil.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -25,6 +25,10 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file ED_gpencil.h + * \ingroup editors + */ + #ifndef ED_GPENCIL_H #define ED_GPENCIL_H diff --git a/source/blender/editors/include/ED_image.h b/source/blender/editors/include/ED_image.h index 7f507eab276..2c866495503 100644 --- a/source/blender/editors/include/ED_image.h +++ b/source/blender/editors/include/ED_image.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -25,6 +25,10 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file ED_image.h + * \ingroup editors + */ + #ifndef ED_IMAGE_H #define ED_IMAGE_H diff --git a/source/blender/editors/include/ED_info.h b/source/blender/editors/include/ED_info.h index ece57d19ace..c76c478c6d6 100644 --- a/source/blender/editors/include/ED_info.h +++ b/source/blender/editors/include/ED_info.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -22,6 +22,10 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file ED_info.h + * \ingroup editors + */ + #ifndef ED_INFO_H #define ED_INFO_H diff --git a/source/blender/editors/include/ED_keyframes_draw.h b/source/blender/editors/include/ED_keyframes_draw.h index 10ddf6baaeb..c697f8cc435 100644 --- a/source/blender/editors/include/ED_keyframes_draw.h +++ b/source/blender/editors/include/ED_keyframes_draw.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -27,6 +27,10 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file ED_keyframes_draw.h + * \ingroup editors + */ + #ifndef ED_KEYFRAMES_DRAW_H #define ED_KEYFRAMES_DRAW_H diff --git a/source/blender/editors/include/ED_keyframes_edit.h b/source/blender/editors/include/ED_keyframes_edit.h index 2a7ce9b540b..e6fe7efbaba 100644 --- a/source/blender/editors/include/ED_keyframes_edit.h +++ b/source/blender/editors/include/ED_keyframes_edit.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -26,6 +26,10 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file ED_keyframes_edit.h + * \ingroup editors + */ + #ifndef ED_KEYFRAMES_EDIT_H #define ED_KEYFRAMES_EDIT_H diff --git a/source/blender/editors/include/ED_keyframing.h b/source/blender/editors/include/ED_keyframing.h index 3fea3fa03a5..7bab563641a 100644 --- a/source/blender/editors/include/ED_keyframing.h +++ b/source/blender/editors/include/ED_keyframing.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -25,6 +25,10 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file ED_keyframing.h + * \ingroup editors + */ + #ifndef ED_KEYFRAMING_H #define ED_KEYFRAMING_H diff --git a/source/blender/editors/include/ED_lattice.h b/source/blender/editors/include/ED_lattice.h index bebd6c5f3ab..066dd23a629 100644 --- a/source/blender/editors/include/ED_lattice.h +++ b/source/blender/editors/include/ED_lattice.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -26,6 +26,10 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file ED_lattice.h + * \ingroup editors + */ + struct Object; void free_editLatt(struct Object *ob); diff --git a/source/blender/editors/include/ED_logic.h b/source/blender/editors/include/ED_logic.h index 96d10cf2c72..00fc6ccac26 100644 --- a/source/blender/editors/include/ED_logic.h +++ b/source/blender/editors/include/ED_logic.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -24,6 +24,11 @@ * * ***** END GPL LICENSE BLOCK ***** */ + +/** \file ED_logic.h + * \ingroup editors + */ + #ifndef ED_LOGIC_H #define ED_LOGIC_H diff --git a/source/blender/editors/include/ED_markers.h b/source/blender/editors/include/ED_markers.h index 1f71c377ec0..728d9253760 100644 --- a/source/blender/editors/include/ED_markers.h +++ b/source/blender/editors/include/ED_markers.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -25,6 +25,11 @@ * * ***** END GPL LICENSE BLOCK ***** */ + +/** \file ED_markers.h + * \ingroup editors + */ + #ifndef ED_MARKERS_H #define ED_MARKERS_H diff --git a/source/blender/editors/include/ED_mball.h b/source/blender/editors/include/ED_mball.h index f5021fb9570..504cc4e2d52 100644 --- a/source/blender/editors/include/ED_mball.h +++ b/source/blender/editors/include/ED_mball.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -26,6 +26,13 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file ED_mball.h + * \ingroup editors + */ + +#ifndef _ED_MBALL_H_ +#define _ED_MBALL_H_ + struct bContext; struct Object; struct wmKeyConfig; @@ -43,3 +50,5 @@ void load_editMball(struct Object *obedit); void undo_push_mball(struct bContext *C, const char *name); +#endif + diff --git a/source/blender/editors/include/ED_mesh.h b/source/blender/editors/include/ED_mesh.h index 3d735495fec..054e46971b5 100644 --- a/source/blender/editors/include/ED_mesh.h +++ b/source/blender/editors/include/ED_mesh.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -25,6 +25,11 @@ * * ***** END GPL LICENSE BLOCK ***** */ + +/** \file ED_mesh.h + * \ingroup editors + */ + #ifndef ED_MESH_H #define ED_MESH_H @@ -188,10 +193,8 @@ void paintface_deselect_all_visible(struct Object *ob, int action, short flush_f void paintface_select_linked(struct bContext *C, struct Object *ob, short mval[2], int mode); int paintface_minmax(struct Object *ob, float *min, float *max); -/* TODO, 2.5x */ -void paintface_unhide(struct Scene *scene); -void paintface_hide(struct Scene *scene); -void paintface_select_swap(struct Scene *scene); +void paintface_hide(struct Object *ob, const int unselected); +void paintface_reveal(struct Object *ob); /* object_vgroup.c */ diff --git a/source/blender/editors/include/ED_node.h b/source/blender/editors/include/ED_node.h index d287066828f..829ad3217a9 100644 --- a/source/blender/editors/include/ED_node.h +++ b/source/blender/editors/include/ED_node.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -25,6 +25,11 @@ * * ***** END GPL LICENSE BLOCK ***** */ + +/** \file ED_node.h + * \ingroup editors + */ + #ifndef ED_NODE_H #define ED_NODE_H diff --git a/source/blender/editors/include/ED_numinput.h b/source/blender/editors/include/ED_numinput.h index 7df1f1f28cb..d605a9b3377 100644 --- a/source/blender/editors/include/ED_numinput.h +++ b/source/blender/editors/include/ED_numinput.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -22,6 +22,10 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file ED_numinput.h + * \ingroup editors + */ + #ifndef ED_NUMINPUT_H #define ED_NUMINPUT_H diff --git a/source/blender/editors/include/ED_object.h b/source/blender/editors/include/ED_object.h index 2f54c242717..ce6a9d609db 100644 --- a/source/blender/editors/include/ED_object.h +++ b/source/blender/editors/include/ED_object.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -25,6 +25,11 @@ * * ***** END GPL LICENSE BLOCK ***** */ + +/** \file ED_object.h + * \ingroup editors + */ + #ifndef ED_OBJECT_H #define ED_OBJECT_H diff --git a/source/blender/editors/include/ED_particle.h b/source/blender/editors/include/ED_particle.h index 77c4b1bbed6..7b4a2e6fe16 100644 --- a/source/blender/editors/include/ED_particle.h +++ b/source/blender/editors/include/ED_particle.h @@ -27,6 +27,10 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file ED_particle.h + * \ingroup editors + */ + #ifndef ED_PARTICLE_H #define ED_PARTICLE_H diff --git a/source/blender/editors/include/ED_physics.h b/source/blender/editors/include/ED_physics.h index 51906bf41c1..c58e70a0768 100644 --- a/source/blender/editors/include/ED_physics.h +++ b/source/blender/editors/include/ED_physics.h @@ -27,6 +27,10 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file ED_physics.h + * \ingroup editors + */ + #ifndef ED_PHYSICS_H #define ED_PHYSICS_H diff --git a/source/blender/editors/include/ED_render.h b/source/blender/editors/include/ED_render.h index 44d76b635a1..651c298ad5e 100644 --- a/source/blender/editors/include/ED_render.h +++ b/source/blender/editors/include/ED_render.h @@ -1,4 +1,4 @@ -/** +/* * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or @@ -21,6 +21,10 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file ED_render.h + * \ingroup editors + */ + #ifndef ED_RENDER_H #define ED_RENDER_H diff --git a/source/blender/editors/include/ED_screen.h b/source/blender/editors/include/ED_screen.h index 1ceb2216938..f1665f2b165 100644 --- a/source/blender/editors/include/ED_screen.h +++ b/source/blender/editors/include/ED_screen.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -25,6 +25,11 @@ * * ***** END GPL LICENSE BLOCK ***** */ + +/** \file ED_screen.h + * \ingroup editors + */ + #ifndef ED_SCREEN_H #define ED_SCREEN_H diff --git a/source/blender/editors/include/ED_screen_types.h b/source/blender/editors/include/ED_screen_types.h index 240075565af..71e3780fe24 100644 --- a/source/blender/editors/include/ED_screen_types.h +++ b/source/blender/editors/include/ED_screen_types.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -26,6 +26,10 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file ED_screen_types.h + * \ingroup editors + */ + #ifndef ED_SCREEN_TYPES_H__ #define ED_SCREEN_TYPES_H__ diff --git a/source/blender/editors/include/ED_sculpt.h b/source/blender/editors/include/ED_sculpt.h index cac6a1a2d13..33d2dfcf4c5 100644 --- a/source/blender/editors/include/ED_sculpt.h +++ b/source/blender/editors/include/ED_sculpt.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -25,6 +25,10 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file ED_sculpt.h + * \ingroup editors + */ + #ifndef ED_SCULPT_H #define ED_SCULPT_H diff --git a/source/blender/editors/include/ED_sequencer.h b/source/blender/editors/include/ED_sequencer.h index d99187afce9..39eb66e56e9 100644 --- a/source/blender/editors/include/ED_sequencer.h +++ b/source/blender/editors/include/ED_sequencer.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -22,6 +22,10 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file ED_sequencer.h + * \ingroup editors + */ + #ifndef ED_SEQUENCER_H #define ED_SEQUENCER_H diff --git a/source/blender/editors/include/ED_sound.h b/source/blender/editors/include/ED_sound.h index 8b157d86279..3c6b12da076 100644 --- a/source/blender/editors/include/ED_sound.h +++ b/source/blender/editors/include/ED_sound.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -26,6 +26,10 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file ED_sound.h + * \ingroup editors + */ + #ifndef ED_SOUND_H #define ED_SOUND_H diff --git a/source/blender/editors/include/ED_space_api.h b/source/blender/editors/include/ED_space_api.h index 69a3d1f758a..053b1d4fd9c 100644 --- a/source/blender/editors/include/ED_space_api.h +++ b/source/blender/editors/include/ED_space_api.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -26,6 +26,10 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file ED_space_api.h + * \ingroup editors + */ + #ifndef ED_SPACE_API_H #define ED_SPACE_API_H diff --git a/source/blender/editors/include/ED_text.h b/source/blender/editors/include/ED_text.h index 081e83b1844..bc8c9958e18 100644 --- a/source/blender/editors/include/ED_text.h +++ b/source/blender/editors/include/ED_text.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -25,6 +25,10 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file ED_text.h + * \ingroup editors + */ + #ifndef ED_TEXT_H #define ED_TEXT_H diff --git a/source/blender/editors/include/ED_transform.h b/source/blender/editors/include/ED_transform.h index 5864449a490..3ab634afeff 100644 --- a/source/blender/editors/include/ED_transform.h +++ b/source/blender/editors/include/ED_transform.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -27,6 +27,10 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file ED_transform.h + * \ingroup editors + */ + #ifndef ED_TRANSFORM_H #define ED_TRANSFORM_H diff --git a/source/blender/editors/include/ED_types.h b/source/blender/editors/include/ED_types.h index a0d1e0d65ec..0218b8d9c2d 100644 --- a/source/blender/editors/include/ED_types.h +++ b/source/blender/editors/include/ED_types.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -25,6 +25,11 @@ * * ***** END GPL LICENSE BLOCK ***** */ + +/** \file ED_types.h + * \ingroup editors + */ + #ifndef ED_TYPES_H #define ED_TYPES_H diff --git a/source/blender/editors/include/ED_util.h b/source/blender/editors/include/ED_util.h index 473d889c731..77b754519fb 100644 --- a/source/blender/editors/include/ED_util.h +++ b/source/blender/editors/include/ED_util.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -25,6 +25,11 @@ * * ***** END GPL LICENSE BLOCK ***** */ + +/** \file ED_util.h + * \ingroup editors + */ + #ifndef ED_UTIL_H #define ED_UTIL_H @@ -52,6 +57,7 @@ void ED_undo_pop_op (struct bContext *C, struct wmOperator *op); void ED_undo_pop (struct bContext *C); void ED_undo_redo (struct bContext *C); void ED_OT_undo (struct wmOperatorType *ot); +void ED_OT_undo_push (struct wmOperatorType *ot); void ED_OT_redo (struct wmOperatorType *ot); int ED_undo_operator_repeat(struct bContext *C, struct wmOperator *op); diff --git a/source/blender/editors/include/ED_uvedit.h b/source/blender/editors/include/ED_uvedit.h index a2a0cefc55b..a0c4148c055 100644 --- a/source/blender/editors/include/ED_uvedit.h +++ b/source/blender/editors/include/ED_uvedit.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -25,6 +25,10 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file ED_uvedit.h + * \ingroup editors + */ + #ifndef ED_UVEDIT_H #define ED_UVEDIT_H diff --git a/source/blender/editors/include/ED_view3d.h b/source/blender/editors/include/ED_view3d.h index 4afe2ff10a2..53a518d1fe6 100644 --- a/source/blender/editors/include/ED_view3d.h +++ b/source/blender/editors/include/ED_view3d.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -25,6 +25,11 @@ * * ***** END GPL LICENSE BLOCK ***** */ + +/** \file ED_view3d.h + * \ingroup editors + */ + #ifndef ED_VIEW3D_H #define ED_VIEW3D_H diff --git a/source/blender/editors/include/UI_icons.h b/source/blender/editors/include/UI_icons.h index a145df908b9..b2a353b0647 100644 --- a/source/blender/editors/include/UI_icons.h +++ b/source/blender/editors/include/UI_icons.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -26,6 +26,10 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file UI_icons.h + * \ingroup editorui + */ + /* Note: this is included twice with different #defines for DEF_ICON once from UI_resources.h for the internal icon enum and once for interface_api.c for the definition of the RNA enum for the icons */ diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 3e607b37067..55d7d0c219d 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -27,6 +27,10 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file UI_interface.h + * \ingroup editorui + */ + #ifndef UI_INTERFACE_H #define UI_INTERFACE_H diff --git a/source/blender/editors/include/UI_interface_icons.h b/source/blender/editors/include/UI_interface_icons.h index 34a390b250e..50b14cb832a 100644 --- a/source/blender/editors/include/UI_interface_icons.h +++ b/source/blender/editors/include/UI_interface_icons.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -27,6 +27,10 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file UI_interface_icons.h + * \ingroup editorui + */ + #ifndef UI_INTERFACE_ICONS_H #define UI_INTERFACE_ICONS_H diff --git a/source/blender/editors/include/UI_resources.h b/source/blender/editors/include/UI_resources.h index 5c97da4ebc9..2fb2e882afb 100644 --- a/source/blender/editors/include/UI_resources.h +++ b/source/blender/editors/include/UI_resources.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** @@ -30,6 +30,10 @@ * ***** END GPL/BL DUAL LICENSE BLOCK ***** */ +/** \file UI_resources.h + * \ingroup editorui + */ + #ifndef UI_RESOURCES_H #define UI_RESOURCES_H diff --git a/source/blender/editors/include/UI_view2d.h b/source/blender/editors/include/UI_view2d.h index 7cad1d82d50..1aadb63181d 100644 --- a/source/blender/editors/include/UI_view2d.h +++ b/source/blender/editors/include/UI_view2d.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -29,6 +29,10 @@ * ***** END GPL LICENSE BLOCK ***** */ +/** \file UI_view2d.h + * \ingroup editorui + */ + #ifndef UI_VIEW2D_H #define UI_VIEW2D_H diff --git a/source/blender/editors/interface/CMakeLists.txt b/source/blender/editors/interface/CMakeLists.txt index 6be7314304f..09ea9f9ad7e 100644 --- a/source/blender/editors/interface/CMakeLists.txt +++ b/source/blender/editors/interface/CMakeLists.txt @@ -23,6 +23,7 @@ set(INC ../include ../../blenfont ../../blenkernel + ../../blenloader ../../blenlib ../../gpu ../../imbuf diff --git a/source/blender/editors/interface/SConscript b/source/blender/editors/interface/SConscript index 639a5268ca2..5998d4d2953 100644 --- a/source/blender/editors/interface/SConscript +++ b/source/blender/editors/interface/SConscript @@ -8,7 +8,7 @@ for source in env.Glob('*_api.c'): incs = '../include ../../blenlib ../../blenfont ../../blenkernel ../../makesdna ../../imbuf' incs += ' ../../makesrna ../../windowmanager #/intern/guardedalloc ../../gpu' -incs += ' #/extern/glew/include' +incs += ' #/extern/glew/include ../../blenloader' incs += ' ../../python/' # python button eval defs = [] diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 5843412940a..674ad8d4a49 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/interface/interface_draw.c b/source/blender/editors/interface/interface_draw.c index 86795e27bb4..940a9791a4e 100644 --- a/source/blender/editors/interface/interface_draw.c +++ b/source/blender/editors/interface/interface_draw.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 67e4548b0b7..acc806555ce 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -1,4 +1,4 @@ -/** +/* * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or @@ -4042,6 +4042,7 @@ static uiBlock *menu_add_shortcut(bContext *C, ARegion *ar, void *arg) uiStyle *style= U.uistyles.first; IDProperty *prop= (but->opptr)? but->opptr->data: NULL; + /* XXX this guess_opname can potentially return a different keymap than being found on adding later... */ km = WM_keymap_guess_opname(C, but->optype->idname); kmi = WM_keymap_add_item(km, but->optype->idname, AKEY, KM_PRESS, 0, 0); diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index 63841963c6d..6efed8c8e22 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h index 52214bf3fa7..b5f8897d32c 100644 --- a/source/blender/editors/interface/interface_intern.h +++ b/source/blender/editors/interface/interface_intern.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 4398e7a2287..432904fd243 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c index 9734150ab5c..2e6793fb5d5 100644 --- a/source/blender/editors/interface/interface_ops.c +++ b/source/blender/editors/interface/interface_ops.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index 89d648e64be..c069ae4d833 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index 31523685527..c1eaf66fb65 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -1,4 +1,4 @@ -/** +/* * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/editors/interface/interface_style.c b/source/blender/editors/interface/interface_style.c index af0b2189a99..8e206f35b7f 100644 --- a/source/blender/editors/interface/interface_style.c +++ b/source/blender/editors/interface/interface_style.c @@ -1,4 +1,4 @@ -/** +/* * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index e0a3a7b15af..0221364e506 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -737,8 +737,6 @@ static uiLayout *draw_modifier(uiLayout *layout, Scene *scene, Object *ob, Modif /* tesselation point for curve-typed objects */ if (ELEM3(ob->type, OB_CURVE, OB_SURF, OB_FONT)) { - ModifierTypeInfo *mti = modifierType_getInfo(md->type); - /* some modifiers could work with pre-tesselated curves only */ if (ELEM3(md->type, eModifierType_Hook, eModifierType_Softbody, eModifierType_MeshDeform)) { /* add disabled pre-tesselated button, so users could have diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c index 842dc40a39f..e7848c07095 100644 --- a/source/blender/editors/interface/interface_utils.c +++ b/source/blender/editors/interface/interface_utils.c @@ -1,4 +1,4 @@ -/** +/* * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or @@ -99,7 +99,6 @@ uiBut *uiDefAutoButR(uiBlock *block, PointerRNA *ptr, PropertyRNA *prop, int ind break; case PROP_POINTER: { PointerRNA pptr; - int icon; pptr= RNA_property_pointer_get(ptr, prop); if(!pptr.type) diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index e3c465dd4c8..aaa46a3105f 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -1,4 +1,4 @@ -/** +/* * ***** BEGIN GPL LICENSE BLOCK ***** * * This program is free software; you can redistribute it and/or diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index 9ab45ae648b..2fe50bba7ab 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index 245905418ec..e4c328758c0 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c index 5906283050f..66a58e71ed6 100644 --- a/source/blender/editors/interface/view2d_ops.c +++ b/source/blender/editors/interface/view2d_ops.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/mesh/CMakeLists.txt b/source/blender/editors/mesh/CMakeLists.txt index 82d1c7430fc..8ff323d88b6 100644 --- a/source/blender/editors/mesh/CMakeLists.txt +++ b/source/blender/editors/mesh/CMakeLists.txt @@ -22,6 +22,7 @@ set(INC ../include ../../blenkernel + ../../blenloader ../../blenlib ../../imbuf ../../makesdna diff --git a/source/blender/editors/mesh/SConscript b/source/blender/editors/mesh/SConscript index f5f8bb940e8..34936c025bc 100644 --- a/source/blender/editors/mesh/SConscript +++ b/source/blender/editors/mesh/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 ../../blenloader' incs += ' ../../makesrna ../../render/extern/include #/intern/elbeem/extern' if env['OURPLATFORM'] == 'linux2': diff --git a/source/blender/editors/mesh/editface.c b/source/blender/editors/mesh/editface.c index fa202bde54f..552f4b3b954 100644 --- a/source/blender/editors/mesh/editface.c +++ b/source/blender/editors/mesh/editface.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -152,61 +152,55 @@ MTFace *EM_get_active_mtface(EditMesh *em, EditFace **act_efa, MCol **mcol, int return NULL; } -void paintface_unhide(Scene *scene) +void paintface_hide(Object *ob, const int unselected) { Mesh *me; MFace *mface; int a; - me= get_mesh(OBACT); + me= get_mesh(ob); if(me==0 || me->totface==0) return; - + mface= me->mface; a= me->totface; while(a--) { - if(mface->flag & ME_HIDE) { - mface->flag |= ME_FACE_SEL; - mface->flag -= ME_HIDE; + if((mface->flag & ME_HIDE) == 0) { + if(unselected) { + if( (mface->flag & ME_FACE_SEL)==0) mface->flag |= ME_HIDE; + } + else { + if( (mface->flag & ME_FACE_SEL)) mface->flag |= ME_HIDE; + } } + if(mface->flag & ME_HIDE) mface->flag &= ~ME_FACE_SEL; + mface++; } - - paintface_flush_flags(OBACT); + + paintface_flush_flags(ob); } -void paintface_hide(Scene *scene) + +void paintface_reveal(Object *ob) { Mesh *me; MFace *mface; int a; - int shift=0, alt= 0; // XXX - - me= get_mesh(OBACT); + + me= get_mesh(ob); if(me==0 || me->totface==0) return; - - if(alt) { - paintface_unhide(scene); - return; - } - + mface= me->mface; a= me->totface; while(a--) { - if(mface->flag & ME_HIDE); - else { - if(shift) { - if( (mface->flag & ME_FACE_SEL)==0) mface->flag |= ME_HIDE; - } - else { - if( (mface->flag & ME_FACE_SEL)) mface->flag |= ME_HIDE; - } + if(mface->flag & ME_HIDE) { + mface->flag |= ME_FACE_SEL; + mface->flag -= ME_HIDE; } - if(mface->flag & ME_HIDE) mface->flag &= ~ME_FACE_SEL; - mface++; } - - paintface_flush_flags(OBACT); + + paintface_flush_flags(ob); } /* Set tface seams based on edge data, uses hash table to find seam edges. */ @@ -359,37 +353,49 @@ void paintface_deselect_all_visible(Object *ob, int action, short flush_flags) me= get_mesh(ob); if(me==0) return; - if (action == SEL_TOGGLE) { - action = SEL_SELECT; - + if(action == SEL_INVERT) { mface= me->mface; a= me->totface; while(a--) { - if((mface->flag & ME_HIDE) == 0 && mface->flag & ME_FACE_SEL) { - action = SEL_DESELECT; - break; + if((mface->flag & ME_HIDE) == 0) { + mface->flag ^= ME_FACE_SEL; } mface++; } } - - mface= me->mface; - a= me->totface; - while(a--) { - if((mface->flag & ME_HIDE) == 0) { - switch (action) { - case SEL_SELECT: - mface->flag |= ME_FACE_SEL; - break; - case SEL_DESELECT: - mface->flag &= ~ME_FACE_SEL; - break; - case SEL_INVERT: - mface->flag ^= ME_FACE_SEL; - break; + else { + if (action == SEL_TOGGLE) { + action = SEL_SELECT; + + mface= me->mface; + a= me->totface; + while(a--) { + if((mface->flag & ME_HIDE) == 0 && mface->flag & ME_FACE_SEL) { + action = SEL_DESELECT; + break; + } + mface++; } } - mface++; + + mface= me->mface; + a= me->totface; + while(a--) { + if((mface->flag & ME_HIDE) == 0) { + switch (action) { + case SEL_SELECT: + mface->flag |= ME_FACE_SEL; + break; + case SEL_DESELECT: + mface->flag &= ~ME_FACE_SEL; + break; + case SEL_INVERT: + mface->flag ^= ME_FACE_SEL; + break; + } + } + mface++; + } } if(flush_flags) { @@ -397,29 +403,6 @@ void paintface_deselect_all_visible(Object *ob, int action, short flush_flags) } } -void paintface_select_swap(Scene *scene) -{ - Mesh *me; - MFace *mface; - int a; - - me= get_mesh(OBACT); - if(me==0) return; - - mface= me->mface; - a= me->totface; - while(a--) { - if(mface->flag & ME_HIDE); - else { - if(mface->flag & ME_FACE_SEL) mface->flag &= ~ME_FACE_SEL; - else mface->flag |= ME_FACE_SEL; - } - mface++; - } - - paintface_flush_flags(OBACT); -} - int paintface_minmax(Object *ob, float *min, float *max) { Mesh *me= get_mesh(ob); diff --git a/source/blender/editors/mesh/editmesh.c b/source/blender/editors/mesh/editmesh.c index 9376a21b23d..3843b782d87 100644 --- a/source/blender/editors/mesh/editmesh.c +++ b/source/blender/editors/mesh/editmesh.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c index f24c5d0d5db..08b2ff5c0ad 100644 --- a/source/blender/editors/mesh/editmesh_add.c +++ b/source/blender/editors/mesh/editmesh_add.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/mesh/editmesh_lib.c b/source/blender/editors/mesh/editmesh_lib.c index aba8fabc621..bc670c47940 100644 --- a/source/blender/editors/mesh/editmesh_lib.c +++ b/source/blender/editors/mesh/editmesh_lib.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/mesh/editmesh_loop.c b/source/blender/editors/mesh/editmesh_loop.c index ede7cf0b7c8..71b66d3e163 100644 --- a/source/blender/editors/mesh/editmesh_loop.c +++ b/source/blender/editors/mesh/editmesh_loop.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/mesh/editmesh_mods.c b/source/blender/editors/mesh/editmesh_mods.c index 6e27a81e3f0..e9c88d095b4 100644 --- a/source/blender/editors/mesh/editmesh_mods.c +++ b/source/blender/editors/mesh/editmesh_mods.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -4064,179 +4064,6 @@ void MESH_OT_normals_make_consistent(wmOperatorType *ot) RNA_def_boolean(ot->srna, "inside", 0, "Inside", ""); } -/* ********** ALIGN WITH VIEW **************** */ - -static void editmesh_calc_selvert_center(EditMesh *em, float cent_r[3]) -{ - EditVert *eve; - int nsel= 0; - - zero_v3(cent_r); - - for (eve= em->verts.first; eve; eve= eve->next) { - if (eve->f & SELECT) { - cent_r[0]+= eve->co[0]; - cent_r[1]+= eve->co[1]; - cent_r[2]+= eve->co[2]; - nsel++; - } - } - - if (nsel) { - cent_r[0]/= nsel; - cent_r[1]/= nsel; - cent_r[2]/= nsel; - } -} - -static int mface_is_selected(MFace *mf) -{ - return (!(mf->flag & ME_HIDE) && (mf->flag & ME_FACE_SEL)); -} - - /* XXX, code for both these functions should be abstract, - * then unified, then written for other things (like objects, - * which would use same as vertices method), then added - * to interface! Hoera! - zr - */ -static void faceselect_align_view_to_selected(View3D *v3d, RegionView3D *rv3d, Mesh *me, wmOperator *op, int axis) -{ - float norm[3]; - int i, totselected = 0; - - norm[0]= norm[1]= norm[2]= 0.0; - for (i=0; i<me->totface; i++) { - MFace *mf= ((MFace*) me->mface) + i; - - if (mface_is_selected(mf)) { - float *v1, *v2, *v3, fno[3]; - - v1= me->mvert[mf->v1].co; - v2= me->mvert[mf->v2].co; - v3= me->mvert[mf->v3].co; - if (mf->v4) { - float *v4= me->mvert[mf->v4].co; - normal_quad_v3( fno,v1, v2, v3, v4); - } else { - normal_tri_v3( fno,v1, v2, v3); - } - - norm[0]+= fno[0]; - norm[1]+= fno[1]; - norm[2]+= fno[2]; - - totselected++; - } - } - - if (totselected == 0) - BKE_report(op->reports, RPT_WARNING, "No faces selected."); - else - view3d_align_axis_to_vector(v3d, rv3d, axis, norm); -} - -/* helper for below, to survive non-uniform scaled objects */ -static void face_getnormal_obspace(Object *obedit, EditFace *efa, float *fno) -{ - float vec[4][3]; - - VECCOPY(vec[0], efa->v1->co); - mul_mat3_m4_v3(obedit->obmat, vec[0]); - VECCOPY(vec[1], efa->v2->co); - mul_mat3_m4_v3(obedit->obmat, vec[1]); - VECCOPY(vec[2], efa->v3->co); - mul_mat3_m4_v3(obedit->obmat, vec[2]); - if(efa->v4) { - VECCOPY(vec[3], efa->v4->co); - mul_mat3_m4_v3(obedit->obmat, vec[3]); - - normal_quad_v3( fno,vec[0], vec[1], vec[2], vec[3]); - } - else normal_tri_v3( fno,vec[0], vec[1], vec[2]); -} - - -static void editmesh_align_view_to_selected(Object *obedit, EditMesh *em, wmOperator *op, View3D *v3d, RegionView3D *rv3d, int axis) -{ - int nselverts= EM_nvertices_selected(em); - float norm[3]={0.0, 0.0, 0.0}; /* used for storing the mesh normal */ - - if (nselverts==0) { - BKE_report(op->reports, RPT_WARNING, "No faces or vertices selected."); - } - else if (EM_nfaces_selected(em)) { - EditFace *efa; - for (efa= em->faces.first; efa; efa= efa->next) { - if (faceselectedAND(efa, SELECT)) { - float fno[3]; - - face_getnormal_obspace(obedit, efa, fno); - norm[0]+= fno[0]; - norm[1]+= fno[1]; - norm[2]+= fno[2]; - } - } - - view3d_align_axis_to_vector(v3d, rv3d, axis, norm); - } - else if (nselverts>2) { - float cent[3]; - EditVert *eve, *leve= NULL; - - editmesh_calc_selvert_center(em, cent); - for (eve= em->verts.first; eve; eve= eve->next) { - if (eve->f & SELECT) { - if (leve) { - float tno[3]; - normal_tri_v3( tno,cent, leve->co, eve->co); - - /* XXX, fixme, should be flipped intp a - * consistent direction. -zr - */ - norm[0]+= tno[0]; - norm[1]+= tno[1]; - norm[2]+= tno[2]; - } - leve= eve; - } - } - - mul_mat3_m4_v3(obedit->obmat, norm); - view3d_align_axis_to_vector(v3d, rv3d, axis, norm); - } - else if (nselverts==2) { /* Align view to edge (or 2 verts) */ - EditVert *eve, *leve= NULL; - - for (eve= em->verts.first; eve; eve= eve->next) { - if (eve->f & SELECT) { - if (leve) { - norm[0]= leve->co[0] - eve->co[0]; - norm[1]= leve->co[1] - eve->co[1]; - norm[2]= leve->co[2] - eve->co[2]; - break; /* we know there are only 2 verts so no need to keep looking */ - } - leve= eve; - } - } - mul_mat3_m4_v3(obedit->obmat, norm); - view3d_align_axis_to_vector(v3d, rv3d, axis, norm); - } - else if (nselverts==1) { /* Align view to vert normal */ - EditVert *eve; - - for (eve= em->verts.first; eve; eve= eve->next) { - if (eve->f & SELECT) { - norm[0]= eve->no[0]; - norm[1]= eve->no[1]; - norm[2]= eve->no[2]; - break; /* we know this is the only selected vert, so no need to keep looking */ - } - } - mul_mat3_m4_v3(obedit->obmat, norm); - view3d_align_axis_to_vector(v3d, rv3d, axis, norm); - } -} - /* **************** VERTEX DEFORMS *************** */ static int smooth_vertex(bContext *C, wmOperator *op) diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 24c4e887ecc..d1ff06ec213 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -563,6 +563,29 @@ static void xsortvert_flag(bContext *C, int flag) } +static int mesh_vertices_sort_exec(bContext *C, wmOperator *UNUSED(op)) +{ + xsortvert_flag(C, SELECT); + return OPERATOR_FINISHED; +} + +void MESH_OT_vertices_sort(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Vertex Sort"; + ot->description= "Sort vertex order"; + ot->idname= "MESH_OT_vertices_sort"; + + /* api callbacks */ + ot->exec= mesh_vertices_sort_exec; + + ot->poll= EM_view3d_poll; /* uses view relative X axis to sort verts */ + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + + /* called from buttons */ static void hashvert_flag(EditMesh *em, int flag) { @@ -621,6 +644,31 @@ static void hashvert_flag(EditMesh *em, int flag) } +static int mesh_vertices_randomize_exec(bContext *C, wmOperator *UNUSED(op)) +{ + Object *obedit= CTX_data_edit_object(C); + EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data); + hashvert_flag(em, SELECT); + return OPERATOR_FINISHED; +} + +void MESH_OT_vertices_randomize(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Vertex Randomize"; + ot->description= "Randomize vertex order"; + ot->idname= "MESH_OT_vertices_randomize"; + + /* api callbacks */ + ot->exec= mesh_vertices_randomize_exec; + + ot->poll= ED_operator_editmesh; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + + /* generic extern called extruder */ static void extrude_mesh(Object *obedit, EditMesh *em, wmOperator *op, short type) { @@ -5243,7 +5291,7 @@ void MESH_OT_blend_from_shape(wmOperatorType *ot) prop= RNA_def_enum(ot->srna, "shape", shape_items, 0, "Shape", "Shape key to use for blending."); RNA_def_enum_funcs(prop, shape_itemf); RNA_def_float(ot->srna, "blend", 1.0f, -FLT_MAX, FLT_MAX, "Blend", "Blending factor.", -2.0f, 2.0f); - RNA_def_boolean(ot->srna, "add", 1, "Add", "Add rather then blend between shapes."); + RNA_def_boolean(ot->srna, "add", 0, "Add", "Add rather then blend between shapes."); } /************************ Merge Operator *************************/ diff --git a/source/blender/editors/mesh/loopcut.c b/source/blender/editors/mesh/loopcut.c index 933aed0a758..8001c4b1390 100644 --- a/source/blender/editors/mesh/loopcut.c +++ b/source/blender/editors/mesh/loopcut.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/mesh/mesh_data.c b/source/blender/editors/mesh/mesh_data.c index cfd1b006ece..f1123fdabcb 100644 --- a/source/blender/editors/mesh/mesh_data.c +++ b/source/blender/editors/mesh/mesh_data.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/mesh/mesh_intern.h b/source/blender/editors/mesh/mesh_intern.h index 1a9fdcea992..1ed9598e0b4 100644 --- a/source/blender/editors/mesh/mesh_intern.h +++ b/source/blender/editors/mesh/mesh_intern.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -205,6 +205,8 @@ int EdgeSlide(EditMesh *em, struct wmOperator *op, short immediate, float imperc void MESH_OT_merge(struct wmOperatorType *ot); void MESH_OT_subdivide(struct wmOperatorType *ot); void MESH_OT_remove_doubles(struct wmOperatorType *ot); +void MESH_OT_vertices_randomize(struct wmOperatorType *ot); +void MESH_OT_vertices_sort(struct wmOperatorType *ot); void MESH_OT_extrude(struct wmOperatorType *ot); void MESH_OT_spin(struct wmOperatorType *ot); void MESH_OT_screw(struct wmOperatorType *ot); diff --git a/source/blender/editors/mesh/mesh_ops.c b/source/blender/editors/mesh/mesh_ops.c index f144ae60518..ef68f6e89a0 100644 --- a/source/blender/editors/mesh/mesh_ops.c +++ b/source/blender/editors/mesh/mesh_ops.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -86,6 +86,8 @@ void ED_operatortypes_mesh(void) WM_operatortype_append(MESH_OT_fgon_make); WM_operatortype_append(MESH_OT_duplicate); WM_operatortype_append(MESH_OT_remove_doubles); + WM_operatortype_append(MESH_OT_vertices_sort); + WM_operatortype_append(MESH_OT_vertices_randomize); WM_operatortype_append(MESH_OT_extrude); WM_operatortype_append(MESH_OT_spin); WM_operatortype_append(MESH_OT_screw); @@ -146,6 +148,7 @@ void ED_operatortypes_mesh(void) WM_operatortype_append(MESH_OT_select_nth); } +#if 0 /* UNUSED, remove? */ static int ED_operator_editmesh_face_select(bContext *C) { Object *obedit= CTX_data_edit_object(C); @@ -157,6 +160,7 @@ static int ED_operator_editmesh_face_select(bContext *C) } return 0; } +#endif void ED_operatormacros_mesh(void) { diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c index 7c45e371a6e..a7d6cfee6c3 100644 --- a/source/blender/editors/mesh/meshtools.c +++ b/source/blender/editors/mesh/meshtools.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/metaball/CMakeLists.txt b/source/blender/editors/metaball/CMakeLists.txt index 249d9daedef..af3d25699ed 100644 --- a/source/blender/editors/metaball/CMakeLists.txt +++ b/source/blender/editors/metaball/CMakeLists.txt @@ -22,6 +22,7 @@ set(INC ../include ../../blenkernel + ../../blenloader ../../blenlib ../../makesdna ../../makesrna diff --git a/source/blender/editors/metaball/SConscript b/source/blender/editors/metaball/SConscript index e526a1560cf..b1a1ce935db 100644 --- a/source/blender/editors/metaball/SConscript +++ b/source/blender/editors/metaball/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 ../../blenloader' incs += ' ../../makesrna ../../render/extern/include #/intern/elbeem/extern' env.BlenderLib ( 'bf_editors_metaball', sources, Split(incs), [], libtype=['core'], priority=[45] ) diff --git a/source/blender/editors/metaball/mball_edit.c b/source/blender/editors/metaball/mball_edit.c index c3cacfc4c39..da0fb256572 100644 --- a/source/blender/editors/metaball/mball_edit.c +++ b/source/blender/editors/metaball/mball_edit.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -374,25 +374,15 @@ static int hide_metaelems_exec(bContext *C, wmOperator *op) Object *obedit= CTX_data_edit_object(C); MetaBall *mb= (MetaBall*)obedit->data; MetaElem *ml; - int hide_unselected= RNA_boolean_get(op->ptr, "unselected"); + const int invert= RNA_boolean_get(op->ptr, "unselected") ? SELECT : 0; ml= mb->editelems->first; if(ml) { - /* Hide unselected metaelems */ - if(hide_unselected) { - while(ml){ - if(!(ml->flag & SELECT)) - ml->flag |= MB_HIDE; - ml= ml->next; - } - /* Hide selected metaelems */ - } else { - while(ml){ - if(ml->flag & SELECT) - ml->flag |= MB_HIDE; - ml= ml->next; - } + while(ml){ + if((ml->flag & SELECT) != invert) + ml->flag |= MB_HIDE; + ml= ml->next; } WM_event_add_notifier(C, NC_GEOM|ND_DATA, mb); DAG_id_tag_update(obedit->data, 0); diff --git a/source/blender/editors/metaball/mball_intern.h b/source/blender/editors/metaball/mball_intern.h index 454b30eceef..36c263bde47 100644 --- a/source/blender/editors/metaball/mball_intern.h +++ b/source/blender/editors/metaball/mball_intern.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/metaball/mball_ops.c b/source/blender/editors/metaball/mball_ops.c index 6ea094d95af..99d313e2a30 100644 --- a/source/blender/editors/metaball/mball_ops.c +++ b/source/blender/editors/metaball/mball_ops.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/object/CMakeLists.txt b/source/blender/editors/object/CMakeLists.txt index 116cf30f911..47cb4d00938 100644 --- a/source/blender/editors/object/CMakeLists.txt +++ b/source/blender/editors/object/CMakeLists.txt @@ -22,6 +22,7 @@ set(INC ../include ../../blenkernel + ../../blenloader ../../blenlib ../../gpu ../../ikplugin diff --git a/source/blender/editors/object/SConscript b/source/blender/editors/object/SConscript index e39190c0ef3..660643fbb0f 100644 --- a/source/blender/editors/object/SConscript +++ b/source/blender/editors/object/SConscript @@ -4,7 +4,7 @@ Import ('env') sources = env.Glob('*.c') incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf' -incs += ' ../../windowmanager #/intern/guardedalloc' +incs += ' ../../windowmanager #/intern/guardedalloc ../../blenloader' incs += ' ../../makesrna ../../python ../../ikplugin' incs += ' ../../render/extern/include ../../gpu' # for object_bake.c diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 5b747326679..c74d532c95f 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c index a5edc7d2598..e2b125fdbe7 100644 --- a/source/blender/editors/object/object_bake.c +++ b/source/blender/editors/object/object_bake.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index 2358df37806..2f90d722240 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -198,6 +198,7 @@ static char *buildmenu_pyconstraints (Text *con_text, int *pyconindex) } #endif /* WITH_PYTHON */ +#if 0 // UNUSED, until pyconstraints are added back. /* this callback gets called when the 'refresh' button of a pyconstraint gets pressed */ static void update_pyconstraint_cb (void *arg1, void *arg2) { @@ -211,6 +212,7 @@ static void update_pyconstraint_cb (void *arg1, void *arg2) BPY_pyconstraint_update(owner, con); #endif } +#endif // UNUSED /* helper function for add_constriant - sets the last target for the active constraint */ static void set_constraint_nth_target (bConstraint *con, Object *target, const char subtarget[], int index) diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index cb0b251c101..c07c770cf66 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -170,7 +170,7 @@ static int object_hide_view_set_exec(bContext *C, wmOperator *op) Main *bmain= CTX_data_main(C); Scene *scene= CTX_data_scene(C); short changed = 0; - int unselected= RNA_boolean_get(op->ptr, "unselected"); + const int unselected= RNA_boolean_get(op->ptr, "unselected"); CTX_DATA_BEGIN(C, Base*, base, visible_bases) { if(!unselected) { @@ -259,7 +259,7 @@ void OBJECT_OT_hide_render_clear(wmOperatorType *ot) static int object_hide_render_set_exec(bContext *C, wmOperator *op) { - int unselected= RNA_boolean_get(op->ptr, "unselected"); + const int unselected= RNA_boolean_get(op->ptr, "unselected"); CTX_DATA_BEGIN(C, Base*, base, visible_bases) { if(!unselected) { diff --git a/source/blender/editors/object/object_group.c b/source/blender/editors/object/object_group.c index c26affc24a2..fa78c7f052f 100644 --- a/source/blender/editors/object/object_group.c +++ b/source/blender/editors/object/object_group.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/object/object_hook.c b/source/blender/editors/object/object_hook.c index 92a53b834b0..a0b6e28191c 100644 --- a/source/blender/editors/object/object_hook.c +++ b/source/blender/editors/object/object_hook.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/object/object_intern.h b/source/blender/editors/object/object_intern.h index ca441e8d634..8cb30cbe56c 100644 --- a/source/blender/editors/object/object_intern.h +++ b/source/blender/editors/object/object_intern.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/object/object_lattice.c b/source/blender/editors/object/object_lattice.c index 375ea82c0b7..e4e23b05a7e 100644 --- a/source/blender/editors/object/object_lattice.c +++ b/source/blender/editors/object/object_lattice.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 0ea1c00100a..96953736f69 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/object/object_ops.c b/source/blender/editors/object/object_ops.c index 6662d5b5f0a..6f854872aad 100644 --- a/source/blender/editors/object/object_ops.c +++ b/source/blender/editors/object/object_ops.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index ad79cbb262b..43057108b60 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/object/object_select.c b/source/blender/editors/object/object_select.c index 5853a230719..7a92b16020e 100644 --- a/source/blender/editors/object/object_select.c +++ b/source/blender/editors/object/object_select.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/object/object_shapekey.c b/source/blender/editors/object/object_shapekey.c index d8e54a73500..8cd0ee81f21 100644 --- a/source/blender/editors/object/object_shapekey.c +++ b/source/blender/editors/object/object_shapekey.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index cf5a5acf6ed..48d12982691 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index ab52d527561..b6baca5733f 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/physics/CMakeLists.txt b/source/blender/editors/physics/CMakeLists.txt index 76419dbb505..a0aa3e489dd 100644 --- a/source/blender/editors/physics/CMakeLists.txt +++ b/source/blender/editors/physics/CMakeLists.txt @@ -22,6 +22,7 @@ set(INC ../include ../../blenkernel + ../../blenloader ../../blenlib ../../makesdna ../../makesrna diff --git a/source/blender/editors/physics/SConscript b/source/blender/editors/physics/SConscript index fcf94eae994..274819c918c 100644 --- a/source/blender/editors/physics/SConscript +++ b/source/blender/editors/physics/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 ../../blenloader' incs += ' ../../makesrna ../../render/extern/include #/intern/elbeem/extern' defs = '' diff --git a/source/blender/editors/physics/particle_boids.c b/source/blender/editors/physics/particle_boids.c index 90e387a79c2..f659c33b5e1 100644 --- a/source/blender/editors/physics/particle_boids.c +++ b/source/blender/editors/physics/particle_boids.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/physics/particle_object.c b/source/blender/editors/physics/particle_object.c index 6078f05ebd1..efd44c68db6 100644 --- a/source/blender/editors/physics/particle_object.c +++ b/source/blender/editors/physics/particle_object.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c index 916866d7a70..93b0ca49915 100644 --- a/source/blender/editors/physics/physics_fluid.c +++ b/source/blender/editors/physics/physics_fluid.c @@ -1,4 +1,4 @@ -/** +/* * fluidsim.c * * $Id$ @@ -643,7 +643,7 @@ static int fluid_init_filepaths(Object *fsDomain, char *targetDir, char *targetF BLI_path_abs(targetDir, G.main->name); // fixed #frame-no // .tmp: dont overwrite/delete original file - BLI_snprintf(targetFile, sizeof(targetFile), "%s%s.tmp", targetDir, suffixConfig); + BLI_snprintf(targetFile, FILE_MAXDIR+FILE_MAXFILE, "%s%s.tmp", targetDir, suffixConfig); // make sure all directories exist // as the bobjs use the same dir, this only needs to be checked @@ -664,13 +664,13 @@ static int fluid_init_filepaths(Object *fsDomain, char *targetDir, char *targetF char blendFile[FILE_MAXDIR+FILE_MAXFILE]; // invalid dir, reset to current/previous - BLI_strncpy(blendDir, G.main->name, sizeof(blendDir)); + BLI_strncpy(blendDir, G.main->name, FILE_MAXDIR+FILE_MAXFILE); BLI_splitdirstring(blendDir, blendFile); - BLI_replace_extension(blendFile, sizeof(blendFile), ""); /* strip .blend */ + BLI_replace_extension(blendFile, FILE_MAXDIR+FILE_MAXFILE, ""); /* strip .blend */ - BLI_snprintf(newSurfdataPath, sizeof(newSurfdataPath) ,"//fluidsimdata/%s_%s_", blendFile, fsDomain->id.name); + BLI_snprintf(newSurfdataPath, FILE_MAXDIR+FILE_MAXFILE ,"//fluidsimdata/%s_%s_", blendFile, fsDomain->id.name); - BLI_snprintf(debugStrBuffer, sizeof(debugStrBuffer), "fluidsimBake::error - warning resetting output dir to '%s'\n", newSurfdataPath); + BLI_snprintf(debugStrBuffer, 256, "fluidsimBake::error - warning resetting output dir to '%s'\n", newSurfdataPath); elbeemDebugOut(debugStrBuffer); outStringsChanged=1; } @@ -952,7 +952,7 @@ int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain) /* ******** start writing / exporting ******** */ // use .tmp, dont overwrite/delete original file - BLI_snprintf(targetFile, sizeof(targetFile), "%s%s.tmp", targetDir, suffixConfig); + BLI_snprintf(targetFile, 240, "%s%s.tmp", targetDir, suffixConfig); // make sure these directories exist as well if(outStringsChanged) { @@ -980,7 +980,7 @@ int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain) fsset->aniFrameTime = channels->aniFrameTime; fsset->noOfFrames = noFrames; // is otherwise subtracted in parser - BLI_snprintf(targetFile, sizeof(targetFile), "%s%s", targetDir, suffixSurface); + BLI_snprintf(targetFile, 240, "%s%s", targetDir, suffixSurface); // defaults for compressibility and adaptive grids fsset->gstar = domainSettings->gstar; @@ -990,7 +990,7 @@ int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain) fsset->surfaceSmoothing = domainSettings->surfaceSmoothing; fsset->surfaceSubdivs = domainSettings->surfaceSubdivs; fsset->farFieldSize = domainSettings->farFieldSize; - BLI_strncpy(fsset->outputPath, targetFile, sizeof(fsset->outputPath)); + BLI_strncpy(fsset->outputPath, targetFile, 240); // domain channels fsset->channelSizeFrameTime = diff --git a/source/blender/editors/physics/physics_ops.c b/source/blender/editors/physics/physics_ops.c index 2b7f8e9d5a2..7d2b872038f 100644 --- a/source/blender/editors/physics/physics_ops.c +++ b/source/blender/editors/physics/physics_ops.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/render/render_intern.h b/source/blender/editors/render/render_intern.h index 4339d07c7a9..24831cebad7 100644 --- a/source/blender/editors/render/render_intern.h +++ b/source/blender/editors/render/render_intern.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c index 17d05bed24a..52280fa8e6a 100644 --- a/source/blender/editors/render/render_internal.c +++ b/source/blender/editors/render/render_internal.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -68,7 +68,7 @@ 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_showing_r_result(bContext *C, wmWindow **win); static ScrArea *find_area_image_empty(bContext *C); /* called inside thread! */ @@ -232,9 +232,13 @@ void screen_set_image_output(bContext *C, int mx, int my) } if(!sa) { - sa= find_area_showing_r_result(C); + sa= find_area_showing_r_result(C, &win); if(sa==NULL) sa= find_area_image_empty(C); + + /* if area found in other window, we make that one show in front */ + if(win && win!=CTX_wm_window(C)) + wm_window_raise(win); if(sa==NULL) { /* find largest open non-image area */ @@ -336,16 +340,15 @@ static ScrArea *biggest_area(bContext *C) } -static ScrArea *find_area_showing_r_result(bContext *C) +static ScrArea *find_area_showing_r_result(bContext *C, wmWindow **win) { wmWindowManager *wm= CTX_wm_manager(C); - wmWindow *win; ScrArea *sa = NULL; SpaceImage *sima; /* find an imagewindow showing render result */ - for(win=wm->windows.first; win; win=win->next) { - for(sa=win->screen->areabase.first; sa; sa= sa->next) { + for(*win=wm->windows.first; *win; *win= (*win)->next) { + for(sa= (*win)->screen->areabase.first; sa; sa= sa->next) { if(sa->spacetype==SPACE_IMAGE) { sima= sa->spacedata.first; if(sima->image && sima->image->type==IMA_TYPE_R_RESULT) @@ -355,7 +358,7 @@ static ScrArea *find_area_showing_r_result(bContext *C) if(sa) break; } - + return sa; } @@ -800,7 +803,7 @@ void RENDER_OT_render(wmOperatorType *ot) ot->modal= screen_render_modal; ot->exec= screen_render_exec; - ot->poll= ED_operator_screenactive; + /*ot->poll= ED_operator_screenactive;*/ /* this isnt needed, causes failer in background mode */ 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)"); @@ -862,18 +865,19 @@ void RENDER_OT_view_cancel(struct wmOperatorType *ot) static int render_view_show_invoke(bContext *C, wmOperator *UNUSED(unused), wmEvent *event) { - ScrArea *sa= find_area_showing_r_result(C); - - /* test if we have a temp screen active */ - if(CTX_wm_window(C)->screen->temp) { - wm_window_lower(CTX_wm_window(C)); + wmWindow *wincur = CTX_wm_window(C); + + /* test if we have currently a temp screen active */ + if(wincur->screen->temp) { + wm_window_lower(wincur); } else { - /* is there another window? */ - wmWindow *win; + wmWindow *win, *winshow; + ScrArea *sa= find_area_showing_r_result(C, &winshow); + /* is there another window showing result? */ for(win= CTX_wm_manager(C)->windows.first; win; win= win->next) { - if(win->screen->temp) { + if(win->screen->temp || (win==winshow && winshow!=wincur)) { wm_window_raise(win); return OPERATOR_FINISHED; } diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c index 1f182723bc8..68bf4fa9b5b 100644 --- a/source/blender/editors/render/render_opengl.c +++ b/source/blender/editors/render/render_opengl.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/render/render_ops.c b/source/blender/editors/render/render_ops.c index 62f573c031f..c0995785d05 100644 --- a/source/blender/editors/render/render_ops.c +++ b/source/blender/editors/render/render_ops.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c index d635a799ec1..67a0773199f 100644 --- a/source/blender/editors/render/render_preview.c +++ b/source/blender/editors/render/render_preview.c @@ -68,6 +68,7 @@ #include "BKE_main.h" #include "BKE_material.h" #include "BKE_node.h" +#include "BKE_idprop.h" #include "IMB_imbuf.h" #include "IMB_imbuf_types.h" @@ -286,6 +287,7 @@ void ED_preview_init_dbase(void) BlendFileData *bfd; extern int datatoc_preview_blend_size; extern char datatoc_preview_blend[]; + const int fileflags= G.fileflags; G.fileflags |= G_FILE_NO_UI; bfd= BLO_read_from_memory(datatoc_preview_blend, datatoc_preview_blend_size, NULL); @@ -294,7 +296,7 @@ void ED_preview_init_dbase(void) MEM_freeN(bfd); } - G.fileflags &= ~G_FILE_NO_UI; + G.fileflags= fileflags; } void ED_preview_free_dbase(void) @@ -1053,6 +1055,14 @@ static void shader_preview_render(ShaderPreview *sp, ID *id, int split, int firs /* unassign the pointers, reset vars */ preview_prepare_scene(sp->scene, NULL, GS(id->name), sp); + + /* XXX bad exception, end-exec is not being called in render, because it uses local main */ + if(idtype == ID_TE) { + Tex *tex= (Tex *)id; + if(tex->use_nodes && tex->nodetree) + ntreeEndExecTree(tex->nodetree); + } + } /* runs inside thread for material and icons */ @@ -1078,12 +1088,19 @@ static void shader_preview_free(void *customdata) ShaderPreview *sp= customdata; if(sp->matcopy) { + struct IDProperty *properties; /* node previews */ shader_preview_updatejob(sp); /* get rid of copied material */ BLI_remlink(&pr_main->mat, sp->matcopy); free_material(sp->matcopy); + + properties= IDP_GetProperties((ID *)sp->matcopy, FALSE); + if (properties) { + IDP_FreeProperty(properties); + MEM_freeN(properties); + } MEM_freeN(sp->matcopy); } diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index 95523cba85e..5f9aa54e9db 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/screen/CMakeLists.txt b/source/blender/editors/screen/CMakeLists.txt index 7c43d506a89..f276cc30c0f 100644 --- a/source/blender/editors/screen/CMakeLists.txt +++ b/source/blender/editors/screen/CMakeLists.txt @@ -23,6 +23,7 @@ set(INC ../include ../../blenfont ../../blenkernel + ../../blenloader ../../blenlib ../../imbuf ../../makesdna diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 4784f19012e..4ddb5d059e4 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -1284,6 +1284,9 @@ void ED_region_panels(const bContext *C, ARegion *ar, int vertical, const char * panel->labelofs= xco - triangle; panel->layout= NULL; } + else { + panel->labelofs= 0; + } if(open) { short panelContext; diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c index a39039b254f..ce96df5d3b1 100644 --- a/source/blender/editors/screen/glutil.c +++ b/source/blender/editors/screen/glutil.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/screen/screen_context.c b/source/blender/editors/screen/screen_context.c index 931cc06d6cd..754d75fe9a5 100644 --- a/source/blender/editors/screen/screen_context.c +++ b/source/blender/editors/screen/screen_context.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index 65ccadacf3c..4f92cec39af 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/screen/screen_intern.h b/source/blender/editors/screen/screen_intern.h index 5f0d264ea4b..50a3159644d 100644 --- a/source/blender/editors/screen/screen_intern.h +++ b/source/blender/editors/screen/screen_intern.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 33c1fce4872..75f28b6541f 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -3075,6 +3075,7 @@ void ED_operatortypes_screen(void) /* tools shared by more space types */ WM_operatortype_append(ED_OT_undo); + WM_operatortype_append(ED_OT_undo_push); WM_operatortype_append(ED_OT_redo); } diff --git a/source/blender/editors/screen/screendump.c b/source/blender/editors/screen/screendump.c index 1fbcd7e61fd..7ac73eb8c14 100644 --- a/source/blender/editors/screen/screendump.c +++ b/source/blender/editors/screen/screendump.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/sculpt_paint/CMakeLists.txt b/source/blender/editors/sculpt_paint/CMakeLists.txt index fd527dd1ffc..a22ed87c182 100644 --- a/source/blender/editors/sculpt_paint/CMakeLists.txt +++ b/source/blender/editors/sculpt_paint/CMakeLists.txt @@ -22,6 +22,7 @@ set(INC ../include ../../blenkernel + ../../blenloader ../../imbuf ../../gpu ../../blenlib diff --git a/source/blender/editors/sculpt_paint/SConscript b/source/blender/editors/sculpt_paint/SConscript index 2902b21fff1..90b56ded2cd 100644 --- a/source/blender/editors/sculpt_paint/SConscript +++ b/source/blender/editors/sculpt_paint/SConscript @@ -8,7 +8,7 @@ defs = [] incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf' incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include' incs += ' ../../render/extern/include' -incs += ' ../../gpu ../../makesrna' +incs += ' ../../gpu ../../makesrna ../../blenloader' if env['OURPLATFORM'] == 'linux2': cflags='-pthread' diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c index 7f247b9e815..44dbe447d3e 100644 --- a/source/blender/editors/sculpt_paint/paint_image.c +++ b/source/blender/editors/sculpt_paint/paint_image.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * imagepaint.c * diff --git a/source/blender/editors/sculpt_paint/paint_intern.h b/source/blender/editors/sculpt_paint/paint_intern.h index d0aa0c29c4d..e0a09184e28 100644 --- a/source/blender/editors/sculpt_paint/paint_intern.h +++ b/source/blender/editors/sculpt_paint/paint_intern.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -114,6 +114,9 @@ void BRUSH_OT_curve_preset(struct wmOperatorType *ot); void PAINT_OT_face_select_linked(struct wmOperatorType *ot); void PAINT_OT_face_select_linked_pick(struct wmOperatorType *ot); void PAINT_OT_face_select_all(struct wmOperatorType *ot); +void PAINT_OT_face_select_inverse(struct wmOperatorType *ot); +void PAINT_OT_face_select_hide(struct wmOperatorType *ot); +void PAINT_OT_face_select_reveal(struct wmOperatorType *ot); int facemask_paint_poll(struct bContext *C); diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c index 35111afb430..979b6508b16 100644 --- a/source/blender/editors/sculpt_paint/paint_ops.c +++ b/source/blender/editors/sculpt_paint/paint_ops.c @@ -1,4 +1,4 @@ -/** +/* * * ***** BEGIN GPL LICENSE BLOCK ***** * @@ -224,6 +224,9 @@ void ED_operatortypes_paint(void) WM_operatortype_append(PAINT_OT_face_select_linked); WM_operatortype_append(PAINT_OT_face_select_linked_pick); WM_operatortype_append(PAINT_OT_face_select_all); + WM_operatortype_append(PAINT_OT_face_select_inverse); + WM_operatortype_append(PAINT_OT_face_select_hide); + WM_operatortype_append(PAINT_OT_face_select_reveal); } @@ -414,7 +417,11 @@ void ED_keymap_paint(wmKeyConfig *keyconf) keymap->poll= facemask_paint_poll; WM_keymap_add_item(keymap, "PAINT_OT_face_select_all", AKEY, KM_PRESS, 0, 0); + WM_keymap_add_item(keymap, "PAINT_OT_face_select_inverse", IKEY, KM_PRESS, KM_CTRL, 0); + WM_keymap_add_item(keymap, "PAINT_OT_face_select_hide", HKEY, KM_PRESS, 0, 0); + RNA_boolean_set(WM_keymap_add_item(keymap, "PAINT_OT_face_select_hide", HKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "unselected", 1); + WM_keymap_add_item(keymap, "PAINT_OT_face_select_reveal", HKEY, KM_PRESS, KM_ALT, 0); + WM_keymap_add_item(keymap, "PAINT_OT_face_select_linked", LKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "PAINT_OT_face_select_linked_pick", LKEY, KM_PRESS, 0, 0); - } diff --git a/source/blender/editors/sculpt_paint/paint_undo.c b/source/blender/editors/sculpt_paint/paint_undo.c index 6425e2d0494..49fc1f01869 100644 --- a/source/blender/editors/sculpt_paint/paint_undo.c +++ b/source/blender/editors/sculpt_paint/paint_undo.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * Undo system for painting and sculpting. diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c index 2962ea7e51b..000db4c28f2 100644 --- a/source/blender/editors/sculpt_paint/paint_utils.c +++ b/source/blender/editors/sculpt_paint/paint_utils.c @@ -350,3 +350,69 @@ void PAINT_OT_face_select_all(wmOperatorType *ot) WM_operator_properties_select_all(ot); } + +static int face_select_inverse_exec(bContext *C, wmOperator *UNUSED(op)) +{ + Object *ob= CTX_data_active_object(C); + paintface_deselect_all_visible(ob, SEL_INVERT, TRUE); + ED_region_tag_redraw(CTX_wm_region(C)); + return OPERATOR_FINISHED; +} + + +void PAINT_OT_face_select_inverse(wmOperatorType *ot) +{ + ot->name= "Face Select Invert"; + ot->description= "Invert selection of faces"; + ot->idname= "PAINT_OT_face_select_inverse"; + + ot->exec= face_select_inverse_exec; + ot->poll= facemask_paint_poll; + + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +static int face_select_hide_exec(bContext *C, wmOperator *op) +{ + const int unselected= RNA_boolean_get(op->ptr, "unselected"); + Object *ob= CTX_data_active_object(C); + paintface_hide(ob, unselected); + ED_region_tag_redraw(CTX_wm_region(C)); + return OPERATOR_FINISHED; +} + +void PAINT_OT_face_select_hide(wmOperatorType *ot) +{ + ot->name= "Face Select Hide"; + ot->description= "Hide selected faces"; + ot->idname= "PAINT_OT_face_select_hide"; + + ot->exec= face_select_hide_exec; + ot->poll= facemask_paint_poll; + + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected objects."); +} + +static int face_select_reveal_exec(bContext *C, wmOperator *UNUSED(op)) +{ + Object *ob= CTX_data_active_object(C); + paintface_reveal(ob); + ED_region_tag_redraw(CTX_wm_region(C)); + return OPERATOR_FINISHED; +} + +void PAINT_OT_face_select_reveal(wmOperatorType *ot) +{ + ot->name= "Face Select Reveal"; + ot->description= "Reveal hidden faces"; + ot->idname= "PAINT_OT_face_select_reveal"; + + ot->exec= face_select_reveal_exec; + ot->poll= facemask_paint_poll; + + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + RNA_def_boolean(ot->srna, "unselected", 0, "Unselected", "Hide unselected rather than selected objects."); +} diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index 575b0012c6c..09c70b70368 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c index fa8d61d73de..7505fdb0ecf 100644 --- a/source/blender/editors/sculpt_paint/sculpt.c +++ b/source/blender/editors/sculpt_paint/sculpt.c @@ -109,6 +109,16 @@ void ED_sculpt_modifiers_changed(Object *ob) } sculpt_free_deformMats(ob->sculpt); + } else { + PBVHNode **nodes; + int n, totnode; + + BLI_pbvh_search_gather(ss->pbvh, NULL, NULL, &nodes, &totnode); + + for(n = 0; n < totnode; n++) + BLI_pbvh_node_mark_update(nodes[n]); + + MEM_freeN(nodes); } } @@ -1509,7 +1519,7 @@ static void do_layer_brush(Sculpt *sd, SculptSession *ss, PBVHNode **nodes, int Brush *brush = paint_brush(&sd->paint); float bstrength= ss->cache->bstrength; float area_normal[3], offset[3]; - float lim= ss->cache->radius / 4; + float lim= brush->height; int n; if(bstrength < 0) @@ -1542,15 +1552,15 @@ static void do_layer_brush(Sculpt *sd, SculptSession *ss, PBVHNode **nodes, int sculpt_brush_test_init(ss, &test); BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) { - if(sculpt_brush_test(&test, vd.co)) { - const float fade = bstrength*ss->cache->radius*tex_strength(ss, brush, vd.co, test.dist)*frontface(brush, area_normal, vd.no, vd.fno); + if(sculpt_brush_test(&test, origco[vd.i])) { + const float fade = bstrength*tex_strength(ss, brush, vd.co, test.dist)*frontface(brush, area_normal, vd.no, vd.fno); float *disp= &layer_disp[vd.i]; float val[3]; *disp+= fade; /* Don't let the displacement go past the limit */ - if((lim < 0 && *disp < lim) || (lim > 0 && *disp > lim)) + if((lim < 0 && *disp < lim) || (lim >= 0 && *disp > lim)) *disp = lim; mul_v3_v3fl(val, offset, *disp); @@ -2459,12 +2469,12 @@ static void sculpt_flush_stroke_deform(Sculpt *sd, SculptSession *ss) int n, totnode; PBVHNode** nodes; - PBVHVertexIter vd; BLI_pbvh_search_gather(ss->pbvh, NULL, NULL, &nodes, &totnode); #pragma omp parallel for schedule(guided) if (sd->flags & SCULPT_USE_OPENMP) for (n= 0; n < totnode; n++) { + PBVHVertexIter vd; BLI_pbvh_vertex_iter_begin(ss->pbvh, nodes[n], vd, PBVH_ITER_UNIQUE) { sculpt_flush_pbvhvert_deform(ss, &vd); diff --git a/source/blender/editors/sound/CMakeLists.txt b/source/blender/editors/sound/CMakeLists.txt index c8bad32bc35..c2f7707309b 100644 --- a/source/blender/editors/sound/CMakeLists.txt +++ b/source/blender/editors/sound/CMakeLists.txt @@ -22,6 +22,7 @@ set(INC ../include ../../blenkernel + ../../blenloader ../../blenlib ../../makesdna ../../makesrna diff --git a/source/blender/editors/sound/SConscript b/source/blender/editors/sound/SConscript index 8010dd49c57..e17bccdadd9 100644 --- a/source/blender/editors/sound/SConscript +++ b/source/blender/editors/sound/SConscript @@ -5,7 +5,7 @@ sources = env.Glob('*.c') incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf' incs += ' ../../windowmanager #/intern/guardedalloc' -incs += ' ../../makesrna' +incs += ' ../../makesrna ../../blenloader' incs += ' #/intern/audaspace/intern' defs = [] diff --git a/source/blender/editors/sound/sound_intern.h b/source/blender/editors/sound/sound_intern.h index 455c1896c7c..4cc91c9fec4 100644 --- a/source/blender/editors/sound/sound_intern.h +++ b/source/blender/editors/sound/sound_intern.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/sound/sound_ops.c b/source/blender/editors/sound/sound_ops.c index df554efd979..2d8f1dc240c 100644 --- a/source/blender/editors/sound/sound_ops.c +++ b/source/blender/editors/sound/sound_ops.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_action/CMakeLists.txt b/source/blender/editors/space_action/CMakeLists.txt index e0621a277ae..9280e4d0e7f 100644 --- a/source/blender/editors/space_action/CMakeLists.txt +++ b/source/blender/editors/space_action/CMakeLists.txt @@ -22,6 +22,7 @@ set(INC ../include ../../blenkernel + ../../blenloader ../../blenlib ../../makesdna ../../makesrna diff --git a/source/blender/editors/space_action/SConscript b/source/blender/editors/space_action/SConscript index 2e9a79db04a..0fee8ff68ab 100644 --- a/source/blender/editors/space_action/SConscript +++ b/source/blender/editors/space_action/SConscript @@ -4,6 +4,6 @@ Import ('env') sources = env.Glob('*.c') incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../makesrna ../../imbuf' -incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include' +incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include ../../blenloader' env.BlenderLib ( 'bf_editors_space_action', sources, Split(incs), [], libtype=['core'], priority=[40] ) diff --git a/source/blender/editors/space_action/action_draw.c b/source/blender/editors/space_action/action_draw.c index 7bd326bac68..040c5ebaf47 100644 --- a/source/blender/editors/space_action/action_draw.c +++ b/source/blender/editors/space_action/action_draw.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c index 852927898b9..4f7bddc5c40 100644 --- a/source/blender/editors/space_action/action_edit.c +++ b/source/blender/editors/space_action/action_edit.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -121,7 +121,7 @@ static int act_new_exec(bContext *C, wmOperator *UNUSED(op)) void ACTION_OT_new (wmOperatorType *ot) { /* identifiers */ - ot->name= "New"; + ot->name= "New Action"; ot->idname= "ACTION_OT_new"; ot->description= "Create new action"; @@ -135,6 +135,88 @@ void ACTION_OT_new (wmOperatorType *ot) } /* ************************************************************************** */ +/* POSE MARKERS STUFF */ + +/* *************************** Localise Markers ***************************** */ + +/* ensure that there is: + * 1) an active action editor + * 2) that the mode will have an active action available + * 3) that the set of markers being shown are the scene markers, not the list we're merging + * 4) that there are some selected markers + */ +static int act_markers_make_local_poll(bContext *C) +{ + SpaceAction *sact = CTX_wm_space_action(C); + + /* 1) */ + if (sact == NULL) + return 0; + + /* 2) */ + if (ELEM(sact->mode, SACTCONT_ACTION, SACTCONT_SHAPEKEY) == 0) + return 0; + if (sact->action == NULL) + return 0; + + /* 3) */ + if (sact->flag & SACTION_POSEMARKERS_SHOW) + return 0; + + /* 4) */ + return ED_markers_get_first_selected(ED_context_get_markers(C)) != NULL; +} + +static int act_markers_make_local_exec (bContext *C, wmOperator *op) +{ + ListBase *markers = ED_context_get_markers(C); + + SpaceAction *sact = CTX_wm_space_action(C); + bAction *act = (sact)? sact->action : NULL; + + TimeMarker *marker, *markern=NULL; + + /* sanity checks */ + if (ELEM(NULL, markers, act)) + return OPERATOR_CANCELLED; + + /* migrate markers */ + for (marker = markers->first; marker; marker = markern) { + markern = marker->next; + + /* move if marker is selected */ + if (marker->flag & SELECT) { + BLI_remlink(markers, marker); + BLI_addtail(&act->markers, marker); + } + } + + /* now enable the "show posemarkers only" setting, so that we can see that something did happen */ + sact->flag |= SACTION_POSEMARKERS_SHOW; + + /* notifiers - both sets, as this change affects both */ + WM_event_add_notifier(C, NC_SCENE|ND_MARKERS, NULL); + WM_event_add_notifier(C, NC_ANIMATION|ND_MARKERS, NULL); + + return OPERATOR_FINISHED; +} + +void ACTION_OT_markers_make_local (wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Make Markers Local"; + ot->idname= "ACTION_OT_markers_make_local"; + ot->description= "Move selected scene markers to the active Action as local 'pose' markers"; + + /* callbacks */ + ot->exec = act_markers_make_local_exec; + ot->poll = act_markers_make_local_poll; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + +/* ************************************************************************** */ /* KEYFRAME-RANGE STUFF */ /* *************************** Calculate Range ************************** */ diff --git a/source/blender/editors/space_action/action_intern.h b/source/blender/editors/space_action/action_intern.h index b483a3edbdc..f9a5ac1093d 100644 --- a/source/blender/editors/space_action/action_intern.h +++ b/source/blender/editors/space_action/action_intern.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -104,6 +104,8 @@ void ACTION_OT_mirror(struct wmOperatorType *ot); void ACTION_OT_new(struct wmOperatorType *ot); +void ACTION_OT_markers_make_local(struct wmOperatorType *ot); + /* defines for snap keyframes * NOTE: keep in sync with eEditKeyframes_Snap (in ED_keyframes_edit.h) */ diff --git a/source/blender/editors/space_action/action_ops.c b/source/blender/editors/space_action/action_ops.c index 3b448becf8b..e82c26488b5 100644 --- a/source/blender/editors/space_action/action_ops.c +++ b/source/blender/editors/space_action/action_ops.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -79,6 +79,8 @@ void action_operatortypes(void) WM_operatortype_append(ACTION_OT_previewrange_set); WM_operatortype_append(ACTION_OT_view_all); + + WM_operatortype_append(ACTION_OT_markers_make_local); } /* ************************** registration - keymaps **********************************/ diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c index 639ed372c67..b9662a8b8e5 100644 --- a/source/blender/editors/space_action/action_select.c +++ b/source/blender/editors/space_action/action_select.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_action/space_action.c b/source/blender/editors/space_action/space_action.c index 3f3611d75f5..3e25df634e5 100644 --- a/source/blender/editors/space_action/space_action.c +++ b/source/blender/editors/space_action/space_action.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -193,7 +193,7 @@ static void action_main_area_draw(const bContext *C, ARegion *ar) /* markers */ UI_view2d_view_orthoSpecial(ar, v2d, 1); - flag = (saction->flag & SACTION_POSEMARKERS_SHOW)? DRAW_MARKERS_LOCAL : 0; + flag = (ac.markers && (ac.markers != &ac.scene->markers))? DRAW_MARKERS_LOCAL : 0; draw_markers_time(C, flag); /* preview range */ diff --git a/source/blender/editors/space_api/CMakeLists.txt b/source/blender/editors/space_api/CMakeLists.txt index 93f256cf3da..22319dbb26e 100644 --- a/source/blender/editors/space_api/CMakeLists.txt +++ b/source/blender/editors/space_api/CMakeLists.txt @@ -22,6 +22,7 @@ set(INC ../include ../../blenkernel + ../../blenloader ../../blenlib ../../makesdna ../../makesrna diff --git a/source/blender/editors/space_api/SConscript b/source/blender/editors/space_api/SConscript index c499d5865ec..d6a763a78ff 100644 --- a/source/blender/editors/space_api/SConscript +++ b/source/blender/editors/space_api/SConscript @@ -3,7 +3,7 @@ Import ('env') sources = env.Glob('*.c') -incs = '../include ../../blenlib ../../blenkernel ../../makesdna' +incs = '../include ../../blenlib ../../blenkernel ../../blenloader ../../makesdna' incs += ' ../../windowmanager ../../python ../../makesrna' incs += ' #/intern/guardedalloc #/extern/glew/include' diff --git a/source/blender/editors/space_api/space.c b/source/blender/editors/space_api/space.c index e862358c465..bfe47f6e35a 100644 --- a/source/blender/editors/space_api/space.c +++ b/source/blender/editors/space_api/space.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_api/spacetypes.c b/source/blender/editors/space_api/spacetypes.c index a00b5a50229..bd19ff5e1b1 100644 --- a/source/blender/editors/space_api/spacetypes.c +++ b/source/blender/editors/space_api/spacetypes.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_buttons/CMakeLists.txt b/source/blender/editors/space_buttons/CMakeLists.txt index 8a55567c4c0..94b3f1c3926 100644 --- a/source/blender/editors/space_buttons/CMakeLists.txt +++ b/source/blender/editors/space_buttons/CMakeLists.txt @@ -22,6 +22,7 @@ set(INC ../include ../../blenkernel + ../../blenloader ../../blenlib ../../makesdna ../../makesrna diff --git a/source/blender/editors/space_buttons/SConscript b/source/blender/editors/space_buttons/SConscript index 31438b641e0..a4270f1f59a 100644 --- a/source/blender/editors/space_buttons/SConscript +++ b/source/blender/editors/space_buttons/SConscript @@ -5,7 +5,7 @@ sources = env.Glob('*.c') incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf' incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include' -incs += ' ../../makesrna ../../render/extern/include' +incs += ' ../../makesrna ../../render/extern/include ../../blenloader' defs = [] diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index dda5887aef0..486cc462584 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_buttons/buttons_header.c b/source/blender/editors/space_buttons/buttons_header.c index bfc5a27883d..cf0ae07d891 100644 --- a/source/blender/editors/space_buttons/buttons_header.c +++ b/source/blender/editors/space_buttons/buttons_header.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_buttons/buttons_intern.h b/source/blender/editors/space_buttons/buttons_intern.h index 407454d4347..dda64ae1b40 100644 --- a/source/blender/editors/space_buttons/buttons_intern.h +++ b/source/blender/editors/space_buttons/buttons_intern.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_buttons/buttons_ops.c b/source/blender/editors/space_buttons/buttons_ops.c index b7c9bdde0e8..b2edff87f9c 100644 --- a/source/blender/editors/space_buttons/buttons_ops.c +++ b/source/blender/editors/space_buttons/buttons_ops.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c index afb8acb087b..b6feb4ee1d6 100644 --- a/source/blender/editors/space_buttons/space_buttons.c +++ b/source/blender/editors/space_buttons/space_buttons.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_console/console_draw.c b/source/blender/editors/space_console/console_draw.c index ba9993cfe60..ffb6bdb1f57 100644 --- a/source/blender/editors/space_console/console_draw.c +++ b/source/blender/editors/space_console/console_draw.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -233,18 +233,6 @@ int console_textview_height(struct SpaceConsole *sc, struct ARegion *ar) return console_textview_main__internal(sc, ar, 0, mval, NULL, NULL); } -void *console_text_pick(struct SpaceConsole *sc, struct ARegion *ar, int mouse_y) -{ - void *mouse_pick= NULL; - int mval[2]; - - mval[0]= 0; - mval[1]= mouse_y; - - console_textview_main__internal(sc, ar, 0, mval, &mouse_pick, NULL); - return (void *)mouse_pick; -} - int console_char_pick(struct SpaceConsole *sc, struct ARegion *ar, int mval[2]) { int pos_pick= 0; diff --git a/source/blender/editors/space_console/console_intern.h b/source/blender/editors/space_console/console_intern.h index 72eac14c2ca..acdd7e33a8e 100644 --- a/source/blender/editors/space_console/console_intern.h +++ b/source/blender/editors/space_console/console_intern.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -34,7 +34,6 @@ struct bContext; /* console_draw.c */ void console_textview_main(struct SpaceConsole *sc, struct ARegion *ar); int console_textview_height(struct SpaceConsole *sc, struct ARegion *ar); /* needed to calculate the scrollbar */ -void *console_text_pick(struct SpaceConsole *sc, struct ARegion *ar, int mouse_y); /* needed for selection */ int console_char_pick(struct SpaceConsole *sc, struct ARegion *ar, int mval[2]); void console_scrollback_prompt_begin(struct SpaceConsole *sc, ConsoleLine *cl_dummy); diff --git a/source/blender/editors/space_console/console_ops.c b/source/blender/editors/space_console/console_ops.c index 3a7c306ac50..b3de56995bd 100644 --- a/source/blender/editors/space_console/console_ops.c +++ b/source/blender/editors/space_console/console_ops.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_console/space_console.c b/source/blender/editors/space_console/space_console.c index 126db64e2a8..ebf96cca191 100644 --- a/source/blender/editors/space_console/space_console.c +++ b/source/blender/editors/space_console/space_console.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index 79c1cce4656..041280aaf7e 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_file/file_intern.h b/source/blender/editors/space_file/file_intern.h index 692953a18a3..d9f7e7dc833 100644 --- a/source/blender/editors/space_file/file_intern.h +++ b/source/blender/editors/space_file/file_intern.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index 67b74010e53..100931e02eb 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_file/file_panels.c b/source/blender/editors/space_file/file_panels.c index f9c467a039d..37abc854937 100644 --- a/source/blender/editors/space_file/file_panels.c +++ b/source/blender/editors/space_file/file_panels.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index ef011ca4b40..41667a96ab6 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_file/filelist.h b/source/blender/editors/space_file/filelist.h index 73bd78fadbc..ff7e6869ee3 100644 --- a/source/blender/editors/space_file/filelist.h +++ b/source/blender/editors/space_file/filelist.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index 9092e639542..c481c5afffc 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c index 2856f0f4fdf..78977e4e88f 100644 --- a/source/blender/editors/space_file/fsmenu.c +++ b/source/blender/editors/space_file/fsmenu.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -312,7 +312,7 @@ void fsmenu_read_system(struct FSMenu* fsmenu) #if (MAC_OS_X_VERSION_MIN_REQUIRED <= MAC_OS_X_VERSION_10_4) OSErr err=noErr; int i; - char *home; + const char *home; /* loop through all the OS X Volumes, and add them to the SYSTEM section */ for (i=1; err!=nsvErr; i++) @@ -454,7 +454,7 @@ void fsmenu_read_system(struct FSMenu* fsmenu) #else /* unix */ { - char *home= getenv("HOME"); + const char *home= getenv("HOME"); if(home) { BLI_snprintf(line, FILE_MAXDIR, "%s/", home); diff --git a/source/blender/editors/space_file/fsmenu.h b/source/blender/editors/space_file/fsmenu.h index d499f439f65..ec322de5c52 100644 --- a/source/blender/editors/space_file/fsmenu.h +++ b/source/blender/editors/space_file/fsmenu.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index 47140bd6e74..4c475039c37 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_graph/CMakeLists.txt b/source/blender/editors/space_graph/CMakeLists.txt index e57bf83cb12..5b5fd41bf23 100644 --- a/source/blender/editors/space_graph/CMakeLists.txt +++ b/source/blender/editors/space_graph/CMakeLists.txt @@ -22,6 +22,7 @@ set(INC ../include ../../blenkernel + ../../blenloader ../../blenlib ../../makesdna ../../makesrna diff --git a/source/blender/editors/space_graph/SConscript b/source/blender/editors/space_graph/SConscript index 174894ddfad..75d0927192b 100644 --- a/source/blender/editors/space_graph/SConscript +++ b/source/blender/editors/space_graph/SConscript @@ -5,6 +5,6 @@ sources = env.Glob('*.c') incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../makesrna ../../imbuf' incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include' -incs += ' #/intern/audaspace/intern' +incs += ' #/intern/audaspace/intern ../../blenloader' env.BlenderLib ( 'bf_editors_space_graph', sources, Split(incs), [], libtype=['core'], priority=[50] ) diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c index 635044fa795..8c97e269aa4 100644 --- a/source/blender/editors/space_graph/graph_buttons.c +++ b/source/blender/editors/space_graph/graph_buttons.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index 901ede9fff7..44bc3fe7d94 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c index 697ea86e43a..5756c99862d 100644 --- a/source/blender/editors/space_graph/graph_edit.c +++ b/source/blender/editors/space_graph/graph_edit.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_graph/graph_intern.h b/source/blender/editors/space_graph/graph_intern.h index d27935ee75a..b596e659b63 100644 --- a/source/blender/editors/space_graph/graph_intern.h +++ b/source/blender/editors/space_graph/graph_intern.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_graph/graph_ops.c b/source/blender/editors/space_graph/graph_ops.c index 57e9f49f69d..93004a871d0 100644 --- a/source/blender/editors/space_graph/graph_ops.c +++ b/source/blender/editors/space_graph/graph_ops.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c index 3fb86be4ed1..0d6f097c613 100644 --- a/source/blender/editors/space_graph/graph_select.c +++ b/source/blender/editors/space_graph/graph_select.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_graph/graph_utils.c b/source/blender/editors/space_graph/graph_utils.c index 31c1394f1ae..7c3b61e79b3 100644 --- a/source/blender/editors/space_graph/graph_utils.c +++ b/source/blender/editors/space_graph/graph_utils.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c index 7a8bc9a65d6..38919076b13 100644 --- a/source/blender/editors/space_graph/space_graph.c +++ b/source/blender/editors/space_graph/space_graph.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_image/CMakeLists.txt b/source/blender/editors/space_image/CMakeLists.txt index c7b0db8fbbc..f6825808267 100644 --- a/source/blender/editors/space_image/CMakeLists.txt +++ b/source/blender/editors/space_image/CMakeLists.txt @@ -23,6 +23,7 @@ set(INC ../include ../../blenfont ../../blenkernel + ../../blenloader ../../blenlib ../../imbuf ../../makesdna diff --git a/source/blender/editors/space_image/SConscript b/source/blender/editors/space_image/SConscript index f51037642c4..e84afcdaab1 100644 --- a/source/blender/editors/space_image/SConscript +++ b/source/blender/editors/space_image/SConscript @@ -5,7 +5,7 @@ sources = env.Glob('*.c') incs = '../include ../../blenfont ../../blenlib ../../blenkernel ../../makesdna ../../imbuf' incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include' -incs += ' ../../render/extern/include ../../makesrna' +incs += ' ../../render/extern/include ../../makesrna ../../blenloader' defs = [] diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c index e68d9f66986..ea991f420a0 100644 --- a/source/blender/editors/space_image/image_buttons.c +++ b/source/blender/editors/space_image/image_buttons.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c index 9593c896c22..4abddf18c20 100644 --- a/source/blender/editors/space_image/image_draw.c +++ b/source/blender/editors/space_image/image_draw.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_image/image_header.c b/source/blender/editors/space_image/image_header.c index ceb7cda2316..176e12025f7 100644 --- a/source/blender/editors/space_image/image_header.c +++ b/source/blender/editors/space_image/image_header.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_image/image_intern.h b/source/blender/editors/space_image/image_intern.h index 327749125a5..f3804fbc453 100644 --- a/source/blender/editors/space_image/image_intern.h +++ b/source/blender/editors/space_image/image_intern.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -79,6 +79,8 @@ void IMAGE_OT_save_sequence(struct wmOperatorType *ot); void IMAGE_OT_pack(struct wmOperatorType *ot); void IMAGE_OT_unpack(struct wmOperatorType *ot); +void IMAGE_OT_invert(struct wmOperatorType *ot); + void IMAGE_OT_cycle_render_slot(struct wmOperatorType *ot); void IMAGE_OT_sample(struct wmOperatorType *ot); diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index fdf5cea880b..25dd79ecc8e 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -1345,6 +1345,89 @@ void IMAGE_OT_new(wmOperatorType *ot) RNA_def_boolean(ot->srna, "float", 0, "32 bit Float", "Create image with 32 bit floating point bit depth."); } +/********************* invert operators *********************/ + +static int image_invert_poll(bContext *C) +{ + Image *ima= CTX_data_edit_image(C); + ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL); + + if( ibuf != NULL ) + return 1; + return 0; +} + +static int image_invert_exec(bContext *C, wmOperator *op) +{ + Image *ima= CTX_data_edit_image(C); + ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL); + + // flags indicate if this channel should be inverted + short r,g,b,a; + int i, dirty = 0; + + if( ibuf == NULL) // TODO: this should actually never happen, but does for render-results -> cleanup + return OPERATOR_CANCELLED; + + r = RNA_boolean_get(op->ptr, "invert_r"); + g = RNA_boolean_get(op->ptr, "invert_g"); + b = RNA_boolean_get(op->ptr, "invert_b"); + a = RNA_boolean_get(op->ptr, "invert_a"); + + /* TODO: make this into an IMB_invert_channels(ibuf,r,g,b,a) method!? */ + if (ibuf->rect_float) { + + float *fp = (float *) ibuf->rect_float; + for( i = ibuf->x * ibuf->y; i > 0; i--, fp+=4 ) { + if( r ) fp[0] = 1.0f - fp[0]; + if( g ) fp[1] = 1.0f - fp[1]; + if( b ) fp[2] = 1.0f - fp[2]; + if( a ) fp[3] = 1.0f - fp[3]; + } + dirty = 1; + IMB_rect_from_float(ibuf); + } + else if(ibuf->rect) { + + char *cp = (char *) ibuf->rect; + for( i = ibuf->x * ibuf->y; i > 0; i--, cp+=4 ) { + if( r ) cp[0] = 255 - cp[0]; + if( g ) cp[1] = 255 - cp[1]; + if( b ) cp[2] = 255 - cp[2]; + if( a ) cp[3] = 255 - cp[3]; + } + dirty = 1; + } + else + return OPERATOR_CANCELLED; + + ibuf->userflags |= IB_BITMAPDIRTY; // mark as modified + WM_event_add_notifier(C, NC_IMAGE|NA_EDITED, ima); + + return OPERATOR_FINISHED; + +} + +void IMAGE_OT_invert(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Invert Channels"; + ot->idname= "IMAGE_OT_invert"; + + /* api callbacks */ + ot->exec= image_invert_exec; + ot->poll= image_invert_poll; + + /* properties */ + RNA_def_boolean(ot->srna, "invert_r", 0, "Red", "Invert Red Channel"); + RNA_def_boolean(ot->srna, "invert_g", 0, "Green", "Invert Green Channel"); + RNA_def_boolean(ot->srna, "invert_b", 0, "Blue", "Invert Blue Channel"); + RNA_def_boolean(ot->srna, "invert_a", 0, "Alpha", "Invert Alpha Channel"); + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; +} + /********************* pack operator *********************/ static int pack_test(bContext *C, wmOperator *op) @@ -1499,7 +1582,7 @@ void IMAGE_OT_unpack(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - + /* properties */ RNA_def_enum(ot->srna, "method", unpack_method_items, PF_USE_LOCAL, "Method", "How to unpack."); RNA_def_string(ot->srna, "id", "", 21, "Image Name", "Image datablock name to unpack."); /* XXX, weark!, will fail with library, name collisions */ diff --git a/source/blender/editors/space_image/image_render.c b/source/blender/editors/space_image/image_render.c index f09a1353935..03ac3f4e79e 100644 --- a/source/blender/editors/space_image/image_render.c +++ b/source/blender/editors/space_image/image_render.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c index 1d7cb357e5f..cc81d7ac975 100644 --- a/source/blender/editors/space_image/space_image.c +++ b/source/blender/editors/space_image/space_image.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -478,6 +478,8 @@ static void image_operatortypes(void) WM_operatortype_append(IMAGE_OT_save_sequence); WM_operatortype_append(IMAGE_OT_pack); WM_operatortype_append(IMAGE_OT_unpack); + + WM_operatortype_append(IMAGE_OT_invert); WM_operatortype_append(IMAGE_OT_cycle_render_slot); diff --git a/source/blender/editors/space_info/CMakeLists.txt b/source/blender/editors/space_info/CMakeLists.txt index 262882e886f..c7e0b23acab 100644 --- a/source/blender/editors/space_info/CMakeLists.txt +++ b/source/blender/editors/space_info/CMakeLists.txt @@ -23,6 +23,7 @@ set(INC ../include ../../blenfont ../../blenkernel + ../../blenloader ../../blenlib ../../imbuf ../../makesdna diff --git a/source/blender/editors/space_info/SConscript b/source/blender/editors/space_info/SConscript index 417b9c7d962..697ee4319b8 100644 --- a/source/blender/editors/space_info/SConscript +++ b/source/blender/editors/space_info/SConscript @@ -4,7 +4,7 @@ Import ('env') sources = env.Glob('*.c') incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../makesrna ../../imbuf ../../blenfont' -incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include' +incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include ../../blenloader' defs = [] diff --git a/source/blender/editors/space_info/info_draw.c b/source/blender/editors/space_info/info_draw.c index 71424bb8384..6b3c3f1ad25 100644 --- a/source/blender/editors/space_info/info_draw.c +++ b/source/blender/editors/space_info/info_draw.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -62,14 +62,6 @@ static void info_report_color(unsigned char *fg, unsigned char *bg, Report *report, int bool) { - /* - if (type & RPT_ERROR_ALL) { fg[0]=220; fg[1]=0; fg[2]=0; } - else if (type & RPT_WARNING_ALL) { fg[0]=220; fg[1]=96; fg[2]=96; } - else if (type & RPT_OPERATOR_ALL) { fg[0]=96; fg[1]=128; fg[2]=255; } - else if (type & RPT_INFO_ALL) { fg[0]=0; fg[1]=170; fg[2]=0; } - else if (type & RPT_DEBUG_ALL) { fg[0]=196; fg[1]=196; fg[2]=196; } - else { fg[0]=196; fg[1]=196; fg[2]=196; } - */ if(report->flag & SELECT) { fg[0]=255; fg[1]=255; fg[2]=255; if(bool) { @@ -79,17 +71,35 @@ static void info_report_color(unsigned char *fg, unsigned char *bg, Report *repo bg[0]=90; bg[1]=122; bg[2]=249; } } - else { fg[0]=0; fg[1]=0; fg[2]=0; - - if(bool) { - bg[0]=120; bg[1]=120; bg[2]=120; + + if (report->type & RPT_ERROR_ALL) { + if (bool) { bg[0]=220; bg[1]=0; bg[2]=0; } + else { bg[0]=214; bg[1]=0; bg[2]=0; } + } + else if (report->type & RPT_WARNING_ALL) { + if (bool) { bg[0]=220; bg[1]=128; bg[2]=96; } + else { bg[0]=214; bg[1]=122; bg[2]=90; } + } +#if 0 // XXX: this looks like the selected colour, so don't use this + else if (report->type & RPT_OPERATOR_ALL) { + if (bool) { bg[0]=96; bg[1]=128; bg[2]=255; } + else { bg[0]=90; bg[1]=122; bg[2]=249; } + } +#endif + else if (report->type & RPT_INFO_ALL) { + if (bool) { bg[0]=0; bg[1]=170; bg[2]=0; } + else { bg[0]=0; bg[1]=164; bg[2]=0; } + } + else if (report->type & RPT_DEBUG_ALL) { + if (bool) { bg[0]=196; bg[1]=196; bg[2]=196; } + else { bg[0]=190; bg[1]=190; bg[2]=190; } } else { - bg[0]=114; bg[1]=114; bg[2]=114; + if (bool) { bg[0]=120; bg[1]=120; bg[2]=120; } + else { bg[0]=114; bg[1]=114; bg[2]=114; } } - } } diff --git a/source/blender/editors/space_info/info_intern.h b/source/blender/editors/space_info/info_intern.h index abbe37a4fe1..cda1123fa79 100644 --- a/source/blender/editors/space_info/info_intern.h +++ b/source/blender/editors/space_info/info_intern.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_info/info_ops.c b/source/blender/editors/space_info/info_ops.c index a20d3b961c0..a4243f7c19e 100644 --- a/source/blender/editors/space_info/info_ops.c +++ b/source/blender/editors/space_info/info_ops.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_info/info_report.c b/source/blender/editors/space_info/info_report.c index ce0bc6864c8..8766df6a0b9 100644 --- a/source/blender/editors/space_info/info_report.c +++ b/source/blender/editors/space_info/info_report.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_info/info_stats.c b/source/blender/editors/space_info/info_stats.c index b5abc077eef..b3c8c6c891e 100644 --- a/source/blender/editors/space_info/info_stats.c +++ b/source/blender/editors/space_info/info_stats.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_info/space_info.c b/source/blender/editors/space_info/space_info.c index b7360f75de9..b9415d630be 100644 --- a/source/blender/editors/space_info/space_info.c +++ b/source/blender/editors/space_info/space_info.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_info/textview.c b/source/blender/editors/space_info/textview.c index 0f11dee7d5a..c718c3a9532 100644 --- a/source/blender/editors/space_info/textview.c +++ b/source/blender/editors/space_info/textview.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_info/textview.h b/source/blender/editors/space_info/textview.h index aeea12827be..5d20eef56c9 100644 --- a/source/blender/editors/space_info/textview.h +++ b/source/blender/editors/space_info/textview.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_logic/CMakeLists.txt b/source/blender/editors/space_logic/CMakeLists.txt index 707f4ab42ed..d33bf2db5e1 100644 --- a/source/blender/editors/space_logic/CMakeLists.txt +++ b/source/blender/editors/space_logic/CMakeLists.txt @@ -22,6 +22,7 @@ set(INC ../include ../../blenkernel + ../../blenloader ../../blenlib ../../makesdna ../../makesrna diff --git a/source/blender/editors/space_logic/SConscript b/source/blender/editors/space_logic/SConscript index 4d02363ff90..6beb3ecb48f 100644 --- a/source/blender/editors/space_logic/SConscript +++ b/source/blender/editors/space_logic/SConscript @@ -5,7 +5,7 @@ sources = env.Glob('*.c') incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf' incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include' -incs += ' ../../makesrna ../interface' +incs += ' ../../makesrna ../interface ../../blenloader' defs = [] diff --git a/source/blender/editors/space_logic/logic_buttons.c b/source/blender/editors/space_logic/logic_buttons.c index 2148dd289ca..310cbf645d1 100644 --- a/source/blender/editors/space_logic/logic_buttons.c +++ b/source/blender/editors/space_logic/logic_buttons.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_logic/logic_intern.h b/source/blender/editors/space_logic/logic_intern.h index 0c30aa711f1..acd5eb0e098 100644 --- a/source/blender/editors/space_logic/logic_intern.h +++ b/source/blender/editors/space_logic/logic_intern.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_logic/logic_ops.c b/source/blender/editors/space_logic/logic_ops.c index 4bcb7c1d2f3..979979ff23e 100644 --- a/source/blender/editors/space_logic/logic_ops.c +++ b/source/blender/editors/space_logic/logic_ops.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c index 40206a314e8..f7a65d27bb3 100644 --- a/source/blender/editors/space_logic/logic_window.c +++ b/source/blender/editors/space_logic/logic_window.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_logic/space_logic.c b/source/blender/editors/space_logic/space_logic.c index 516130aa09b..69ac68f6f82 100644 --- a/source/blender/editors/space_logic/space_logic.c +++ b/source/blender/editors/space_logic/space_logic.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_nla/CMakeLists.txt b/source/blender/editors/space_nla/CMakeLists.txt index 3f194bc0438..f8503739844 100644 --- a/source/blender/editors/space_nla/CMakeLists.txt +++ b/source/blender/editors/space_nla/CMakeLists.txt @@ -22,6 +22,7 @@ set(INC ../include ../../blenkernel + ../../blenloader ../../blenlib ../../makesdna ../../makesrna diff --git a/source/blender/editors/space_nla/SConscript b/source/blender/editors/space_nla/SConscript index 790e3ad822c..51ce829ed8d 100644 --- a/source/blender/editors/space_nla/SConscript +++ b/source/blender/editors/space_nla/SConscript @@ -4,6 +4,6 @@ Import ('env') sources = env.Glob('*.c') incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../makesrna ../../imbuf' -incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include' +incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include ../../blenloader' env.BlenderLib ( 'bf_editors_space_nla', sources, Split(incs), [], libtype=['core'], priority=[85] ) diff --git a/source/blender/editors/space_nla/nla_buttons.c b/source/blender/editors/space_nla/nla_buttons.c index 8069bf74bce..a49067f64bd 100644 --- a/source/blender/editors/space_nla/nla_buttons.c +++ b/source/blender/editors/space_nla/nla_buttons.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_nla/nla_channels.c b/source/blender/editors/space_nla/nla_channels.c index 7d4db6fd89c..1ef368c8454 100644 --- a/source/blender/editors/space_nla/nla_channels.c +++ b/source/blender/editors/space_nla/nla_channels.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index 43a64f07de5..b09fb97094e 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index d43b86b436d..64fcb8d6ac5 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_nla/nla_intern.h b/source/blender/editors/space_nla/nla_intern.h index 98ebc5af227..bd3a80a65c2 100644 --- a/source/blender/editors/space_nla/nla_intern.h +++ b/source/blender/editors/space_nla/nla_intern.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_nla/nla_ops.c b/source/blender/editors/space_nla/nla_ops.c index 49c1733c37a..358b847db20 100644 --- a/source/blender/editors/space_nla/nla_ops.c +++ b/source/blender/editors/space_nla/nla_ops.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_nla/nla_select.c b/source/blender/editors/space_nla/nla_select.c index 40cc6fb0784..ec51be4d419 100644 --- a/source/blender/editors/space_nla/nla_select.c +++ b/source/blender/editors/space_nla/nla_select.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_nla/space_nla.c b/source/blender/editors/space_nla/space_nla.c index 06b1b93b590..c1bd5a98551 100644 --- a/source/blender/editors/space_nla/space_nla.c +++ b/source/blender/editors/space_nla/space_nla.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_node/CMakeLists.txt b/source/blender/editors/space_node/CMakeLists.txt index c615f5cc85f..955f57002a5 100644 --- a/source/blender/editors/space_node/CMakeLists.txt +++ b/source/blender/editors/space_node/CMakeLists.txt @@ -23,6 +23,7 @@ set(INC ../include ../../blenfont ../../blenkernel + ../../blenloader ../../blenlib ../../imbuf ../../makesdna diff --git a/source/blender/editors/space_node/SConscript b/source/blender/editors/space_node/SConscript index 1487a68215e..634d4b777d9 100644 --- a/source/blender/editors/space_node/SConscript +++ b/source/blender/editors/space_node/SConscript @@ -4,7 +4,7 @@ Import ('env') sources = env.Glob('*.c') incs = '../include ../../blenfont ../../blenlib ../../blenkernel ../../makesdna ../../makesrna ../../imbuf' -incs += ' ../../nodes ../../render/extern/include' +incs += ' ../../nodes ../../render/extern/include ../../blenloader' incs += ' ../../windowmanager #intern/guardedalloc #extern/glew/include' defs = [] cf = [] diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 203e6a618a5..880b537de02 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -1604,11 +1604,11 @@ void node_draw_link(View2D *v2d, SpaceNode *snode, bNodeLink *link) int do_shaded= 0, th_col1= TH_HEADER, th_col2= TH_HEADER; int do_triple= 0, th_col3= TH_WIRE; - if(link->fromnode==NULL && link->tonode==NULL) + if(link->fromsock==NULL && link->tosock==NULL) return; /* new connection */ - if(link->fromnode==NULL || link->tonode==NULL) { + if(!link->fromsock || !link->tosock) { th_col1 = TH_ACTIVE; do_triple = 1; } @@ -1620,8 +1620,9 @@ void node_draw_link(View2D *v2d, SpaceNode *snode, bNodeLink *link) return; /* a bit ugly... but thats how we detect the internal group links */ - if(link->fromnode==link->tonode) { - th_col1 = TH_GRID; + if(!link->fromnode || !link->tonode) { + UI_ThemeColorBlend(TH_BACK, TH_WIRE, 0.5f); + do_shaded= 0; } else { /* check cyclic */ diff --git a/source/blender/editors/space_node/node_buttons.c b/source/blender/editors/space_node/node_buttons.c index 69a6029e140..12f99baa800 100644 --- a/source/blender/editors/space_node/node_buttons.c +++ b/source/blender/editors/space_node/node_buttons.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c index 7b9a33c521f..c766b797534 100644 --- a/source/blender/editors/space_node/node_draw.c +++ b/source/blender/editors/space_node/node_draw.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -30,6 +30,8 @@ #include <stdio.h> #include <string.h> +#include "MEM_guardedalloc.h" + #include "DNA_node_types.h" #include "DNA_material_types.h" #include "DNA_object_types.h" @@ -68,6 +70,9 @@ #include "node_intern.h" +/* width of socket columns in group display */ +#define NODE_GROUP_FRAME 120 + // XXX interface.h extern void ui_dropshadow(rctf *rct, float radius, float aspect, int select); @@ -380,9 +385,13 @@ static void node_update_group(const bContext *C, bNodeTree *ntree, bNode *gnode) { bNodeTree *ngroup= (bNodeTree *)gnode->id; bNode *node; - bNodeSocket *nsock; + bNodeSocket *sock, *gsock; rctf *rect= &gnode->totr; int counter; + int dy; + + rect->xmin = rect->xmax = gnode->locx; + rect->ymin = rect->ymax = gnode->locy; /* center them, is a bit of abuse of locx and locy though */ for(node= ngroup->nodes.first; node; node= node->next) { @@ -405,23 +414,43 @@ static void node_update_group(const bContext *C, bNodeTree *ntree, bNode *gnode) else BLI_union_rctf(rect, &node->totr); } - if(counter==1) return; /* should be prevented? */ - rect->xmin-= NODE_DY; + /* add some room for links to group sockets */ + rect->xmin -= 4*NODE_DY; + rect->xmax += 4*NODE_DY; rect->ymin-= NODE_DY; - rect->xmax+= NODE_DY; rect->ymax+= NODE_DY; - /* output sockets */ - for(nsock= gnode->outputs.first; nsock; nsock= nsock->next) { - nsock->locx= rect->xmax; - nsock->locy= nsock->tosock->locy; + /* input sockets */ + dy = 0.5f*(rect->ymin+rect->ymax) + NODE_DY*(BLI_countlist(&gnode->inputs)-1); + for(gsock=ngroup->inputs.first, sock=gnode->inputs.first; gsock; gsock=gsock->next, sock=sock->next) { + gsock->locx = rect->xmin; + sock->locx = rect->xmin - NODE_GROUP_FRAME; + sock->locy = gsock->locy = dy; + + /* prevent long socket lists from growing out of the group box */ + if (dy-3*NODE_DYS < rect->ymin) + rect->ymin = dy-3*NODE_DYS; + if (dy+3*NODE_DYS > rect->ymax) + rect->ymax = dy+3*NODE_DYS; + + dy -= 2*NODE_DY; } - /* input sockets */ - for(nsock= gnode->inputs.first; nsock; nsock= nsock->next) { - nsock->locx= rect->xmin; - nsock->locy= nsock->tosock->locy; + /* output sockets */ + dy = 0.5f*(rect->ymin+rect->ymax) + NODE_DY*(BLI_countlist(&gnode->outputs)-1); + for(gsock=ngroup->outputs.first, sock=gnode->outputs.first; gsock; gsock=gsock->next, sock=sock->next) { + gsock->locx = rect->xmax; + sock->locx = rect->xmax + NODE_GROUP_FRAME; + sock->locy = gsock->locy = dy - NODE_DYS; + + /* prevent long socket lists from growing out of the group box */ + if (dy-3*NODE_DYS < rect->ymin) + rect->ymin = dy-3*NODE_DYS; + if (dy+3*NODE_DYS > rect->ymax) + rect->ymax = dy+3*NODE_DYS; + + dy -= 2*NODE_DY; } } @@ -549,29 +578,6 @@ static void node_sync_cb(bContext *UNUSED(C), void *snode_v, void *node_v) /* ************** Socket callbacks *********** */ -/* NOTE: this is a block-menu, needs 0 events, otherwise the menu closes */ -static uiBlock *socket_vector_menu(bContext *C, ARegion *ar, void *socket_v) -{ - bNodeSocket *sock= socket_v; - uiBlock *block; - - SpaceNode *snode= CTX_wm_space_node(C); - bNodeTree *ntree = snode->nodetree; - PointerRNA ptr; - uiLayout *layout; - - RNA_pointer_create(&ntree->id, &RNA_NodeSocket, sock, &ptr); - - block= uiBeginBlock(C, ar, "socket menu", UI_EMBOSS); - uiBlockSetFlag(block, UI_BLOCK_KEEP_OPEN); - - layout= uiLayoutColumn(uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, sock->locx, sock->locy-8, 140, 20, U.uistyles.first), 0); - - uiItemR(layout, &ptr, "default_value", UI_ITEM_R_EXPAND, "", ICON_NULL); - - return block; -} - /* not a callback */ static void node_draw_preview(bNodePreview *preview, rctf *prv) { @@ -626,16 +632,91 @@ static void node_draw_preview(bNodePreview *preview, rctf *prv) } +typedef struct SocketVectorMenuArgs { + PointerRNA ptr; + int x, y, width; + uiButHandleFunc cb; + void *arg1, *arg2; +} SocketVectorMenuArgs; + +/* NOTE: this is a block-menu, needs 0 events, otherwise the menu closes */ +static uiBlock *socket_vector_menu(bContext *C, ARegion *ar, void *args_v) +{ + SocketVectorMenuArgs *args= (SocketVectorMenuArgs*)args_v; + uiBlock *block; + uiLayout *layout; + + block= uiBeginBlock(C, ar, "socket menu", UI_EMBOSS); + uiBlockSetFlag(block, UI_BLOCK_KEEP_OPEN); + + layout= uiLayoutColumn(uiBlockLayout(block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL, args->x, args->y+2, args->width, 20, U.uistyles.first), 0); + + uiItemR(layout, &args->ptr, "default_value", UI_ITEM_R_EXPAND, "", ICON_NULL); + + return block; +} + +static void node_draw_socket_button(bNodeTree *ntree, bNodeSocket *sock, const char *name, + uiBlock *block, int x, int y, int width, + uiButHandleFunc cb, void *arg1, void *arg2) +{ + uiBut *bt= NULL; + PointerRNA ptr; + int labelw; + SocketVectorMenuArgs *args; + + RNA_pointer_create(&ntree->id, &RNA_NodeSocket, sock, &ptr); + + switch (sock->type) { + case SOCK_VALUE: + bt=uiDefButR(block, NUM, B_NODE_EXEC, name, + x, y+1, width, 17, + &ptr, "default_value", 0, sock->ns.min, sock->ns.max, -1, -1, NULL); + if (cb) + uiButSetFunc(bt, cb, arg1, arg2); + break; + + case SOCK_VECTOR: + args= MEM_callocN(sizeof(SocketVectorMenuArgs), "SocketVectorMenuArgs"); + + args->ptr = ptr; + args->x = x; + args->y = y; + args->width = width; + args->cb = cb; + args->arg1 = arg1; + args->arg2 = arg2; + + uiDefBlockButN(block, socket_vector_menu, args, name, + x, y+1, width, 17, + ""); + break; + + case SOCK_RGBA: + labelw= width - 40; + + bt=uiDefButR(block, COL, B_NODE_EXEC, "", + x, y+2, (labelw>0 ? 40 : width), 15, + &ptr, "default_value", 0, sock->ns.min, sock->ns.max, -1, -1, NULL); + if (cb) + uiButSetFunc(bt, cb, arg1, arg2); + + if (name[0]!='\0' && labelw>0) + uiDefBut(block, LABEL, 0, name, + x + 40, y+2, labelw, 15, + NULL, 0, 0, 0, 0, ""); + break; + } +} + static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bNodeTree *ntree, bNode *node) { bNodeSocket *sock; - uiBut *bt; rctf *rct= &node->totr; - float /*slen,*/ iconofs; - int /*ofs,*/ color_id= node_get_colorid(node); + float iconofs; + int color_id= node_get_colorid(node); char showname[128]; /* 128 used below */ View2D *v2d = &ar->v2d; - PointerRNA ptr; /* hurmf... another candidate for callback, have to see how this works first */ if(node->id && node->block && snode->treetype==NTREE_SHADER) @@ -765,38 +846,10 @@ static void node_draw_basis(const bContext *C, ARegion *ar, SpaceNode *snode, bN if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) { socket_circle_draw(sock, NODE_SOCKSIZE); - RNA_pointer_create(&ntree->id, &RNA_NodeSocket, sock, &ptr); - if(node->block && sock->link==NULL) { - - if(sock->type==SOCK_VALUE) { - bt=uiDefButR(node->block, NUM, B_NODE_EXEC, sock->name, - (short)sock->locx+NODE_DYS, (short)(sock->locy)-9, (short)node->width-NODE_DY, 17, - &ptr, "default_value", 0, sock->ns.min, sock->ns.max, -1, -1, NULL); - uiButSetFunc(bt, node_sync_cb, snode, node); - } - else if(sock->type==SOCK_VECTOR) { - uiDefBlockBut(node->block, socket_vector_menu, sock, sock->name, - (short)sock->locx+NODE_DYS, (short)sock->locy-9, (short)node->width-NODE_DY, 17, - ""); - } - else if(node->block && sock->type==SOCK_RGBA) { - short labelw= (short)node->width-NODE_DY-40, width; - - if(labelw>0) width= 40; else width= (short)node->width-NODE_DY; - - bt=uiDefButR(node->block, COL, B_NODE_EXEC, "", - (short)sock->locx+NODE_DYS, (short)(sock->locy)-8, width, 15, - &ptr, "default_value", 0, sock->ns.min, sock->ns.max, -1, -1, NULL); - uiButSetFunc(bt, node_sync_cb, snode, node); - - if(labelw>0) uiDefBut(node->block, LABEL, 0, sock->name, - (short)(sock->locx+NODE_DYS) + 40, (short)sock->locy-8, labelw, 15, - NULL, 0, 0, 0, 0, ""); - } + node_draw_socket_button(ntree, sock, sock->name, node->block, sock->locx+NODE_DYS, sock->locy-NODE_DYS, node->width-NODE_DY, node_sync_cb, snode, node); } else { - uiDefBut(node->block, LABEL, 0, sock->name, (short)(sock->locx+7), (short)(sock->locy-9.0f), (short)(node->width-NODE_DY), NODE_DY, NULL, 0, 0, 0, 0, ""); } @@ -969,39 +1022,11 @@ static void node_draw_nodetree(const bContext *C, ARegion *ar, SpaceNode *snode, } } -/* fake links from groupnode to internal nodes */ -static void node_draw_group_links(View2D *v2d, SpaceNode *snode, bNode *gnode) +static void group_verify_cb(bContext *UNUSED(C), void *UNUSED(snode_v), void *ngroup_v) { - bNodeLink fakelink; - bNodeSocket *sock; - - glEnable(GL_BLEND); - glEnable(GL_LINE_SMOOTH); - - fakelink.tonode= fakelink.fromnode= gnode; - - for(sock= gnode->inputs.first; sock; sock= sock->next) { - if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) { - if(sock->tosock) { - fakelink.fromsock= sock; - fakelink.tosock= sock->tosock; - node_draw_link(v2d, snode, &fakelink); - } - } - } + bNodeTree *ngroup= (bNodeTree*)ngroup_v; - for(sock= gnode->outputs.first; sock; sock= sock->next) { - if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) { - if(sock->tosock) { - fakelink.tosock= sock; - fakelink.fromsock= sock->tosock; - node_draw_link(v2d, snode, &fakelink); - } - } - } - - glDisable(GL_BLEND); - glDisable(GL_LINE_SMOOTH); + nodeGroupVerify(ngroup); } /* groups are, on creation, centered around 0,0 */ @@ -1010,25 +1035,51 @@ static void node_draw_group(const bContext *C, ARegion *ar, SpaceNode *snode, bN bNodeTree *ngroup= (bNodeTree *)gnode->id; bNodeSocket *sock; rctf rect= gnode->totr; + int index; uiLayout *layout; PointerRNA ptr; + uiBut *bt; /* backdrop header */ glEnable(GL_BLEND); uiSetRoundBox(3); UI_ThemeColorShadeAlpha(TH_NODE_GROUP, 0, -70); - uiDrawBox(GL_POLYGON, rect.xmin, rect.ymax, rect.xmax, rect.ymax+26, BASIS_RAD); + uiDrawBox(GL_POLYGON, rect.xmin-NODE_GROUP_FRAME, rect.ymax, rect.xmax+NODE_GROUP_FRAME, rect.ymax+26, BASIS_RAD); /* backdrop body */ UI_ThemeColorShadeAlpha(TH_BACK, -8, -70); - uiSetRoundBox(12); + uiSetRoundBox(0); uiDrawBox(GL_POLYGON, rect.xmin, rect.ymin, rect.xmax, rect.ymax, BASIS_RAD); - - /* selection outline */ + + /* input column */ + UI_ThemeColorShadeAlpha(TH_BACK, 10, -50); + uiSetRoundBox(8); + uiDrawBox(GL_POLYGON, rect.xmin-NODE_GROUP_FRAME, rect.ymin, rect.xmin, rect.ymax, BASIS_RAD); + + /* output column */ + UI_ThemeColorShadeAlpha(TH_BACK, 10, -50); + uiSetRoundBox(4); + uiDrawBox(GL_POLYGON, rect.xmax, rect.ymin, rect.xmax+NODE_GROUP_FRAME, rect.ymax, BASIS_RAD); + + /* input column separator */ + glColor4ub(200, 200, 200, 140); + glBegin(GL_LINES); + glVertex2f(rect.xmin, rect.ymin); + glVertex2f(rect.xmin, rect.ymax); + glEnd(); + + /* output column separator */ + glColor4ub(200, 200, 200, 140); + glBegin(GL_LINES); + glVertex2f(rect.xmax, rect.ymin); + glVertex2f(rect.xmax, rect.ymax); + glEnd(); + + /* group node outline */ uiSetRoundBox(15); glColor4ub(200, 200, 200, 140); glEnable( GL_LINE_SMOOTH ); - uiDrawBox(GL_LINE_LOOP, rect.xmin, rect.ymin, rect.xmax, rect.ymax+26, BASIS_RAD); + uiDrawBox(GL_LINE_LOOP, rect.xmin-NODE_GROUP_FRAME, rect.ymin, rect.xmax+NODE_GROUP_FRAME, rect.ymax+26, BASIS_RAD); glDisable( GL_LINE_SMOOTH ); glDisable(GL_BLEND); @@ -1041,26 +1092,101 @@ static void node_draw_group(const bContext *C, ARegion *ar, SpaceNode *snode, bN uiTemplateIDBrowse(layout, (bContext*)C, &ptr, "node_tree", NULL, NULL, NULL); uiBlockLayoutResolve(gnode->block, NULL, NULL); - uiEndBlock(C, gnode->block); - uiDrawBlock(C, gnode->block); - gnode->block= NULL; - + /* draw the internal tree nodes and links */ + node_draw_nodetree(C, ar, snode, ngroup); - /* links from groupsockets to the internal nodes */ - node_draw_group_links(&ar->v2d, snode, gnode); - /* group sockets */ - for(sock= gnode->inputs.first; sock; sock= sock->next) - if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) - socket_circle_draw(sock, NODE_SOCKSIZE); - for(sock= gnode->outputs.first; sock; sock= sock->next) - if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) - socket_circle_draw(sock, NODE_SOCKSIZE); - - + for(sock=ngroup->inputs.first, index=0; sock; sock=sock->next, ++index) { + socket_circle_draw(sock, NODE_SOCKSIZE); + /* small hack to use socket_circle_draw function with offset */ + sock->locx -= NODE_GROUP_FRAME; + socket_circle_draw(sock, NODE_SOCKSIZE); + sock->locx += NODE_GROUP_FRAME; + + bt = uiDefBut(gnode->block, TEX, 0, "", + sock->locx-114, sock->locy+1, 72, NODE_DY, + sock->name, 0, 31, 0, 0, ""); + uiButSetFunc(bt, group_verify_cb, snode, ngroup); + + node_draw_socket_button(ngroup, sock, "", gnode->block, + sock->locx-114, sock->locy-NODE_DY, 72, + NULL, NULL, NULL); + + uiBlockSetDirection(gnode->block, UI_TOP); + uiBlockBeginAlign(gnode->block); + bt = uiDefIconButO(gnode->block, BUT, "NODE_OT_group_socket_move_up", 0, ICON_TRIA_UP, + sock->locx-40, sock->locy, 16, 16, ""); + if (!sock->prev) + uiButSetFlag(bt, UI_BUT_DISABLED); + RNA_int_set(uiButGetOperatorPtrRNA(bt), "index", index); + RNA_enum_set(uiButGetOperatorPtrRNA(bt), "in_out", SOCK_IN); + bt = uiDefIconButO(gnode->block, BUT, "NODE_OT_group_socket_move_down", 0, ICON_TRIA_DOWN, + sock->locx-40, sock->locy-16, 16, 16, ""); + if (!sock->next) + uiButSetFlag(bt, UI_BUT_DISABLED); + RNA_int_set(uiButGetOperatorPtrRNA(bt), "index", index); + RNA_enum_set(uiButGetOperatorPtrRNA(bt), "in_out", SOCK_IN); + uiBlockEndAlign(gnode->block); + uiBlockSetDirection(gnode->block, 0); + + uiBlockSetEmboss(gnode->block, UI_EMBOSSN); + bt = uiDefIconButO(gnode->block, BUT, "NODE_OT_group_socket_remove", 0, ICON_X, + sock->locx-22, sock->locy-8, 16, 16, ""); + RNA_int_set(uiButGetOperatorPtrRNA(bt), "index", index); + RNA_enum_set(uiButGetOperatorPtrRNA(bt), "in_out", SOCK_IN); + uiBlockSetEmboss(gnode->block, UI_EMBOSS); + } - /* and finally the whole tree */ - node_draw_nodetree(C, ar, snode, ngroup); + for(sock=ngroup->outputs.first, index=0; sock; sock=sock->next, ++index) { + socket_circle_draw(sock, NODE_SOCKSIZE); + /* small hack to use socket_circle_draw function with offset */ + sock->locx += NODE_GROUP_FRAME; + socket_circle_draw(sock, NODE_SOCKSIZE); + sock->locx -= NODE_GROUP_FRAME; + + uiBlockSetEmboss(gnode->block, UI_EMBOSSN); + bt = uiDefIconButO(gnode->block, BUT, "NODE_OT_group_socket_remove", 0, ICON_X, + sock->locx+6, sock->locy-8, 16, 16, ""); + RNA_int_set(uiButGetOperatorPtrRNA(bt), "index", index); + RNA_enum_set(uiButGetOperatorPtrRNA(bt), "in_out", SOCK_OUT); + uiBlockSetEmboss(gnode->block, UI_EMBOSS); + + uiBlockSetDirection(gnode->block, UI_TOP); + uiBlockBeginAlign(gnode->block); + bt = uiDefIconButO(gnode->block, BUT, "NODE_OT_group_socket_move_up", 0, ICON_TRIA_UP, + sock->locx+24, sock->locy, 16, 16, ""); + if (!sock->prev) + uiButSetFlag(bt, UI_BUT_DISABLED); + RNA_int_set(uiButGetOperatorPtrRNA(bt), "index", index); + RNA_enum_set(uiButGetOperatorPtrRNA(bt), "in_out", SOCK_OUT); + bt = uiDefIconButO(gnode->block, BUT, "NODE_OT_group_socket_move_down", 0, ICON_TRIA_DOWN, + sock->locx+24, sock->locy-16, 16, 16, ""); + if (!sock->next) + uiButSetFlag(bt, UI_BUT_DISABLED); + RNA_int_set(uiButGetOperatorPtrRNA(bt), "index", index); + RNA_enum_set(uiButGetOperatorPtrRNA(bt), "in_out", SOCK_OUT); + uiBlockEndAlign(gnode->block); + uiBlockSetDirection(gnode->block, 0); + + if (sock->link) { + bt = uiDefBut(gnode->block, TEX, 0, "", + sock->locx+42, sock->locy-NODE_DYS+1, 72, NODE_DY, + sock->name, 0, 31, 0, 0, ""); + uiButSetFunc(bt, group_verify_cb, snode, ngroup); + } + else { + bt = uiDefBut(gnode->block, TEX, 0, "", + sock->locx+42, sock->locy+1, 72, NODE_DY, + sock->name, 0, 31, 0, 0, ""); + uiButSetFunc(bt, group_verify_cb, snode, ngroup); + + node_draw_socket_button(ngroup, sock, "", gnode->block, sock->locx+42, sock->locy-NODE_DY, 72, NULL, NULL, NULL); + } + } + + uiEndBlock(C, gnode->block); + uiDrawBlock(C, gnode->block); + gnode->block= NULL; } void drawnodespace(const bContext *C, ARegion *ar, View2D *v2d) diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index 385dfbcd9a8..8086ce3621a 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -77,10 +77,15 @@ #include "IMB_imbuf.h" +#include "RNA_enum_types.h" + #include "node_intern.h" -#define SOCK_IN 1 -#define SOCK_OUT 2 +static EnumPropertyItem socket_in_out_items[] = { + { SOCK_IN, "IN", 0, "In", "" }, + { SOCK_OUT, "OUT", 0, "Out", "" }, + { 0, NULL, 0, NULL, NULL} +}; /* ***************** composite job manager ********************** */ @@ -550,7 +555,7 @@ void node_tree_verify_groups(bNodeTree *nodetree) /* does all materials */ if(gnode) - nodeVerifyGroup((bNodeTree *)gnode->id); + nodeGroupVerify((bNodeTree *)gnode->id); } @@ -634,6 +639,241 @@ void NODE_OT_group_edit(wmOperatorType *ot) ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; } +/* ***************** Add Group Socket operator ************* */ + +static int node_group_socket_add_exec(bContext *C, wmOperator *op) +{ + SpaceNode *snode = CTX_wm_space_node(C); + int in_out= -1; + char name[32]= ""; + int type= SOCK_VALUE; + bNodeTree *ngroup= snode->edittree; + bNodeSocket *sock; + + ED_preview_kill_jobs(C); + + if (RNA_property_is_set(op->ptr, "name")) + RNA_string_get(op->ptr, "name", name); + + if (RNA_property_is_set(op->ptr, "type")) + type = RNA_enum_get(op->ptr, "type"); + + if (RNA_property_is_set(op->ptr, "in_out")) + in_out = RNA_enum_get(op->ptr, "in_out"); + else + return OPERATOR_CANCELLED; + + sock = nodeGroupAddSocket(ngroup, name, type, in_out); + + node_tree_verify_groups(snode->nodetree); + + snode_notify(C, snode); + + return OPERATOR_FINISHED; +} + +void NODE_OT_group_socket_add(wmOperatorType *ot) +{ + /* identifiers */ + ot->name = "Add Group Socket"; + ot->description = "Add node group socket"; + ot->idname = "NODE_OT_group_socket_add"; + + /* api callbacks */ + ot->exec = node_group_socket_add_exec; + ot->poll = ED_operator_node_active; + + /* flags */ + ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; + + RNA_def_enum(ot->srna, "in_out", socket_in_out_items, SOCK_IN, "Socket Type", "Input or Output"); + RNA_def_string(ot->srna, "name", "", 32, "Name", "Group socket name"); + RNA_def_enum(ot->srna, "type", node_socket_type_items, SOCK_VALUE, "Type", "Type of the group socket"); +} + +/* ***************** Remove Group Socket operator ************* */ + +static int node_group_socket_remove_exec(bContext *C, wmOperator *op) +{ + SpaceNode *snode = CTX_wm_space_node(C); + int index= -1; + int in_out= -1; + bNodeTree *ngroup= snode->edittree; + bNodeSocket *sock; + + ED_preview_kill_jobs(C); + + if (RNA_property_is_set(op->ptr, "index")) + index = RNA_int_get(op->ptr, "index"); + else + return OPERATOR_CANCELLED; + + if (RNA_property_is_set(op->ptr, "in_out")) + in_out = RNA_enum_get(op->ptr, "in_out"); + else + return OPERATOR_CANCELLED; + + sock = (bNodeSocket*)BLI_findlink(in_out==SOCK_IN ? &ngroup->inputs : &ngroup->outputs, index); + if (sock) { + nodeGroupRemoveSocket(ngroup, sock, in_out); + node_tree_verify_groups(snode->nodetree); + + snode_notify(C, snode); + } + + return OPERATOR_FINISHED; +} + +void NODE_OT_group_socket_remove(wmOperatorType *ot) +{ + /* identifiers */ + ot->name = "Remove Group Socket"; + ot->description = "Removed node group socket"; + ot->idname = "NODE_OT_group_socket_remove"; + + /* api callbacks */ + ot->exec = node_group_socket_remove_exec; + ot->poll = ED_operator_node_active; + + /* flags */ + ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; + + RNA_def_int(ot->srna, "index", 0, 0, INT_MAX, "Index", "", 0, INT_MAX); + RNA_def_enum(ot->srna, "in_out", socket_in_out_items, SOCK_IN, "Socket Type", "Input or Output"); +} + +/* ***************** Move Group Socket Up operator ************* */ + +static int node_group_socket_move_up_exec(bContext *C, wmOperator *op) +{ + SpaceNode *snode = CTX_wm_space_node(C); + int index= -1; + int in_out= -1; + bNodeTree *ngroup= snode->edittree; + bNodeSocket *sock, *prev; + + ED_preview_kill_jobs(C); + + if (RNA_property_is_set(op->ptr, "index")) + index = RNA_int_get(op->ptr, "index"); + else + return OPERATOR_CANCELLED; + + if (RNA_property_is_set(op->ptr, "in_out")) + in_out = RNA_enum_get(op->ptr, "in_out"); + else + return OPERATOR_CANCELLED; + + /* swap */ + if (in_out==SOCK_IN) { + sock = (bNodeSocket*)BLI_findlink(&ngroup->inputs, index); + prev = sock->prev; + /* can't move up the first socket */ + if (!prev) + return OPERATOR_CANCELLED; + BLI_remlink(&ngroup->inputs, sock); + BLI_insertlinkbefore(&ngroup->inputs, prev, sock); + } + else if (in_out==SOCK_OUT) { + sock = (bNodeSocket*)BLI_findlink(&ngroup->outputs, index); + prev = sock->prev; + /* can't move up the first socket */ + if (!prev) + return OPERATOR_CANCELLED; + BLI_remlink(&ngroup->outputs, sock); + BLI_insertlinkbefore(&ngroup->outputs, prev, sock); + } + node_tree_verify_groups(snode->nodetree); + + snode_notify(C, snode); + + return OPERATOR_FINISHED; +} + +void NODE_OT_group_socket_move_up(wmOperatorType *ot) +{ + /* identifiers */ + ot->name = "Move Group Socket Up"; + ot->description = "Move up node group socket"; + ot->idname = "NODE_OT_group_socket_move_up"; + + /* api callbacks */ + ot->exec = node_group_socket_move_up_exec; + ot->poll = ED_operator_node_active; + + /* flags */ + ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; + + RNA_def_int(ot->srna, "index", 0, 0, INT_MAX, "Index", "", 0, INT_MAX); + RNA_def_enum(ot->srna, "in_out", socket_in_out_items, SOCK_IN, "Socket Type", "Input or Output"); +} + +/* ***************** Move Group Socket Up operator ************* */ + +static int node_group_socket_move_down_exec(bContext *C, wmOperator *op) +{ + SpaceNode *snode = CTX_wm_space_node(C); + int index= -1; + int in_out= -1; + bNodeTree *ngroup= snode->edittree; + bNodeSocket *sock, *next; + + ED_preview_kill_jobs(C); + + if (RNA_property_is_set(op->ptr, "index")) + index = RNA_int_get(op->ptr, "index"); + else + return OPERATOR_CANCELLED; + + if (RNA_property_is_set(op->ptr, "in_out")) + in_out = RNA_enum_get(op->ptr, "in_out"); + else + return OPERATOR_CANCELLED; + + /* swap */ + if (in_out==SOCK_IN) { + sock = (bNodeSocket*)BLI_findlink(&ngroup->inputs, index); + next = sock->next; + /* can't move down the last socket */ + if (!next) + return OPERATOR_CANCELLED; + BLI_remlink(&ngroup->inputs, sock); + BLI_insertlinkafter(&ngroup->inputs, next, sock); + } + else if (in_out==SOCK_OUT) { + sock = (bNodeSocket*)BLI_findlink(&ngroup->outputs, index); + next = sock->next; + /* can't move down the last socket */ + if (!next) + return OPERATOR_CANCELLED; + BLI_remlink(&ngroup->outputs, sock); + BLI_insertlinkafter(&ngroup->outputs, next, sock); + } + node_tree_verify_groups(snode->nodetree); + + snode_notify(C, snode); + + return OPERATOR_FINISHED; +} + +void NODE_OT_group_socket_move_down(wmOperatorType *ot) +{ + /* identifiers */ + ot->name = "Move Group Socket Down"; + ot->description = "Move down node group socket"; + ot->idname = "NODE_OT_group_socket_move_down"; + + /* api callbacks */ + ot->exec = node_group_socket_move_down_exec; + ot->poll = ED_operator_node_active; + + /* flags */ + ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO; + + RNA_def_int(ot->srna, "index", 0, 0, INT_MAX, "Index", "", 0, INT_MAX); + RNA_def_enum(ot->srna, "in_out", socket_in_out_items, SOCK_IN, "Socket Type", "Input or Output"); +} + /* ******************** Ungroup operator ********************** */ static int node_group_ungroup_exec(bContext *C, wmOperator *op) @@ -1433,6 +1673,33 @@ static int find_indicated_socket(SpaceNode *snode, bNode **nodep, bNodeSocket ** } } } + + /* check group sockets + * NB: using ngroup->outputs as input sockets and vice versa here! + */ + if(in_out & SOCK_IN) { + for(sock= snode->edittree->outputs.first; sock; sock= sock->next) { + if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) { + if(BLI_in_rctf(&rect, sock->locx, sock->locy)) { + *nodep= NULL; /* NULL node pointer indicates group socket */ + *sockp= sock; + return 1; + } + } + } + } + if(in_out & SOCK_OUT) { + for(sock= snode->edittree->inputs.first; sock; sock= sock->next) { + if(!(sock->flag & (SOCK_HIDDEN|SOCK_UNAVAIL))) { + if(BLI_in_rctf(&rect, sock->locx, sock->locy)) { + *nodep= NULL; /* NULL node pointer indicates group socket */ + *sockp= sock; + return 1; + } + } + } + } + return 0; } @@ -1473,6 +1740,16 @@ static int node_socket_hilights(SpaceNode *snode, int in_out) return redraw; } +static int outside_group_rect(SpaceNode *snode) +{ + bNode *gnode= node_tree_get_editgroup(snode->nodetree); + if (gnode) { + return (snode->mx < gnode->totr.xmin || snode->mx >= gnode->totr.xmax + || snode->my < gnode->totr.ymin || snode->my >= gnode->totr.ymax); + } + return 0; +} + /* ****************** Add *********************** */ @@ -1701,7 +1978,7 @@ static int node_duplicate_exec(bContext *C, wmOperator *UNUSED(op)) last = ntree->nodes.last; for(node= ntree->nodes.first; node; node= node->next) { if(node->flag & SELECT) { - newnode = nodeCopyNode(ntree, node, 1); + newnode = nodeCopyNode(ntree, node); /* deselect old node, select the copy instead */ node->flag &= ~(NODE_SELECT|NODE_ACTIVE); @@ -1767,19 +2044,24 @@ static void node_remove_extra_links(SpaceNode *snode, bNodeSocket *tsock, bNodeL break; } if(tlink) { - /* is there a free input socket with same type? */ - for(sock= tlink->tonode->inputs.first; sock; sock= sock->next) { - if(sock->type==tlink->fromsock->type) - if(nodeCountSocketLinks(snode->edittree, sock) < sock->limit) - break; - } - if(sock) { - tlink->tosock= sock; - sock->flag &= ~SOCK_HIDDEN; + /* try to move the existing link to the next available socket */ + if (tlink->tonode) { + /* is there a free input socket with same type? */ + for(sock= tlink->tonode->inputs.first; sock; sock= sock->next) { + if(sock->type==tlink->fromsock->type) + if(nodeCountSocketLinks(snode->edittree, sock) < sock->limit) + break; + } + if(sock) { + tlink->tosock= sock; + sock->flag &= ~SOCK_HIDDEN; + } + else { + nodeRemLink(snode->edittree, tlink); + } } - else { + else nodeRemLink(snode->edittree, tlink); - } } } } @@ -1810,7 +2092,7 @@ static int node_link_modal(bContext *C, wmOperator *op, wmEvent *event) if(in_out==SOCK_OUT) { if(find_indicated_socket(snode, &tnode, &tsock, SOCK_IN)) { if(nodeFindLink(snode->edittree, sock, tsock)==NULL) { - if(tnode!=node && link->tonode!=tnode && link->tosock!= tsock) { + if( link->tosock!= tsock && (!tnode || (tnode!=node && link->tonode!=tnode)) ) { link->tonode= tnode; link->tosock= tsock; ntreeSolveOrder(snode->edittree); /* for interactive red line warning */ @@ -1826,7 +2108,7 @@ static int node_link_modal(bContext *C, wmOperator *op, wmEvent *event) if(find_indicated_socket(snode, &tnode, &tsock, SOCK_OUT)) { if(nodeFindLink(snode->edittree, sock, tsock)==NULL) { if(nodeCountSocketLinks(snode->edittree, tsock) < tsock->limit) { - if(tnode!=node && link->fromnode!=tnode && link->fromsock!= tsock) { + if( link->fromsock!= tsock && (!tnode || (tnode!=node && link->fromnode!=tnode)) ) { link->fromnode= tnode; link->fromsock= tsock; ntreeSolveOrder(snode->edittree); /* for interactive red line warning */ @@ -1847,19 +2129,28 @@ static int node_link_modal(bContext *C, wmOperator *op, wmEvent *event) case LEFTMOUSE: case RIGHTMOUSE: case MIDDLEMOUSE: - - /* remove link? */ - if(link->tonode==NULL || link->fromnode==NULL) { - nodeRemLink(snode->edittree, link); - } - else { + if(link->tosock && link->fromsock) { /* send changed events for original tonode and new */ - if(link->tonode) + if(link->tonode) NodeTagChanged(snode->edittree, link->tonode); /* we might need to remove a link */ - if(in_out==SOCK_OUT) node_remove_extra_links(snode, link->tosock, link); + if(in_out==SOCK_OUT) + node_remove_extra_links(snode, link->tosock, link); } + else if (outside_group_rect(snode) && (link->tonode || link->fromnode)) { + /* automatically add new group socket */ + if (link->tonode && link->tosock) { + link->fromsock = nodeGroupExposeSocket(snode->edittree, link->tosock, SOCK_IN); + link->fromnode = NULL; + } + else if (link->fromnode && link->fromsock) { + link->tosock = nodeGroupExposeSocket(snode->edittree, link->fromsock, SOCK_OUT); + link->tonode = NULL; + } + } + else + nodeRemLink(snode->edittree, link); ntreeSolveOrder(snode->edittree); node_tree_verify_groups(snode->nodetree); diff --git a/source/blender/editors/space_node/node_header.c b/source/blender/editors/space_node/node_header.c index 147a0825229..4d4896d65a0 100644 --- a/source/blender/editors/space_node/node_header.c +++ b/source/blender/editors/space_node/node_header.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_node/node_intern.h b/source/blender/editors/space_node/node_intern.h index eb7e1209801..31eb7a7bfd2 100644 --- a/source/blender/editors/space_node/node_intern.h +++ b/source/blender/editors/space_node/node_intern.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -103,6 +103,10 @@ void NODE_OT_links_cut(struct wmOperatorType *ot); void NODE_OT_group_make(struct wmOperatorType *ot); void NODE_OT_group_ungroup(struct wmOperatorType *ot); void NODE_OT_group_edit(struct wmOperatorType *ot); +void NODE_OT_group_socket_add(struct wmOperatorType *ot); +void NODE_OT_group_socket_remove(struct wmOperatorType *ot); +void NODE_OT_group_socket_move_up(struct wmOperatorType *ot); +void NODE_OT_group_socket_move_down(struct wmOperatorType *ot); void NODE_OT_mute_toggle(struct wmOperatorType *ot); void NODE_OT_hide_toggle(struct wmOperatorType *ot); diff --git a/source/blender/editors/space_node/node_ops.c b/source/blender/editors/space_node/node_ops.c index 9c2b6f0274d..e563ae4e3f4 100644 --- a/source/blender/editors/space_node/node_ops.c +++ b/source/blender/editors/space_node/node_ops.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -74,6 +74,10 @@ void node_operatortypes(void) WM_operatortype_append(NODE_OT_group_make); WM_operatortype_append(NODE_OT_group_ungroup); WM_operatortype_append(NODE_OT_group_edit); + WM_operatortype_append(NODE_OT_group_socket_add); + WM_operatortype_append(NODE_OT_group_socket_remove); + WM_operatortype_append(NODE_OT_group_socket_move_up); + WM_operatortype_append(NODE_OT_group_socket_move_down); WM_operatortype_append(NODE_OT_link_viewer); diff --git a/source/blender/editors/space_node/node_select.c b/source/blender/editors/space_node/node_select.c index b53ac07aab3..bcc69c1f260 100644 --- a/source/blender/editors/space_node/node_select.c +++ b/source/blender/editors/space_node/node_select.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -288,7 +288,7 @@ static int node_select_linked_to_exec(bContext *C, wmOperator *UNUSED(op)) node->flag &= ~NODE_TEST; for (link=snode->edittree->links.first; link; link=link->next) { - if (link->fromnode->flag & NODE_SELECT) + if (link->fromnode && link->tonode && (link->fromnode->flag & NODE_SELECT)) link->tonode->flag |= NODE_TEST; } @@ -328,7 +328,7 @@ static int node_select_linked_from_exec(bContext *C, wmOperator *UNUSED(op)) node->flag &= ~NODE_TEST; for(link=snode->edittree->links.first; link; link=link->next) { - if(link->tonode->flag & NODE_SELECT) + if(link->fromnode && link->tonode && (link->tonode->flag & NODE_SELECT)) link->fromnode->flag |= NODE_TEST; } diff --git a/source/blender/editors/space_node/node_state.c b/source/blender/editors/space_node/node_state.c index 332080f023c..abb3d83d336 100644 --- a/source/blender/editors/space_node/node_state.c +++ b/source/blender/editors/space_node/node_state.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c index db4d02a776c..4bccd14bb42 100644 --- a/source/blender/editors/space_node/space_node.c +++ b/source/blender/editors/space_node/space_node.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_outliner/CMakeLists.txt b/source/blender/editors/space_outliner/CMakeLists.txt index 6f3cafd81f8..6dc5792ad0c 100644 --- a/source/blender/editors/space_outliner/CMakeLists.txt +++ b/source/blender/editors/space_outliner/CMakeLists.txt @@ -22,6 +22,7 @@ set(INC ../include ../../blenkernel + ../../blenloader ../../blenlib ../../imbuf ../../makesdna diff --git a/source/blender/editors/space_outliner/SConscript b/source/blender/editors/space_outliner/SConscript index a7f487a4149..ab0b8582d33 100644 --- a/source/blender/editors/space_outliner/SConscript +++ b/source/blender/editors/space_outliner/SConscript @@ -4,7 +4,7 @@ Import ('env') sources = env.Glob('*.c') incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf' -incs += ' ../../windowmanager #/intern/guardedalloc ../../makesrna' +incs += ' ../../windowmanager #/intern/guardedalloc ../../makesrna ../../blenloader' incs += ' #/extern/glew/include' env.BlenderLib ( 'bf_editors_space_outliner', sources, Split(incs), [], libtype=['core'], priority=[60] ) diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c index b0b89716222..60e4f29b2ba 100644 --- a/source/blender/editors/space_outliner/outliner.c +++ b/source/blender/editors/space_outliner/outliner.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_outliner/outliner_intern.h b/source/blender/editors/space_outliner/outliner_intern.h index cf29bfb4371..5f9165a6a31 100644 --- a/source/blender/editors/space_outliner/outliner_intern.h +++ b/source/blender/editors/space_outliner/outliner_intern.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_outliner/outliner_ops.c b/source/blender/editors/space_outliner/outliner_ops.c index f7dd03ec545..da1b831aefc 100644 --- a/source/blender/editors/space_outliner/outliner_ops.c +++ b/source/blender/editors/space_outliner/outliner_ops.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_outliner/space_outliner.c b/source/blender/editors/space_outliner/space_outliner.c index 66404287693..a4900eb919b 100644 --- a/source/blender/editors/space_outliner/space_outliner.c +++ b/source/blender/editors/space_outliner/space_outliner.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_script/CMakeLists.txt b/source/blender/editors/space_script/CMakeLists.txt index 1427e814b41..165a43568e4 100644 --- a/source/blender/editors/space_script/CMakeLists.txt +++ b/source/blender/editors/space_script/CMakeLists.txt @@ -22,6 +22,7 @@ set(INC ../include ../../blenkernel + ../../blenloader ../../blenlib ../../makesdna ../../makesrna diff --git a/source/blender/editors/space_script/SConscript b/source/blender/editors/space_script/SConscript index 8c75b999bc0..c30e204f6f4 100644 --- a/source/blender/editors/space_script/SConscript +++ b/source/blender/editors/space_script/SConscript @@ -5,7 +5,7 @@ sources = env.Glob('*.c') incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf' incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include' -incs += ' ../../makesrna' +incs += ' ../../makesrna ../../blenloader' incs += ' ../../python' defs = [] diff --git a/source/blender/editors/space_script/script_edit.c b/source/blender/editors/space_script/script_edit.c index 3da5b48db8e..aff9774b2a9 100644 --- a/source/blender/editors/space_script/script_edit.c +++ b/source/blender/editors/space_script/script_edit.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_script/script_header.c b/source/blender/editors/space_script/script_header.c index 35f3ad0596f..278b07408cb 100644 --- a/source/blender/editors/space_script/script_header.c +++ b/source/blender/editors/space_script/script_header.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_script/script_intern.h b/source/blender/editors/space_script/script_intern.h index ed625bb8ec6..28d80b76705 100644 --- a/source/blender/editors/space_script/script_intern.h +++ b/source/blender/editors/space_script/script_intern.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_script/script_ops.c b/source/blender/editors/space_script/script_ops.c index a52ffbd0808..c0b4979e80e 100644 --- a/source/blender/editors/space_script/script_ops.c +++ b/source/blender/editors/space_script/script_ops.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_script/space_script.c b/source/blender/editors/space_script/space_script.c index 502b01c366a..64e0307aec9 100644 --- a/source/blender/editors/space_script/space_script.c +++ b/source/blender/editors/space_script/space_script.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_sequencer/CMakeLists.txt b/source/blender/editors/space_sequencer/CMakeLists.txt index 9772361e367..d162ac2f4fc 100644 --- a/source/blender/editors/space_sequencer/CMakeLists.txt +++ b/source/blender/editors/space_sequencer/CMakeLists.txt @@ -22,6 +22,7 @@ set(INC ../include ../../blenkernel + ../../blenloader ../../blenlib ../../imbuf ../../makesdna diff --git a/source/blender/editors/space_sequencer/SConscript b/source/blender/editors/space_sequencer/SConscript index 7a3fb6982ef..65bbf900556 100644 --- a/source/blender/editors/space_sequencer/SConscript +++ b/source/blender/editors/space_sequencer/SConscript @@ -5,7 +5,7 @@ sources = env.Glob('*.c') incs = '../include ../../blenlib ../../blenkernel ../../blenfont ../../makesdna ../../imbuf' incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include' -incs += ' ../../makesrna' +incs += ' ../../makesrna ../../blenloader' incs += ' #/intern/audaspace/intern' env.BlenderLib ( 'bf_editors_space_sequencer', sources, Split(incs), [], libtype=['core'], priority=[100] ) diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c index 24142e0b898..9e5f6a1d065 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.c +++ b/source/blender/editors/space_sequencer/sequencer_add.c @@ -1,4 +1,4 @@ -/** +/* * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_sequencer/sequencer_buttons.c b/source/blender/editors/space_sequencer/sequencer_buttons.c index ee0a5d69113..956dfda1764 100644 --- a/source/blender/editors/space_sequencer/sequencer_buttons.c +++ b/source/blender/editors/space_sequencer/sequencer_buttons.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index 8b3240e91c8..b344077a69a 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index 39a81e7481e..b0547ff9994 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_sequencer/sequencer_intern.h b/source/blender/editors/space_sequencer/sequencer_intern.h index 3e47368ef3c..e0266e88bc9 100644 --- a/source/blender/editors/space_sequencer/sequencer_intern.h +++ b/source/blender/editors/space_sequencer/sequencer_intern.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_sequencer/sequencer_scopes.c b/source/blender/editors/space_sequencer/sequencer_scopes.c index b8b34eacdc0..87ad27403da 100644 --- a/source/blender/editors/space_sequencer/sequencer_scopes.c +++ b/source/blender/editors/space_sequencer/sequencer_scopes.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c index 3b4312cda2b..7a6f5f0890b 100644 --- a/source/blender/editors/space_sequencer/sequencer_select.c +++ b/source/blender/editors/space_sequencer/sequencer_select.c @@ -1,4 +1,4 @@ -/** +/* * * ***** BEGIN GPL LICENSE BLOCK ***** * diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c index 5323c3d064e..4816de46511 100644 --- a/source/blender/editors/space_sequencer/space_sequencer.c +++ b/source/blender/editors/space_sequencer/space_sequencer.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_sound/CMakeLists.txt b/source/blender/editors/space_sound/CMakeLists.txt index df148e0fd91..d0054836381 100644 --- a/source/blender/editors/space_sound/CMakeLists.txt +++ b/source/blender/editors/space_sound/CMakeLists.txt @@ -22,6 +22,7 @@ set(INC ../include ../../blenkernel + ../../blenloader ../../blenlib ../../makesdna ../../makesrna diff --git a/source/blender/editors/space_sound/SConscript b/source/blender/editors/space_sound/SConscript index e4fffb53e4c..d76fb7939ea 100644 --- a/source/blender/editors/space_sound/SConscript +++ b/source/blender/editors/space_sound/SConscript @@ -4,6 +4,6 @@ Import ('env') sources = env.Glob('*.c') incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../makesrna ../../imbuf' -incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include' +incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include ../../blenloader' env.BlenderLib ( 'bf_editors_space_sound', sources, Split(incs), [], libtype=['core'], priority=[75] ) diff --git a/source/blender/editors/space_sound/sound_header.c b/source/blender/editors/space_sound/sound_header.c index 60bf0775f5e..a78990d74ff 100644 --- a/source/blender/editors/space_sound/sound_header.c +++ b/source/blender/editors/space_sound/sound_header.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_sound/sound_intern.h b/source/blender/editors/space_sound/sound_intern.h index 7117e7d6df9..485876e20db 100644 --- a/source/blender/editors/space_sound/sound_intern.h +++ b/source/blender/editors/space_sound/sound_intern.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_sound/space_sound.c b/source/blender/editors/space_sound/space_sound.c index 4ae452850a7..8218ce09ad8 100644 --- a/source/blender/editors/space_sound/space_sound.c +++ b/source/blender/editors/space_sound/space_sound.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_text/CMakeLists.txt b/source/blender/editors/space_text/CMakeLists.txt index 8c18630ab7d..21481dc6543 100644 --- a/source/blender/editors/space_text/CMakeLists.txt +++ b/source/blender/editors/space_text/CMakeLists.txt @@ -23,6 +23,7 @@ set(INC ../include ../../blenfont ../../blenkernel + ../../blenloader ../../blenlib ../../makesdna ../../makesrna diff --git a/source/blender/editors/space_text/SConscript b/source/blender/editors/space_text/SConscript index 6d2816b7834..6ad6427f1d3 100644 --- a/source/blender/editors/space_text/SConscript +++ b/source/blender/editors/space_text/SConscript @@ -5,7 +5,7 @@ sources = env.Glob('*.c') defs = [] incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf' incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include' -incs += ' ../../python ../../makesrna ../../blenfont' +incs += ' ../../python ../../makesrna ../../blenfont ../../blenloader' if env['WITH_BF_PYTHON']: defs.append('WITH_PYTHON') diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c index 8ed49b5945d..93240d3f318 100644 --- a/source/blender/editors/space_text/space_text.c +++ b/source/blender/editors/space_text/space_text.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c index b3e6920aa29..c047d99c894 100644 --- a/source/blender/editors/space_text/text_draw.c +++ b/source/blender/editors/space_text/text_draw.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_text/text_header.c b/source/blender/editors/space_text/text_header.c index 3b04b056f4e..8e209365c0c 100644 --- a/source/blender/editors/space_text/text_header.c +++ b/source/blender/editors/space_text/text_header.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_text/text_intern.h b/source/blender/editors/space_text/text_intern.h index f18a3245f9b..c8e973811e2 100644 --- a/source/blender/editors/space_text/text_intern.h +++ b/source/blender/editors/space_text/text_intern.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index d8cbe93012d..effe2d6be1a 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -565,6 +565,35 @@ static int run_script_poll(bContext *C) return (CTX_data_edit_text(C) != NULL); } +static int run_script(bContext *C, ReportList *reports) +{ + Text *text= CTX_data_edit_text(C); + const short is_live= (reports == NULL); + + /* only for comparison */ + void *curl_prev= text->curl; + int curc_prev= text->curc; + + if (BPY_text_exec(C, text, reports, !is_live)) { + if(is_live) { + /* for nice live updates */ + WM_event_add_notifier(C, NC_WINDOW|NA_EDITED, NULL); + } + return OPERATOR_FINISHED; + } + + /* Dont report error messages while live editing */ + if(!is_live) { + if(text->curl != curl_prev || curc_prev != text->curc) { + text_update_cursor_moved(C); + WM_event_add_notifier(C, NC_TEXT|NA_EDITED, text); + } + + BKE_report(reports, RPT_ERROR, "Python script fail, look in the console for now..."); + } + return OPERATOR_CANCELLED; +} + static int run_script_exec(bContext *C, wmOperator *op) { #ifndef WITH_PYTHON @@ -574,17 +603,7 @@ static int run_script_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; #else - Text *text= CTX_data_edit_text(C); - SpaceText *st= CTX_wm_space_text(C); - - if (BPY_text_exec(C, text, op->reports)) - return OPERATOR_FINISHED; - - /* Dont report error messages while live editing */ - if(!(st && st->live_edit)) - BKE_report(op->reports, RPT_ERROR, "Python script fail, look in the console for now..."); - - return OPERATOR_CANCELLED; + return run_script(C, op->reports); #endif } @@ -767,7 +786,7 @@ static int paste_exec(bContext *C, wmOperator *op) /* run the script while editing, evil but useful */ if(CTX_wm_space_text(C)->live_edit) - run_script_exec(C, op); + run_script(C, NULL); return OPERATOR_FINISHED; } @@ -824,7 +843,7 @@ void TEXT_OT_copy(wmOperatorType *ot) /******************* cut operator *********************/ -static int cut_exec(bContext *C, wmOperator *op) +static int cut_exec(bContext *C, wmOperator *UNUSED(op)) { Text *text= CTX_data_edit_text(C); @@ -838,7 +857,7 @@ static int cut_exec(bContext *C, wmOperator *op) /* run the script while editing, evil but useful */ if(CTX_wm_space_text(C)->live_edit) - run_script_exec(C, op); + run_script(C, NULL); return OPERATOR_FINISHED; } @@ -1974,7 +1993,7 @@ static int delete_exec(bContext *C, wmOperator *op) /* run the script while editing, evil but useful */ if(CTX_wm_space_text(C)->live_edit) - run_script_exec(C, op); + run_script(C, NULL); return OPERATOR_FINISHED; } @@ -2767,7 +2786,7 @@ static int insert_invoke(bContext *C, wmOperator *op, wmEvent *event) /* run the script while editing, evil but useful */ if(ret==OPERATOR_FINISHED && CTX_wm_space_text(C)->live_edit) - run_script_exec(C, op); + run_script(C, NULL); return ret; } diff --git a/source/blender/editors/space_text/text_python.c b/source/blender/editors/space_text/text_python.c index a0d3264aa0d..b60a6a1abe4 100644 --- a/source/blender/editors/space_text/text_python.c +++ b/source/blender/editors/space_text/text_python.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_time/CMakeLists.txt b/source/blender/editors/space_time/CMakeLists.txt index d3f0fccd19a..c8727084548 100644 --- a/source/blender/editors/space_time/CMakeLists.txt +++ b/source/blender/editors/space_time/CMakeLists.txt @@ -22,6 +22,7 @@ set(INC ../include ../../blenkernel + ../../blenloader ../../blenlib ../../makesdna ../../makesrna diff --git a/source/blender/editors/space_time/SConscript b/source/blender/editors/space_time/SConscript index eb3a43a87b7..c08339ba692 100644 --- a/source/blender/editors/space_time/SConscript +++ b/source/blender/editors/space_time/SConscript @@ -5,6 +5,6 @@ sources = env.Glob('*.c') incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf' incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include' -incs += ' ../../makesrna' +incs += ' ../../makesrna ../../blenloader' env.BlenderLib ( 'bf_editors_space_time', sources, Split(incs), [], libtype=['core'], priority=[65] ) diff --git a/source/blender/editors/space_time/space_time.c b/source/blender/editors/space_time/space_time.c index f879b2b996d..65902c692c4 100644 --- a/source/blender/editors/space_time/space_time.c +++ b/source/blender/editors/space_time/space_time.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -638,7 +638,7 @@ static SpaceLink *time_duplicate(SpaceLink *sl) SpaceTime *stime= (SpaceTime *)sl; SpaceTime *stimen= MEM_dupallocN(stime); - time_cache_free(stimen); + stimen->caches.first = stimen->caches.last = NULL; return (SpaceLink *)stimen; } diff --git a/source/blender/editors/space_time/time_intern.h b/source/blender/editors/space_time/time_intern.h index 31164d0c27a..f6faeb8ffda 100644 --- a/source/blender/editors/space_time/time_intern.h +++ b/source/blender/editors/space_time/time_intern.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_time/time_ops.c b/source/blender/editors/space_time/time_ops.c index 167eabcdd08..3abee9df5a0 100644 --- a/source/blender/editors/space_time/time_ops.c +++ b/source/blender/editors/space_time/time_ops.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_userpref/CMakeLists.txt b/source/blender/editors/space_userpref/CMakeLists.txt index 1ea1806fb95..68fe9d3e04c 100644 --- a/source/blender/editors/space_userpref/CMakeLists.txt +++ b/source/blender/editors/space_userpref/CMakeLists.txt @@ -22,6 +22,7 @@ set(INC ../include ../../blenkernel + ../../blenloader ../../blenlib ../../makesdna ../../makesrna diff --git a/source/blender/editors/space_userpref/SConscript b/source/blender/editors/space_userpref/SConscript index 3ba1543b840..5c52e6f4c41 100644 --- a/source/blender/editors/space_userpref/SConscript +++ b/source/blender/editors/space_userpref/SConscript @@ -4,7 +4,7 @@ Import ('env') sources = env.Glob('*.c') incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../makesrna ../../imbuf ../../blenfont' -incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include' +incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include ../../blenloader' defs = [] diff --git a/source/blender/editors/space_userpref/space_userpref.c b/source/blender/editors/space_userpref/space_userpref.c index 486713ab890..96881fde320 100644 --- a/source/blender/editors/space_userpref/space_userpref.c +++ b/source/blender/editors/space_userpref/space_userpref.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_userpref/userpref_intern.h b/source/blender/editors/space_userpref/userpref_intern.h index 206c8efe70e..ca1f231df00 100644 --- a/source/blender/editors/space_userpref/userpref_intern.h +++ b/source/blender/editors/space_userpref/userpref_intern.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_userpref/userpref_ops.c b/source/blender/editors/space_userpref/userpref_ops.c index c959e9fcafb..29449202ed9 100644 --- a/source/blender/editors/space_userpref/userpref_ops.c +++ b/source/blender/editors/space_userpref/userpref_ops.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_view3d/CMakeLists.txt b/source/blender/editors/space_view3d/CMakeLists.txt index 1f47a25ad92..fc9dd8c9bcc 100644 --- a/source/blender/editors/space_view3d/CMakeLists.txt +++ b/source/blender/editors/space_view3d/CMakeLists.txt @@ -23,6 +23,7 @@ set(INC ../include ../../blenfont ../../blenkernel + ../../blenloader ../../blenlib ../../gpu ../../imbuf diff --git a/source/blender/editors/space_view3d/SConscript b/source/blender/editors/space_view3d/SConscript index bb32f8b926e..3df59d485d5 100644 --- a/source/blender/editors/space_view3d/SConscript +++ b/source/blender/editors/space_view3d/SConscript @@ -6,7 +6,7 @@ defs = [ 'GLEW_STATIC' ] incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf' incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include' -incs += ' ../../render/extern/include' +incs += ' ../../render/extern/include ../../blenloader' incs += ' ../../gpu ../../makesrna ../../blenfont' incs += ' #/intern/smoke/extern' incs += ' #source/kernel/gen_system' diff --git a/source/blender/editors/space_view3d/drawanimviz.c b/source/blender/editors/space_view3d/drawanimviz.c index 7c07f99b8ea..3c72547bd66 100644 --- a/source/blender/editors/space_view3d/drawanimviz.c +++ b/source/blender/editors/space_view3d/drawanimviz.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_view3d/drawarmature.c b/source/blender/editors/space_view3d/drawarmature.c index f16078ba454..1f0ee30c9e9 100644 --- a/source/blender/editors/space_view3d/drawarmature.c +++ b/source/blender/editors/space_view3d/drawarmature.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_view3d/drawmesh.c b/source/blender/editors/space_view3d/drawmesh.c index 59d9d1bb0b4..19726f02665 100644 --- a/source/blender/editors/space_view3d/drawmesh.c +++ b/source/blender/editors/space_view3d/drawmesh.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index df431f06ef6..031607e3084 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_view3d/drawvolume.c b/source/blender/editors/space_view3d/drawvolume.c index 1479dc950c9..a2eefa2aad1 100644 --- a/source/blender/editors/space_view3d/drawvolume.c +++ b/source/blender/editors/space_view3d/drawvolume.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c index ef2fa693cb1..96ef339a9b9 100644 --- a/source/blender/editors/space_view3d/space_view3d.c +++ b/source/blender/editors/space_view3d/space_view3d.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index e880e4c3610..0e4e1ad7266 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 006605b08f9..4d591645679 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -850,7 +850,7 @@ static void draw_selected_name(Scene *scene, Object *ob, View3D *v3d) BLF_draw_default(offset, 10, 0.0f, info, sizeof(info)-1); } -static void view3d_get_viewborder_size(Scene *scene, ARegion *ar, float size_r[2]) +void view3d_viewborder_size_get(Scene *scene, ARegion *ar, float size_r[2]) { float winmax= MAX2(ar->winx, ar->winy); float aspect= (scene->r.xsch*scene->r.xasp) / (scene->r.ysch*scene->r.yasp); @@ -869,7 +869,7 @@ void view3d_calc_camera_border(Scene *scene, ARegion *ar, RegionView3D *rv3d, Vi float zoomfac, size[2]; float dx= 0.0f, dy= 0.0f; - view3d_get_viewborder_size(scene, ar, size); + view3d_viewborder_size_get(scene, ar, size); if (rv3d == NULL) rv3d = ar->regiondata; @@ -917,19 +917,6 @@ void view3d_calc_camera_border(Scene *scene, ARegion *ar, RegionView3D *rv3d, Vi } } -/* sets the view to 1:1 camera/render-pixel */ -static void view3d_set_1_to_1_viewborder(Scene *scene, ARegion *ar) -{ - RegionView3D *rv3d= ar->regiondata; - float size[2]; - int im_width= (scene->r.size*scene->r.xsch)/100; - - view3d_get_viewborder_size(scene, ar, size); - - rv3d->camzoom= (sqrt(4.0*im_width/size[0]) - M_SQRT2)*50.0; - rv3d->camzoom= CLAMPIS(rv3d->camzoom, RV3D_CAMZOOM_MIN, RV3D_CAMZOOM_MAX); -} - static void drawviewborder(Scene *scene, ARegion *ar, View3D *v3d) { float fac, a; diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 7842707d7e8..0a3ecd735f0 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -1843,6 +1843,47 @@ void VIEW3D_OT_zoom_border(wmOperatorType *ot) RNA_def_int(ot->srna, "ymax", 0, INT_MIN, INT_MAX, "Y Max", "", INT_MIN, INT_MAX); } + +/* sets the view to 1:1 camera/render-pixel */ +static void view3d_set_1_to_1_viewborder(Scene *scene, ARegion *ar) +{ + RegionView3D *rv3d= ar->regiondata; + float size[2]; + int im_width= (scene->r.size*scene->r.xsch)/100; + + view3d_viewborder_size_get(scene, ar, size); + + rv3d->camzoom= (sqrt(4.0*im_width/size[0]) - M_SQRT2)*50.0; + rv3d->camzoom= CLAMPIS(rv3d->camzoom, RV3D_CAMZOOM_MIN, RV3D_CAMZOOM_MAX); +} + +static int view3d_zoom_1_to_1_camera_exec(bContext *C, wmOperator *UNUSED(op)) +{ + Scene *scene= CTX_data_scene(C); + ARegion *ar= CTX_wm_region(C); + + view3d_set_1_to_1_viewborder(scene, ar); + + WM_event_add_notifier(C, NC_SPACE|ND_SPACE_VIEW3D, CTX_wm_view3d(C)); + + return OPERATOR_FINISHED; +} + +void VIEW3D_OT_zoom_camera_1_to_1(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Zoom Camera 1:1"; + ot->description = "Match the camera to 1:1 to the render output"; + ot->idname= "VIEW3D_OT_zoom_camera_1_to_1"; + + /* api callbacks */ + ot->exec= view3d_zoom_1_to_1_camera_exec; + ot->poll= view3d_camera_active_poll; + + /* flags */ + ot->flag= 0; +} + /* ********************* Changing view operator ****************** */ static EnumPropertyItem prop_view_items[] = { diff --git a/source/blender/editors/space_view3d/view3d_fly.c b/source/blender/editors/space_view3d/view3d_fly.c index 1e856ad49f7..7a4fb86a4dd 100644 --- a/source/blender/editors/space_view3d/view3d_fly.c +++ b/source/blender/editors/space_view3d/view3d_fly.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index 2656127d73c..82605439b33 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -206,8 +206,6 @@ static int view3d_layers_exec(bContext *C, wmOperator *op) for (base= scene->base.first; base; base= base->next) { if(base->lay & oldlay) base->object->recalc= OB_RECALC_OB|OB_RECALC_DATA; - if(base->lay & oldlay) - printf("recalc %s\n", base->object->id.name+2); } ED_area_tag_redraw(sa); diff --git a/source/blender/editors/space_view3d/view3d_intern.h b/source/blender/editors/space_view3d/view3d_intern.h index b7efa7fced7..a2a8f9afdb8 100644 --- a/source/blender/editors/space_view3d/view3d_intern.h +++ b/source/blender/editors/space_view3d/view3d_intern.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -63,6 +63,7 @@ void view3d_operatortypes(void); /* view3d_edit.c */ void VIEW3D_OT_zoom(struct wmOperatorType *ot); +void VIEW3D_OT_zoom_camera_1_to_1(struct wmOperatorType *ot); void VIEW3D_OT_move(struct wmOperatorType *ot); void VIEW3D_OT_rotate(struct wmOperatorType *ot); void VIEW3D_OT_view_all(struct wmOperatorType *ot); @@ -126,6 +127,7 @@ void draw_depth_gpencil(Scene *scene, ARegion *ar, View3D *v3d); void view3d_clr_clipping(void); void view3d_set_clipping(RegionView3D *rv3d); void add_view3d_after(ListBase *lb, Base *base, int flag); +void view3d_viewborder_size_get(struct Scene *scene, struct ARegion *ar, float size_r[2]); void circf(float x, float y, float rad); void circ(float x, float y, float rad); diff --git a/source/blender/editors/space_view3d/view3d_ops.c b/source/blender/editors/space_view3d/view3d_ops.c index cb6eee26df5..8906fb6fb8e 100644 --- a/source/blender/editors/space_view3d/view3d_ops.c +++ b/source/blender/editors/space_view3d/view3d_ops.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -57,6 +57,7 @@ void view3d_operatortypes(void) WM_operatortype_append(VIEW3D_OT_rotate); WM_operatortype_append(VIEW3D_OT_move); WM_operatortype_append(VIEW3D_OT_zoom); + WM_operatortype_append(VIEW3D_OT_zoom_camera_1_to_1); WM_operatortype_append(VIEW3D_OT_view_all); WM_operatortype_append(VIEW3D_OT_viewnumpad); WM_operatortype_append(VIEW3D_OT_view_orbit); @@ -147,6 +148,8 @@ void view3d_keymap(wmKeyConfig *keyconf) RNA_int_set(WM_keymap_add_item(keymap, "VIEW3D_OT_zoom", WHEELINMOUSE, KM_PRESS, 0, 0)->ptr, "delta", 1); RNA_int_set(WM_keymap_add_item(keymap, "VIEW3D_OT_zoom", WHEELOUTMOUSE, KM_PRESS, 0, 0)->ptr, "delta", -1); + WM_keymap_add_item(keymap, "VIEW3D_OT_zoom_camera_1_to_1", PADENTER, KM_PRESS, KM_SHIFT, 0); + WM_keymap_add_item(keymap, "VIEW3D_OT_view_center_camera", HOMEKEY, KM_PRESS, 0, 0); /* only with camera view */ RNA_boolean_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_all", HOMEKEY, KM_PRESS, 0, 0)->ptr, "center", 0); /* only without camera view */ RNA_boolean_set(WM_keymap_add_item(keymap, "VIEW3D_OT_view_all", CKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "center", 1); diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index 70d77f4e489..4aa64733875 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -1787,7 +1787,10 @@ static int view3d_borderselect_exec(bContext *C, wmOperator *op) } break; case OB_LATTICE: - ret= do_lattice_box_select(&vc, &rect, select, extend); + ret= do_lattice_box_select(&vc, &rect, select, extend); + if(ret & OPERATOR_FINISHED) { + WM_event_add_notifier(C, NC_GEOM|ND_SELECT, vc.obedit->data); + } break; default: assert(!"border select on incorrect object type"); diff --git a/source/blender/editors/space_view3d/view3d_snap.c b/source/blender/editors/space_view3d/view3d_snap.c index e90998da21c..4c007bb1aac 100644 --- a/source/blender/editors/space_view3d/view3d_snap.c +++ b/source/blender/editors/space_view3d/view3d_snap.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_view3d/view3d_toolbar.c b/source/blender/editors/space_view3d/view3d_toolbar.c index 3f69ce3e8a8..bfe324df51e 100644 --- a/source/blender/editors/space_view3d/view3d_toolbar.c +++ b/source/blender/editors/space_view3d/view3d_toolbar.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 04f9f2d11d4..36485b9e20e 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/transform/CMakeLists.txt b/source/blender/editors/transform/CMakeLists.txt index c68b758527b..6758b94f53f 100644 --- a/source/blender/editors/transform/CMakeLists.txt +++ b/source/blender/editors/transform/CMakeLists.txt @@ -22,6 +22,7 @@ set(INC ../include ../../blenkernel + ../../blenloader ../../blenlib ../../makesdna ../../makesrna diff --git a/source/blender/editors/transform/SConscript b/source/blender/editors/transform/SConscript index c1fe5d6889a..edc2156a07b 100644 --- a/source/blender/editors/transform/SConscript +++ b/source/blender/editors/transform/SConscript @@ -6,6 +6,6 @@ sources = env.Glob('*.c') incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf' incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include' incs += ' ../../render/extern/include' -incs += ' ../../gpu ../../makesrna' +incs += ' ../../gpu ../../makesrna ../../blenloader' env.BlenderLib ( 'bf_editors_transform', sources, Split(incs), [], libtype=['core'], priority=[40] ) diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 0d5b79260e8..3811299c3ce 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -3143,7 +3143,7 @@ static void applyRotation(TransInfo *t, float angle, float axis[3]) int Rotation(TransInfo *t, short UNUSED(mval[2])) { - char str[64]; + char str[128]; float final; diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h index b4a25416dfe..71480ce5e7d 100644 --- a/source/blender/editors/transform/transform.h +++ b/source/blender/editors/transform/transform.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c index 23899398921..a3247b72115 100644 --- a/source/blender/editors/transform/transform_constraints.c +++ b/source/blender/editors/transform/transform_constraints.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index dbed27e95a1..d1bf030e17c 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -4898,6 +4898,14 @@ void special_aftertrans_update(bContext *C, TransInfo *t) arm= ob->data; pose= ob->pose; + if((t->flag & T_AUTOIK) && (t->options & CTX_AUTOCONFIRM)) { + /* when running transform non-interactively (operator exec), + * we need to update the pose otherwise no updates get called during + * transform and the auto-ik is not applied. see [#26164] */ + struct Object *ob=t->poseobj; + where_is_pose(t->scene, ob); + } + /* if target-less IK grabbing, we calculate the pchan transforms and clear flag */ if (!cancelled && t->mode==TFM_TRANSLATION) targetless_ik= apply_targetless_ik(ob); diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 8f7c1001fe8..7e44632ecb9 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/transform/transform_input.c b/source/blender/editors/transform/transform_input.c index 6a9f89362f1..486fed91e3e 100644 --- a/source/blender/editors/transform/transform_input.c +++ b/source/blender/editors/transform/transform_input.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index 49080b86e87..6483d8c1f83 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/transform/transform_ndofinput.c b/source/blender/editors/transform/transform_ndofinput.c index ae12daa29ad..f9ac1bd38d1 100644 --- a/source/blender/editors/transform/transform_ndofinput.c +++ b/source/blender/editors/transform/transform_ndofinput.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index 5c42a59ac69..e1dd0191c0d 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -35,6 +35,7 @@ #include "BKE_context.h" #include "BKE_global.h" +#include "BKE_armature.h" #include "WM_api.h" #include "WM_types.h" diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c index f10eb920c34..0962a6d85f9 100644 --- a/source/blender/editors/transform/transform_orientations.c +++ b/source/blender/editors/transform/transform_orientations.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index ab1cbab9a23..164876078f1 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -83,7 +83,7 @@ //#include "blendef.h" /* for selection modes */ -#define USE_BVH_FACE_PROJECT +#define USE_BVH_FACE_SNAP /********************* PROTOTYPES ***********************/ diff --git a/source/blender/editors/util/CMakeLists.txt b/source/blender/editors/util/CMakeLists.txt index 38c0dd7f0ba..0be6ccaee2c 100644 --- a/source/blender/editors/util/CMakeLists.txt +++ b/source/blender/editors/util/CMakeLists.txt @@ -22,6 +22,7 @@ set(INC ../include ../../blenkernel + ../../blenloader ../../blenlib ../../makesdna ../../makesrna diff --git a/source/blender/editors/util/SConscript b/source/blender/editors/util/SConscript index 74ca2c89ba2..a694b211ca4 100644 --- a/source/blender/editors/util/SConscript +++ b/source/blender/editors/util/SConscript @@ -6,5 +6,6 @@ sources = env.Glob('*.c') incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf' incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include' incs += ' ../../makesrna' +incs += ' ../../blenloader' env.BlenderLib ( 'bf_editors_util', sources, Split(incs), [], libtype=['core'], priority=[130] ) diff --git a/source/blender/editors/util/crazyspace.c b/source/blender/editors/util/crazyspace.c index 20b7c255922..20152f6681b 100644 --- a/source/blender/editors/util/crazyspace.c +++ b/source/blender/editors/util/crazyspace.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c index 081bda60ba2..2f3392d7f8c 100644 --- a/source/blender/editors/util/ed_util.c +++ b/source/blender/editors/util/ed_util.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/util/editmode_undo.c b/source/blender/editors/util/editmode_undo.c index 767a2adacb2..08f801b8039 100644 --- a/source/blender/editors/util/editmode_undo.c +++ b/source/blender/editors/util/editmode_undo.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/util/numinput.c b/source/blender/editors/util/numinput.c index ccdbe7dfd4e..6ae5963564e 100644 --- a/source/blender/editors/util/numinput.c +++ b/source/blender/editors/util/numinput.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c index a992e33e7d6..c2f8ae16cb8 100644 --- a/source/blender/editors/util/undo.c +++ b/source/blender/editors/util/undo.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** @@ -60,9 +60,13 @@ #include "WM_api.h" #include "WM_types.h" +#include "RNA_access.h" +#include "RNA_define.h" #include "util_intern.h" +#define MAXUNDONAME 64 /* XXX, make common define */ + /* ***************** generic undo system ********************* */ void ED_undo_push(bContext *C, const char *str) @@ -252,6 +256,14 @@ static int ed_undo_exec(bContext *C, wmOperator *UNUSED(op)) return ed_undo_step(C, 1, NULL); } +static int ed_undo_push_exec(bContext *C, wmOperator *op) +{ + char str[MAXUNDONAME]; + RNA_string_get(op->ptr, "message", str); + ED_undo_push(C, str); + return OPERATOR_FINISHED; +} + static int ed_redo_exec(bContext *C, wmOperator *UNUSED(op)) { return ed_undo_step(C, -1, NULL); @@ -298,6 +310,19 @@ void ED_OT_undo(wmOperatorType *ot) ot->poll= ED_operator_screenactive; } +void ED_OT_undo_push(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Undo Push"; + ot->description= "Add an undo state (internal use only)"; + ot->idname= "ED_OT_undo_push"; + + /* api callbacks */ + ot->exec= ed_undo_push_exec; + + RNA_def_string(ot->srna, "message", "Add an undo step *function may be moved*", MAXUNDONAME, "Undo Message", ""); +} + void ED_OT_redo(wmOperatorType *ot) { /* identifiers */ diff --git a/source/blender/editors/util/util_intern.h b/source/blender/editors/util/util_intern.h index b5750c55c87..c448377f6b0 100644 --- a/source/blender/editors/util/util_intern.h +++ b/source/blender/editors/util/util_intern.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/uvedit/CMakeLists.txt b/source/blender/editors/uvedit/CMakeLists.txt index 6333eded12e..852b120a826 100644 --- a/source/blender/editors/uvedit/CMakeLists.txt +++ b/source/blender/editors/uvedit/CMakeLists.txt @@ -22,6 +22,7 @@ set(INC ../include ../../blenkernel + ../../blenloader ../../blenlib ../../makesdna ../../makesrna diff --git a/source/blender/editors/uvedit/SConscript b/source/blender/editors/uvedit/SConscript index b472b89d23d..2523de005d0 100644 --- a/source/blender/editors/uvedit/SConscript +++ b/source/blender/editors/uvedit/SConscript @@ -5,6 +5,6 @@ sources = env.Glob('*.c') incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf' incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include' -incs += ' ../../makesrna #/intern/opennl/extern ../../gpu' +incs += ' ../../makesrna #/intern/opennl/extern ../../gpu ../../blenloader' env.BlenderLib ( 'bf_editors_uvedit', sources, Split(incs), [], libtype=['core'], priority=[45] ) diff --git a/source/blender/editors/uvedit/uvedit_draw.c b/source/blender/editors/uvedit/uvedit_draw.c index 1cee7a16b98..ef41ff23c24 100644 --- a/source/blender/editors/uvedit/uvedit_draw.c +++ b/source/blender/editors/uvedit/uvedit_draw.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/uvedit/uvedit_intern.h b/source/blender/editors/uvedit/uvedit_intern.h index 2c412697de3..1312c6d9b55 100644 --- a/source/blender/editors/uvedit/uvedit_intern.h +++ b/source/blender/editors/uvedit/uvedit_intern.h @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index a00a3c59626..e916170a5fa 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.c b/source/blender/editors/uvedit/uvedit_unwrap_ops.c index 3b6581b7893..7e686f818f7 100644 --- a/source/blender/editors/uvedit/uvedit_unwrap_ops.c +++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.c @@ -1,4 +1,4 @@ -/** +/* * $Id$ * * ***** BEGIN GPL LICENSE BLOCK ***** |