[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [19079] branches/blender2.5/blender/source /blender/editors/animation/anim_channels.c: Animation Editors: Added Tab-Key to toggle editability of selec
Revision: 19079 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=19079 Author: aligorith Date: 2009-02-22 06:55:37 +0100 (Sun, 22 Feb 2009) Log Message: --- Animation Editors: Added Tab-Key to toggle editability of selected channels. Ton - Currently, I've had to add a new operator to set this, since it is not possible to specify via keymaps whether the invoke or exec should be called by default for an operator. (See corresponding mail on 2.5 mailing list for details about this) Modified Paths: -- branches/blender2.5/blender/source/blender/editors/animation/anim_channels.c Modified: branches/blender2.5/blender/source/blender/editors/animation/anim_channels.c === --- branches/blender2.5/blender/source/blender/editors/animation/anim_channels.c 2009-02-22 05:34:47 UTC (rev 19078) +++ branches/blender2.5/blender/source/blender/editors/animation/anim_channels.c 2009-02-22 05:55:37 UTC (rev 19079) @@ -867,6 +867,27 @@ RNA_def_enum(ot->srna, "type", prop_animchannel_settings_types, 0, "Type", ""); } +// XXX currently, this is a separate operator, but perhaps we could in future specify in keymaps whether to call invoke or exec? +void ANIM_OT_channels_toggle_editable (wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Toggle Channel Editability"; + ot->idname= "ANIM_OT_channels_toggle_editable"; + + /* api callbacks */ + ot->exec= animchannels_setflag_exec; + ot->poll= ED_operator_areaactive; + + /* flags */ + ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; + + /* props */ + /* flag-setting mode */ + RNA_def_enum(ot->srna, "mode", prop_animchannel_setflag_types, ACHANNEL_SETFLAG_TOGGLE, "Mode", ""); + /* setting to set */ + RNA_def_enum(ot->srna, "type", prop_animchannel_settings_types, ACHANNEL_SETTING_PROTECT, "Type", ""); +} + /* ** Select All Operator *** */ static int animchannels_deselectall_exec(bContext *C, wmOperator *op) @@ -1389,6 +1410,9 @@ WM_operatortype_append(ANIM_OT_channels_disable_setting); WM_operatortype_append(ANIM_OT_channels_toggle_setting); + // XXX does this need to be a separate operator? + WM_operatortype_append(ANIM_OT_channels_toggle_editable); + // XXX these need to be updated for new system... todo... //WM_operatortype_append(ANIM_OT_channels_move_up); //WM_operatortype_append(ANIM_OT_channels_move_down); @@ -1421,6 +1445,9 @@ WM_keymap_add_item(keymap, "ANIM_OT_channels_enable_setting", WKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0); WM_keymap_add_item(keymap, "ANIM_OT_channels_disable_setting", WKEY, KM_PRESS, KM_ALT, 0); + /* settings - specialised hotkeys */ + WM_keymap_add_item(keymap, "ANIM_OT_channels_toggle_editable", TABKEY, KM_PRESS, 0, 0); + /* rearranging - actions only */ //WM_keymap_add_item(keymap, "ANIM_OT_channels_move_up", PAGEUPKEY, KM_PRESS, KM_SHIFT, 0); //WM_keymap_add_item(keymap, "ANIM_OT_channels_move_down", PAGEDOWNKEY, KM_PRESS, KM_SHIFT, 0); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [19078] branches/blender2.5/blender/source /blender/editors: Graph Editor: Selecting F-Curve channels + keyframes now sets active F-Curve correctly.
Revision: 19078 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=19078 Author: aligorith Date: 2009-02-22 06:34:47 +0100 (Sun, 22 Feb 2009) Log Message: --- Graph Editor: Selecting F-Curve channels + keyframes now sets active F-Curve correctly. Modified Paths: -- branches/blender2.5/blender/source/blender/editors/animation/anim_channels.c branches/blender2.5/blender/source/blender/editors/space_graph/graph_select.c Modified: branches/blender2.5/blender/source/blender/editors/animation/anim_channels.c === --- branches/blender2.5/blender/source/blender/editors/animation/anim_channels.c 2009-02-22 04:13:29 UTC (rev 19077) +++ branches/blender2.5/blender/source/blender/editors/animation/anim_channels.c 2009-02-22 05:34:47 UTC (rev 19078) @@ -1220,7 +1220,7 @@ } /* if group is selected now, make group the 'active' one in the visible list */ - if ((agrp->flag & AGRP_SELECTED) && (selectmode != SELECT_INVERT)) + if (agrp->flag & AGRP_SELECTED) ANIM_set_active_channel(ac->data, ac->datatype, filter, agrp, ANIMTYPE_GROUP); } } @@ -1240,17 +1240,23 @@ } else if ((x < (offset+17)) && (ac->spacetype==SPACE_IPO)) { /* toggle visibility */ - // XXX this is supposed to be button before name, though this sometimes fails fcu->flag ^= FCURVE_VISIBLE; } else { /* select/deselect */ - fcu->flag ^= FCURVE_SELECTED; + if (selectmode == SELECT_INVERT) { + /* inverse selection status of this F-Curve only */ + fcu->flag ^= FCURVE_SELECTED; + } + else { + /* select F-Curve by itself */ + ANIM_deselect_anim_channels(ac->data, ac->datatype, 0, ACHANNEL_SETFLAG_CLEAR); + fcu->flag |= FCURVE_SELECTED; + } + /* if F-Curve is selected now, make F-Curve the 'active' one in the visible list */ if (fcu->flag & FCURVE_SELECTED) - fcu->flag |= FCURVE_ACTIVE; - else - fcu->flag &= ~FCURVE_ACTIVE; + ANIM_set_active_channel(ac->data, ac->datatype, filter, fcu, ANIMTYPE_FCURVE); } } break; Modified: branches/blender2.5/blender/source/blender/editors/space_graph/graph_select.c === --- branches/blender2.5/blender/source/blender/editors/space_graph/graph_select.c 2009-02-22 04:13:29 UTC (rev 19077) +++ branches/blender2.5/blender/source/blender/editors/space_graph/graph_select.c 2009-02-22 05:34:47 UTC (rev 19078) @@ -661,6 +661,7 @@ FCurve *fcu; BezTriple *bezt; short handle; + int filter; /* find the beztriple that we're selecting, and the handle that was clicked on */ handle= findnearest_fcurve_vert(ac, mval, &fcu, &bezt); @@ -719,16 +720,16 @@ } /* select or deselect curve? */ - if (selectmode == SELECT_INVERT) { + if (selectmode == SELECT_INVERT) fcu->flag ^= FCURVE_SELECTED; + else if (selectmode == SELECT_ADD) + fcu->flag |= FCURVE_SELECTED; - if (fcu->flag & FCURVE_SELECTED) - fcu->flag |= FCURVE_ACTIVE; - else - fcu->flag &= ~FCURVE_ACTIVE; + /* set active F-Curve (NOTE: sync the filter flags with findnearest_fcurve_vert) */ + if (fcu->flag & FCURVE_SELECTED) { + filter= (ANIMFILTER_VISIBLE | ANIMFILTER_CURVEVISIBLE | ANIMFILTER_CURVESONLY); + ANIM_set_active_channel(ac->data, ac->datatype, filter, fcu, ANIMTYPE_FCURVE); } - else if (selectmode == SELECT_ADD) - fcu->flag |= (FCURVE_ACTIVE|FCURVE_SELECTED); } /* Option 2) Selects all the keyframes on either side of the current frame (depends on which side the mouse is on) */ @@ -881,7 +882,6 @@ else { /* select keyframe under mouse */
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [19077] branches/blender2.5/blender/source /blender/editors: Animation Editors: Bugfixes for channel selection tools
Revision: 19077 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=19077 Author: aligorith Date: 2009-02-22 05:13:29 +0100 (Sun, 22 Feb 2009) Log Message: --- Animation Editors: Bugfixes for channel selection tools * Ctrl-Shift select for Action Groups works again * Clicking on a channel's data will select it, and also make it the active one in the list now * Selecting keyframes in F-Curves will select the F-Curve channel too now (+ make it active) Modified Paths: -- branches/blender2.5/blender/source/blender/editors/animation/anim_channels.c branches/blender2.5/blender/source/blender/editors/include/ED_anim_api.h branches/blender2.5/blender/source/blender/editors/space_action/action_select.c Modified: branches/blender2.5/blender/source/blender/editors/animation/anim_channels.c === --- branches/blender2.5/blender/source/blender/editors/animation/anim_channels.c 2009-02-21 19:17:31 UTC (rev 19076) +++ branches/blender2.5/blender/source/blender/editors/animation/anim_channels.c 2009-02-22 04:13:29 UTC (rev 19077) @@ -101,45 +101,56 @@ else (channel)->flag &= ~(sflag); \ } -/* -- Internal Tools */ +/* -- Exposed API --- */ -/* set the given Action Group to be the 'active' one in its Action */ -static void action_set_active_agrp (bAction *act, bActionGroup *agrp) +/* Set the given animation-channel as the active one for the active context */ +void ANIM_set_active_channel (void *data, short datatype, int filter, void *channel_data, short channel_type) { - bActionGroup *grp; + ListBase anim_data = {NULL, NULL}; + bAnimListElem *ale; + short smode; - /* sanity check */ - if (act == NULL) + /* try to build list of filtered items */ + // XXX we don't need/supply animcontext for now, since in this case, there's nothing really essential there that isn't already covered + ANIM_animdata_filter(NULL, &anim_data, filter, data, datatype); + if (anim_data.first == NULL) return; - /* clear active flag on all others */ - for (grp= act->groups.first; grp; grp= grp->next) - grp->flag &= ~AGRP_ACTIVE; + /* only clear the 'active' flag for the channels of the same type */ + for (ale= anim_data.first; ale; ale= ale->next) { + /* skip if types don't match */ + if (channel_type != ale->type) + continue; - /* set the given group to be the active one */ - if (agrp) - agrp->flag |= AGRP_ACTIVE; -} - -/* -- Exposed API --- */ - -/* Set the given ActionChannel or ActionGroup as the active one in the given action - * - data: should be bAction... - * - datatype: should be ANIMCONT_ACTION - * - channel_data: bActionChannel or bActionGroup - * - channel_type: eAnim_ChannelType - */ -void ANIM_action_set_active_channel (void *data, short datatype, void *channel_data, short channel_type) -{ - /* sanity checks */ - if ((data == NULL) || (datatype != ANIMCONT_ACTION)) - return; + /* flag setting mode +* - depends on whether the provided channel is encountered +*/ + if (ale->data == channel_data) + smode= ACHANNEL_SETFLAG_ADD; + else + smode= ACHANNEL_SETFLAG_CLEAR; - switch (channel_type) { - case ANIMTYPE_GROUP: - action_set_active_agrp((bAction *)data, (bActionGroup *)channel_data); - break; + /* flag to set depends on type */ + switch (ale->type) { + case ANIMTYPE_GROUP: + { + bActionGroup *agrp= (bActionGroup *)ale->data; + + ACHANNEL_SET_FLAG(agrp, smode, AGRP_ACTIVE); + } + break; + case ANIMTYPE_FCURVE: + { + FCurve *fcu= (FCurve *)ale->data; + + ACHANNEL_SET_FLAG(fcu, smode, FCURVE_ACTIVE); + } + break; + } } + + /* clean up */ + BLI_freelistN(&anim_data); } /* Deselect all animation channels @@ -1192,14 +1203,14 @@ }
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [19076] branches/blender2.5/blender/source /blender/editors: 2.5
Revision: 19076 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=19076 Author: ton Date: 2009-02-21 20:17:31 +0100 (Sat, 21 Feb 2009) Log Message: --- 2.5 View3D: background image buttons back. Again nice to use blend or size or other sliders for live updates. :) Note that 'load' doesnt work yet, the operator for image load only does space-image now. Also note that with a built-in 4-split option, we can also encode a way to show 3 different pics. Modified Paths: -- branches/blender2.5/blender/source/blender/editors/include/ED_image.h branches/blender2.5/blender/source/blender/editors/space_image/image_panels.c branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_buttons.c Modified: branches/blender2.5/blender/source/blender/editors/include/ED_image.h === --- branches/blender2.5/blender/source/blender/editors/include/ED_image.h 2009-02-21 18:43:28 UTC (rev 19075) +++ branches/blender2.5/blender/source/blender/editors/include/ED_image.h 2009-02-21 19:17:31 UTC (rev 19076) @@ -30,6 +30,9 @@ struct SpaceImage; struct bContext; +struct Image; +struct ImageUser; +struct uiBlock; /* space_image.c, exported for transform */ struct Image *ED_space_image(struct SpaceImage *sima); @@ -50,6 +53,9 @@ int ED_space_image_show_uvedit(struct SpaceImage *sima, struct Object *obedit); int ED_space_image_show_uvshadow(struct SpaceImage *sima, struct Object *obedit); +void ED_image_uiblock_panel(const struct bContext *C, struct uiBlock *block, struct Image **ima_pp, + struct ImageUser *iuser, short redraw, short imagechanged); + /* image_render.c, export for screen_ops.c, render operator */ void ED_space_image_output(struct bContext *C); Modified: branches/blender2.5/blender/source/blender/editors/space_image/image_panels.c === --- branches/blender2.5/blender/source/blender/editors/space_image/image_panels.c 2009-02-21 18:43:28 UTC (rev 19075) +++ branches/blender2.5/blender/source/blender/editors/space_image/image_panels.c 2009-02-21 19:17:31 UTC (rev 19076) @@ -1229,7 +1229,7 @@ static int packdummy=0; /* The general Image panel with the loadsa callbacks! */ -void uiblock_image_panel(const bContext *C, uiBlock *block, Image **ima_pp, ImageUser *iuser, +void ED_image_uiblock_panel(const bContext *C, uiBlock *block, Image **ima_pp, ImageUser *iuser, short redraw, short imagechanged) { Scene *scene= CTX_data_scene(C); @@ -1410,7 +1410,7 @@ uiBlockSetHandleFunc(block, do_image_panel_events, NULL); /* note, it draws no bottom half in facemode, for vertex buttons */ - uiblock_image_panel(C, block, &sima->image, &sima->iuser, B_REDR, B_REDR); + ED_image_uiblock_panel(C, block, &sima->image, &sima->iuser, B_REDR, B_REDR); image_editvertex_buts(C, block); uiEndBlock(C, block); Modified: branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_buttons.c === --- branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_buttons.c 2009-02-21 18:43:28 UTC (rev 19075) +++ branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_buttons.c 2009-02-21 19:17:31 UTC (rev 19076) @@ -77,10 +77,11 @@ #include "ED_armature.h" #include "ED_curve.h" -#include "ED_particle.h" +#include "ED_image.h" #include "ED_keyframing.h" #include "ED_mesh.h" #include "ED_object.h" +#include "ED_particle.h" #include "ED_screen.h" #include "ED_types.h" #include "ED_util.h" @@ -1303,6 +1304,7 @@ block= uiBeginBlock(C, ar, "view3d_panel_background", UI_EMBOSS, UI_HELV); if(uiNewPanel(C, ar, block, "Background Image", "View3d", 340, 10, 318, 204)==0) return; + uiBlockSetHandleFunc(block, do_view3d_region_buttons, NULL); if(v3d->flag & V3D_DISPBGPIC) { if(v3d->bgpic==NULL) { @@ -1327,7 +1329,7 @@ uiDefButF(block, NUM, B_REDR, "X Offset:", 10, 205, 150, 20, &v3d->bgpic->xof, -250.0*v3d->grid,250.0*v3d->grid, 10, 2, "Set the horizontal offset of the background image"); uiDefButF(block, NUM, B_REDR, "Y Offset:", 160, 205, 150, 20, &v3d->bgpic->yof, -250.0*v3d->grid,250.0*v3d->grid, 10, 2, "Set the vertical offset of the background image"); -// XXX uiblock_image_panel(block, &v3d->bgpic->ima, &v3d->bgpic->iuser, B_REDR, B_REDR); + ED_image_uiblock_panel(C, block, &v3d->bgpic->ima, &v3d->bgpic->iuser, B_REDR, B_REDR); uiBlockEndAlign(block); } uiEndBlock(C, block); ___ Bf-b
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [19075] branches/blender2.5/blender/source /blender/editors/space_image/image_panels.c: 2.5: fix for last commit, for case sensitive OSes.
Revision: 19075 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=19075 Author: blendix Date: 2009-02-21 19:43:28 +0100 (Sat, 21 Feb 2009) Log Message: --- 2.5: fix for last commit, for case sensitive OSes. Modified Paths: -- branches/blender2.5/blender/source/blender/editors/space_image/image_panels.c Modified: branches/blender2.5/blender/source/blender/editors/space_image/image_panels.c === --- branches/blender2.5/blender/source/blender/editors/space_image/image_panels.c 2009-02-21 18:33:09 UTC (rev 19074) +++ branches/blender2.5/blender/source/blender/editors/space_image/image_panels.c 2009-02-21 18:43:28 UTC (rev 19075) @@ -56,7 +56,7 @@ #include "BKE_library.h" #include "BKE_main.h" #include "BKE_node.h" -#include "BKE_packedfile.h" +#include "BKE_packedFile.h" #include "BKE_screen.h" #include "BKE_utildefines.h" ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [19074] branches/blender2.5/blender/source /blender: 2.5
Revision: 19074 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=19074 Author: ton Date: 2009-02-21 19:33:09 +0100 (Sat, 21 Feb 2009) Log Message: --- 2.5 Useful goodies: most buttons for Image window back. Not every button works! But what you can do: - press Nkey to show/hide options - use curves, with realtime updating - image properties panel, load, browsing layers, setting types - paint panel - plus new paint color picker panel! (why it wasn't there in 2.4x is probably obvious, but now it can!) Hrm... radial control should be added here too, and a nice paint size cursor? Modified Paths: -- branches/blender2.5/blender/source/blender/editors/interface/interface_panel.c branches/blender2.5/blender/source/blender/editors/space_graph/space_graph.c branches/blender2.5/blender/source/blender/editors/space_image/image_intern.h branches/blender2.5/blender/source/blender/editors/space_image/image_ops.c branches/blender2.5/blender/source/blender/editors/space_image/image_panels.c branches/blender2.5/blender/source/blender/editors/space_image/space_image.c branches/blender2.5/blender/source/blender/editors/space_node/node_edit.c branches/blender2.5/blender/source/blender/windowmanager/WM_api.h branches/blender2.5/blender/source/blender/windowmanager/intern/wm_event_system.c Modified: branches/blender2.5/blender/source/blender/editors/interface/interface_panel.c === --- branches/blender2.5/blender/source/blender/editors/interface/interface_panel.c 2009-02-21 15:31:01 UTC (rev 19073) +++ branches/blender2.5/blender/source/blender/editors/interface/interface_panel.c 2009-02-21 18:33:09 UTC (rev 19074) @@ -243,7 +243,7 @@ void uiNewPanelHeight(uiBlock *block, int sizey) { - if(sizey<64) sizey= 64; + if(sizey<0) sizey= 0; if(block->panel) { block->panel->ofsy+= (block->panel->sizey - sizey); Modified: branches/blender2.5/blender/source/blender/editors/space_graph/space_graph.c === --- branches/blender2.5/blender/source/blender/editors/space_graph/space_graph.c 2009-02-21 15:31:01 UTC (rev 19073) +++ branches/blender2.5/blender/source/blender/editors/space_graph/space_graph.c 2009-02-21 18:33:09 UTC (rev 19074) @@ -337,6 +337,8 @@ UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_LIST_UI, ar->winx, ar->winy); + keymap= WM_keymap_listbase(wm, "View2D Buttons List", 0, 0); + WM_event_add_keymap_handler(&ar->handlers, keymap); keymap= WM_keymap_listbase(wm, "GraphEdit Generic", SPACE_IPO, 0); WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); } @@ -567,7 +569,7 @@ art= MEM_callocN(sizeof(ARegionType), "spacetype graphedit region"); art->regionid = RGN_TYPE_UI; art->minsizey= 160; - art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D|ED_KEYMAP_FRAMES; + art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_FRAMES; art->listener= NULL; // graph_region_listener; art->init= graph_buttons_area_init; art->draw= graph_buttons_area_draw; Modified: branches/blender2.5/blender/source/blender/editors/space_image/image_intern.h === --- branches/blender2.5/blender/source/blender/editors/space_image/image_intern.h 2009-02-21 15:31:01 UTC (rev 19073) +++ branches/blender2.5/blender/source/blender/editors/space_image/image_intern.h 2009-02-21 18:33:09 UTC (rev 19074) @@ -39,6 +39,7 @@ struct ImBuf; struct wmOperatorType; struct Scene; +struct bNodeTree; /* space_image.c */ struct ARegion *image_has_buttons_region(struct ScrArea *sa); @@ -82,6 +83,7 @@ void draw_uvedit_main(struct SpaceImage *sima, struct ARegion *ar, struct Scene *scene, struct Object *obedit); /* image_panels.c */ +struct ImageUser *ntree_get_active_iuser(struct bNodeTree *ntree); void image_buttons_area_defbuts(const struct bContext *C, struct ARegion *ar); void IMAGE_OT_properties(struct wmOperatorType *ot); Modified: branches/blender2.5/blender/source/blender/editors/space_image/image_ops.c === --- branches/blender2.5/blender/source/blender/editors/space_image/image_ops.c 2009-02-21 15:31:01 UTC (rev 19073) +++ branches/blender2.5/blender/source/blender/editors/space_image/image_ops.c 2009-02-21 18:33:09 UTC (rev 19074) @@ -621,7 +621,6 @@ RNA_string_get(op->ptr, "filename", str); ima= BKE_add_image_file(str, scene->r.cfra); - MEM_freeN(str); if(!ima) return OPERATOR_CANCELLED; Modified: branches/blender2.5/blender/source/blender/editors/space_image/image_panels.c
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [19073] branches/blender2.5/blender/source /blender/editors/space_image: 2.5
Revision: 19073 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=19073 Author: ton Date: 2009-02-21 16:31:01 +0100 (Sat, 21 Feb 2009) Log Message: --- 2.5 Support for listview/buttons region in ImageWindow. Now all code is in this commit :) Modified Paths: -- branches/blender2.5/blender/source/blender/editors/space_image/image_intern.h branches/blender2.5/blender/source/blender/editors/space_image/image_panels.c branches/blender2.5/blender/source/blender/editors/space_image/space_image.c Modified: branches/blender2.5/blender/source/blender/editors/space_image/image_intern.h === --- branches/blender2.5/blender/source/blender/editors/space_image/image_intern.h 2009-02-21 12:43:24 UTC (rev 19072) +++ branches/blender2.5/blender/source/blender/editors/space_image/image_intern.h 2009-02-21 15:31:01 UTC (rev 19073) @@ -32,6 +32,7 @@ /* internal exports only */ struct bContext; struct ARegion; +struct ScrArea; struct SpaceImage; struct Object; struct Image; @@ -39,6 +40,9 @@ struct wmOperatorType; struct Scene; +/* space_image.c */ +struct ARegion *image_has_buttons_region(struct ScrArea *sa); + /* image_header.c */ void image_header_buttons(const struct bContext *C, struct ARegion *ar); @@ -77,5 +81,9 @@ /* uvedit_draw.c */ void draw_uvedit_main(struct SpaceImage *sima, struct ARegion *ar, struct Scene *scene, struct Object *obedit); +/* image_panels.c */ +void image_buttons_area_defbuts(const struct bContext *C, struct ARegion *ar); +void IMAGE_OT_properties(struct wmOperatorType *ot); + #endif /* ED_IMAGE_INTERN_H */ Modified: branches/blender2.5/blender/source/blender/editors/space_image/image_panels.c === --- branches/blender2.5/blender/source/blender/editors/space_image/image_panels.c 2009-02-21 12:43:24 UTC (rev 19072) +++ branches/blender2.5/blender/source/blender/editors/space_image/image_panels.c 2009-02-21 15:31:01 UTC (rev 19073) @@ -25,6 +25,55 @@ * * END GPL LICENSE BLOCK * */ + +#include +#include + +#include "DNA_image_types.h" +#include "DNA_mesh_types.h" +#include "DNA_meshdata_types.h" +#include "DNA_object_types.h" +#include "DNA_space_types.h" +#include "DNA_scene_types.h" +#include "DNA_screen_types.h" + +#include "MEM_guardedalloc.h" + +#include "BLI_blenlib.h" +#include "BLI_arithb.h" +#include "BLI_editVert.h" +#include "BLI_rand.h" + +#include "BKE_colortools.h" +#include "BKE_context.h" +#include "BKE_image.h" +#include "BKE_screen.h" +#include "BKE_utildefines.h" + +#include "IMB_imbuf.h" +#include "IMB_imbuf_types.h" + +#include "ED_image.h" +#include "ED_mesh.h" +#include "ED_space_api.h" +#include "ED_screen.h" +#include "ED_uvedit.h" + +#include "BIF_gl.h" +#include "BIF_glutil.h" + +#include "RNA_access.h" + +#include "WM_api.h" +#include "WM_types.h" + +#include "UI_interface.h" +#include "UI_resources.h" +#include "UI_view2d.h" + +#include "image_intern.h" + + #if 0 /* panel stuff * */ @@ -237,21 +286,6 @@ } -static void image_panel_properties(short cntrl)// IMAGE_HANDLER_PROPERTIES -{ - uiBlock *block; - - block= uiNewBlock(&curarea->uiblocks, "image_panel_properties", UI_EMBOSS, UI_HELV, curarea->win); - uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | cntrl); - uiSetPanelHandler(IMAGE_HANDLER_PROPERTIES); // for close and esc - if(uiNewPanel(curarea, block, "Image Properties", "Image", 10, 10, 318, 204)==0) - return; - - /* note, it draws no bottom half in facemode, for vertex buttons */ - uiblock_image_panel(block, &G.sima->image, &G.sima->iuser, B_REDR, B_REDR); - image_editvertex_buts(block); -} - static void image_panel_game_properties(short cntrl) // IMAGE_HANDLER_GAME_PROPERTIES { ImBuf *ibuf= BKE_image_get_ibuf(G.sima->image, &G.sima->iuser); @@ -629,3 +663,60 @@ } #endif +static void image_panel_properties(const bContext *C, ARegion *ar) +{ + uiBlock *block; + + block= uiBeginBlock(C, ar, "image_panel_properties", UI_EMBOSS, UI_HELV); + if(uiNewPanel(C, ar, block, "Image Properties", "Image", 10, 10, 318, 204)==0) + return; + + /* note, it draws no bottom half in facemode, for vertex buttons */ +// uiblock_image_panel(block, &G.sima->image, &G.sima->iuser, B_REDR, B_REDR); +// image_editvertex_buts(block); + + uiEndBlock(C, block); +} + + + +void image_buttons_area_defbuts(const bContext *C, ARegion *ar) +{ + + image_panel_properties(C, ar); + + uiDrawPanels(C, 1); /* 1 = align */ + uiMatchPanelsView2d(ar); /* sets v2d->totrct */ + +} + + +static int image_properties(bContext *C, wmOperator *op)
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [19072] trunk/blender/source/gameengine: * removed typedefs that were not used (from anonymous enums and structs)
Revision: 19072 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=19072 Author: campbellbarton Date: 2009-02-21 13:43:24 +0100 (Sat, 21 Feb 2009) Log Message: --- * removed typedefs that were not used (from anonymous enums and structs) * Missed some cases of using a 'char *' as an attribute * replace BGE's Py_Return macro with Pythons Py_RETURN_NONE * other minor warnings removed Modified Paths: -- trunk/blender/source/gameengine/Converter/BL_ShapeActionActuator.cpp trunk/blender/source/gameengine/Expressions/ListValue.cpp trunk/blender/source/gameengine/Expressions/PyObjectPlus.cpp trunk/blender/source/gameengine/Expressions/PyObjectPlus.h trunk/blender/source/gameengine/GameLogic/SCA_ActuatorSensor.cpp trunk/blender/source/gameengine/GameLogic/SCA_DelaySensor.cpp trunk/blender/source/gameengine/GameLogic/SCA_ILogicBrick.cpp trunk/blender/source/gameengine/GameLogic/SCA_ISensor.cpp trunk/blender/source/gameengine/GameLogic/SCA_KeyboardSensor.cpp trunk/blender/source/gameengine/GameLogic/SCA_MouseSensor.cpp trunk/blender/source/gameengine/GameLogic/SCA_PropertyActuator.cpp trunk/blender/source/gameengine/GameLogic/SCA_PropertySensor.cpp trunk/blender/source/gameengine/GameLogic/SCA_RandomActuator.cpp trunk/blender/source/gameengine/GameLogic/SCA_RandomSensor.cpp trunk/blender/source/gameengine/Ketsji/BL_Shader.cpp trunk/blender/source/gameengine/Ketsji/KXNetwork/KX_NetworkMessageActuator.cpp trunk/blender/source/gameengine/Ketsji/KX_BlenderMaterial.cpp trunk/blender/source/gameengine/Ketsji/KX_CDActuator.cpp trunk/blender/source/gameengine/Ketsji/KX_Camera.cpp trunk/blender/source/gameengine/Ketsji/KX_Camera.h trunk/blender/source/gameengine/Ketsji/KX_CameraActuator.cpp trunk/blender/source/gameengine/Ketsji/KX_ConstraintActuator.cpp trunk/blender/source/gameengine/Ketsji/KX_GameActuator.cpp trunk/blender/source/gameengine/Ketsji/KX_GameObject.cpp trunk/blender/source/gameengine/Ketsji/KX_IpoActuator.cpp trunk/blender/source/gameengine/Ketsji/KX_MouseFocusSensor.cpp trunk/blender/source/gameengine/Ketsji/KX_ObjectActuator.cpp trunk/blender/source/gameengine/Ketsji/KX_PolygonMaterial.cpp trunk/blender/source/gameengine/Ketsji/KX_RaySensor.cpp trunk/blender/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp trunk/blender/source/gameengine/Ketsji/KX_SCA_DynamicActuator.cpp trunk/blender/source/gameengine/Ketsji/KX_SceneActuator.cpp trunk/blender/source/gameengine/Ketsji/KX_SoundActuator.cpp trunk/blender/source/gameengine/Ketsji/KX_StateActuator.cpp trunk/blender/source/gameengine/Ketsji/KX_TouchSensor.cpp trunk/blender/source/gameengine/Ketsji/KX_TrackToActuator.cpp trunk/blender/source/gameengine/Ketsji/KX_VertexProxy.cpp trunk/blender/source/gameengine/Ketsji/KX_VisibilityActuator.cpp trunk/blender/source/gameengine/Physics/Sumo/Fuzzics/include/SM_Scene.h trunk/blender/source/gameengine/Physics/common/PHY_DynamicTypes.h Modified: trunk/blender/source/gameengine/Converter/BL_ShapeActionActuator.cpp === --- trunk/blender/source/gameengine/Converter/BL_ShapeActionActuator.cpp 2009-02-21 12:15:57 UTC (rev 19071) +++ trunk/blender/source/gameengine/Converter/BL_ShapeActionActuator.cpp 2009-02-21 12:43:24 UTC (rev 19072) @@ -911,6 +911,6 @@ printf("Invalid type for action actuator: %d\n", typeArg); /* error */ } -Py_Return; +Py_RETURN_NONE; } Modified: trunk/blender/source/gameengine/Expressions/ListValue.cpp === --- trunk/blender/source/gameengine/Expressions/ListValue.cpp 2009-02-21 12:15:57 UTC (rev 19071) +++ trunk/blender/source/gameengine/Expressions/ListValue.cpp 2009-02-21 12:43:24 UTC (rev 19072) @@ -429,7 +429,7 @@ { std::reverse(m_pValueArray.begin(),m_pValueArray.end()); - Py_Return; + Py_RETURN_NONE; } Modified: trunk/blender/source/gameengine/Expressions/PyObjectPlus.cpp === --- trunk/blender/source/gameengine/Expressions/PyObjectPlus.cpp 2009-02-21 12:15:57 UTC (rev 19071) +++ trunk/blender/source/gameengine/Expressions/PyObjectPlus.cpp 2009-02-21 12:43:24 UTC (rev 19072) @@ -697,7 +697,6 @@ PyObject *PyObjectPlus::Py_isA(PyObject *value)// Python wrapper for isA { - char *mytypename; if (!PyString_Check(value)) { PyErr_SetString(PyExc_TypeError, "expected a string"); return NULL; Modified: trunk/blender/source/gameengine/Expressions/PyObjectPlus.h === --- trunk/blender/source/gameengine/Expressions/PyObjectPlus.h 2009-02-21 12:15:57 UTC (rev 19071) +++ tr
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [19071] trunk/blender/source/blender/ blenkernel/intern/modifier.c: [#18277] Segfault crash by editing mesh with subsurf+ParticleInstance modifiers
Revision: 19071 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=19071 Author: jaguarandi Date: 2009-02-21 13:15:57 +0100 (Sat, 21 Feb 2009) Log Message: --- [#18277] Segfault crash by editing mesh with subsurf+ParticleInstance modifiers particleInstanceModifier_applyModifier uses getVertCo,which is not implemented by ccgDM. getVertCo was used to simply perform a min/max, so it was fixed to use the apropriate min/max dm->getMinMax(dm, min_r, max_r); Maybe the fact ccgDM doesn't implements getVertCo/getVertNo is a bug, since it implements every other DM function and its strange those are left out. Modified Paths: -- trunk/blender/source/blender/blenkernel/intern/modifier.c Modified: trunk/blender/source/blender/blenkernel/intern/modifier.c === --- trunk/blender/source/blender/blenkernel/intern/modifier.c 2009-02-21 11:22:06 UTC (rev 19070) +++ trunk/blender/source/blender/blenkernel/intern/modifier.c 2009-02-21 12:15:57 UTC (rev 19071) @@ -6380,20 +6380,11 @@ psys->lattice=psys_get_lattice(ob, psys); if(psys->flag & (PSYS_HAIR_DONE|PSYS_KEYED)){ - float co[3]; - for(i=0; i< totvert; i++){ - dm->getVertCo(dm,i,co); - if(i==0){ - min_co=max_co=co[track]; - } - else{ - if(co[track]max_co) - max_co=co[track]; - } - } + float min_r[3], max_r[3]; + dm->getMinMax(dm, min_r, max_r); + min_co=min_r[track]; + max_co=max_r[track]; } result = CDDM_from_template(dm, maxvert,dm->getNumEdges(dm)*totpart,maxface); ___ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [19070] branches/blender2.5/blender/source /blender/editors: Graph Editor: NKEY panel - added code to retrieve ' active F-Curve'
Revision: 19070 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=19070 Author: aligorith Date: 2009-02-21 12:22:06 +0100 (Sat, 21 Feb 2009) Log Message: --- Graph Editor: NKEY panel - added code to retrieve 'active F-Curve' Currently, this is just used to print the 'name' of the active F-Curve in a panel for verification purposes. This is the recommended way of getting this info. Modified Paths: -- branches/blender2.5/blender/source/blender/editors/animation/anim_filter.c branches/blender2.5/blender/source/blender/editors/include/ED_anim_api.h branches/blender2.5/blender/source/blender/editors/space_graph/graph_buttons.c Modified: branches/blender2.5/blender/source/blender/editors/animation/anim_filter.c === --- branches/blender2.5/blender/source/blender/editors/animation/anim_filter.c 2009-02-21 10:38:58 UTC (rev 19069) +++ branches/blender2.5/blender/source/blender/editors/animation/anim_filter.c 2009-02-21 11:22:06 UTC (rev 19070) @@ -511,12 +511,15 @@ if (!(filter_mode & ANIMFILTER_FOREDIT) || EDITABLE_FCU(fcu)) { /* only include this curve if selected */ if (!(filter_mode & ANIMFILTER_SEL) || (SEL_FCU(fcu))) { - /* owner/ownertype will be either object or action-channel, depending if it was dopesheet or part of an action */ - ale= make_new_animlistelem(fcu, ANIMTYPE_FCURVE, owner, ownertype, owner_id); - - if (ale) { - BLI_addtail(anim_data, ale); - items++; + /* only include if this curve is active */ + if (!(filter_mode & ANIMFILTER_ACTIVE) || (fcu->flag & FCURVE_ACTIVE)) { + /* owner/ownertype will be either object or action-channel, depending if it was dopesheet or part of an action */ + ale= make_new_animlistelem(fcu, ANIMTYPE_FCURVE, owner, ownertype, owner_id); + + if (ale) { + BLI_addtail(anim_data, ale); + items++; + } } } } Modified: branches/blender2.5/blender/source/blender/editors/include/ED_anim_api.h === --- branches/blender2.5/blender/source/blender/editors/include/ED_anim_api.h 2009-02-21 10:38:58 UTC (rev 19069) +++ branches/blender2.5/blender/source/blender/editors/include/ED_anim_api.h 2009-02-21 11:22:06 UTC (rev 19070) @@ -154,6 +154,7 @@ ANIMFILTER_CHANNELS = (1<<4), /* make list for interface drawing */ ANIMFILTER_ACTGROUPED = (1<<5), /* belongs to the active actiongroup */ ANIMFILTER_CURVEVISIBLE = (1<<6), /* F-Curve is visible for editing/viewing in Graph Editor */ + ANIMFILTER_ACTIVE = (1<<7), /* channel should be 'active' */ // FIXME: this is only relevant for F-Curves for now } eAnimFilter_Flags; Modified: branches/blender2.5/blender/source/blender/editors/space_graph/graph_buttons.c === --- branches/blender2.5/blender/source/blender/editors/space_graph/graph_buttons.c 2009-02-21 10:38:58 UTC (rev 19069) +++ branches/blender2.5/blender/source/blender/editors/space_graph/graph_buttons.c 2009-02-21 11:22:06 UTC (rev 19070) @@ -96,20 +96,24 @@ } -static void graph_panel_properties(const bContext *C, ARegion *ar, short cntrl)// GRAPH_HANDLER_SETTINGS +static void graph_panel_properties(const bContext *C, ARegion *ar, short cntrl, bAnimListElem *ale)// GRAPH_HANDLER_SETTINGS { - //ScrArea *sa= CTX_wm_area(C); - //Scene *scene= CTX_data_scene(C); uiBlock *block; + char name[128]; block= uiBeginBlock(C, ar, "graph_panel_properties", UI_EMBOSS, UI_HELV); if(uiNewPanel(C, ar, block, "Properties", "Graph", 340, 30, 318, 254)==0) return; uiBlockSetHandleFunc(block, do_graph_region_buttons, NULL); /* to force height */ - uiNewPanelHeight(block, 264); + uiNewPanelHeight(block, 204); - uiDefBut(block, LABEL, 1, "Testing", 10, 220, 150, 19, NULL, 0.0, 0.0, 0, 0, ""); + // XXX testing buttons + uiD
[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [19069] branches/blender2.5/blender/source /blender/editors/space_graph: Graph Editor: Started adding the missing NKEY panel stuff
Revision: 19069 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=19069 Author: aligorith Date: 2009-02-21 11:38:58 +0100 (Sat, 21 Feb 2009) Log Message: --- Graph Editor: Started adding the missing NKEY panel stuff Only a dummy pannel for now. I'll add some basic examples of relevant buttons + ways to use them soon. Modified Paths: -- branches/blender2.5/blender/source/blender/editors/space_graph/graph_draw.c branches/blender2.5/blender/source/blender/editors/space_graph/graph_intern.h branches/blender2.5/blender/source/blender/editors/space_graph/graph_ops.c branches/blender2.5/blender/source/blender/editors/space_graph/space_graph.c Added Paths: --- branches/blender2.5/blender/source/blender/editors/space_graph/graph_buttons.c Added: branches/blender2.5/blender/source/blender/editors/space_graph/graph_buttons.c === --- branches/blender2.5/blender/source/blender/editors/space_graph/graph_buttons.c (rev 0) +++ branches/blender2.5/blender/source/blender/editors/space_graph/graph_buttons.c 2009-02-21 10:38:58 UTC (rev 19069) @@ -0,0 +1,168 @@ +/** + * $Id: + * + * * BEGIN GPL LICENSE BLOCK * + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * + * The Original Code is Copyright (C) 2009 Blender Foundation. + * All rights reserved. + * + * + * Contributor(s): Blender Foundation, Joshua Leung + * + * * END GPL LICENSE BLOCK * + */ + +#include +#include +#include +#include + +#include "DNA_anim_types.h" +#include "DNA_action_types.h" +#include "DNA_object_types.h" +#include "DNA_space_types.h" +#include "DNA_scene_types.h" +#include "DNA_screen_types.h" +#include "DNA_userdef_types.h" + +#include "MEM_guardedalloc.h" + +#include "BLI_arithb.h" +#include "BLI_blenlib.h" +#include "BLI_editVert.h" +#include "BLI_rand.h" + +#include "BKE_animsys.h" +#include "BKE_action.h" +#include "BKE_context.h" +#include "BKE_curve.h" +#include "BKE_customdata.h" +#include "BKE_depsgraph.h" +#include "BKE_object.h" +#include "BKE_global.h" +#include "BKE_scene.h" +#include "BKE_screen.h" +#include "BKE_utildefines.h" + +#include "BIF_gl.h" + +#include "WM_api.h" +#include "WM_types.h" + +#include "RNA_access.h" +#include "RNA_define.h" + +#include "ED_anim_api.h" +#include "ED_keyframing.h" +#include "ED_screen.h" +#include "ED_types.h" +#include "ED_util.h" + +#include "UI_interface.h" +#include "UI_resources.h" +#include "UI_view2d.h" + +#include "graph_intern.h" // own include + + +/* *** view3d space & buttons ** */ +#define B_NOP 1 +#define B_REDR 2 + +static void do_graph_region_buttons(bContext *C, void *arg, int event) +{ + //Scene *scene= CTX_data_scene(C); + + switch(event) { + + } + + /* default for now */ + //WM_event_add_notifier(C, NC_OBJECT|ND_TRANSFORM, ob); +} + + +static void graph_panel_properties(const bContext *C, ARegion *ar, short cntrl)// GRAPH_HANDLER_SETTINGS +{ + //ScrArea *sa= CTX_wm_area(C); + //Scene *scene= CTX_data_scene(C); + uiBlock *block; + + block= uiBeginBlock(C, ar, "graph_panel_properties", UI_EMBOSS, UI_HELV); + if(uiNewPanel(C, ar, block, "Properties", "Graph", 340, 30, 318, 254)==0) return; + uiBlockSetHandleFunc(block, do_graph_region_buttons, NULL); + + /* to force height */ + uiNewPanelHeight(block, 264); + + uiDefBut(block, LABEL, 1, "Testing", 10, 220, 150, 19, NULL, 0.0, 0.0, 0, 0, ""); +#if 0 + uiBlockBeginAlign(block); + uiDefButF(block, NUM, B_REDR, "Spacing:", 10, 200, 140, 19, &v3d->grid, 0.001, 100.0, 10, 0, "Set the distance between grid lines"); + uiDefButS(block, NUM, B_REDR, "Lines:", 10, 180, 140, 19, &v3d->gridlines, 0.0, 100.0, 100, 0, "Set the number of grid lines in perspective view"); + uiDefButS(block, NUM, B_REDR, "Divisions:", 10, 160, 140, 19, &v3d->gridsubdiv, 1.0, 100.0, 100, 0, "Set the number of grid lines"); + uiBlockEndAlign(block); +#endif +} + + + +void graph_region_buttons(const bContext