diff options
author | Matt Ebb <matt@mke3.net> | 2009-08-25 05:37:08 +0400 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2009-08-25 05:37:08 +0400 |
commit | ea97a373834ea956ad0778b2c535452a6ecb1752 (patch) | |
tree | 9da83b01797e1697bc6f99e999bee927e072b3e0 /source/blender/editors | |
parent | 90895fce8ca4f40bd41026b0406d80e8e83e0e8d (diff) | |
parent | 4a78b9e9046567e86ed3ccada83a50c43684facd (diff) |
svn merge -r 22628:22753 https://svn.blender.org/svnroot/bf-blender/branches/blender2.5/blendervolume25
Diffstat (limited to 'source/blender/editors')
24 files changed, 244 insertions, 1789 deletions
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index acf7467713b..0ef470a698e 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -79,6 +79,7 @@ #include "UI_view2d.h" #include "ED_anim_api.h" +#include "ED_keyframing.h" #include "ED_keyframes_edit.h" // XXX move the select modes out of there! #include "ED_screen.h" #include "ED_space_api.h" @@ -1869,13 +1870,14 @@ void ANIM_channel_setting_set (bAnimContext *ac, bAnimListElem *ale, int setting // XXX hardcoded size of icons #define ICON_WIDTH 17 +// XXX hardcoded width of sliders +#define SLIDER_WIDTH 70 /* Draw the given channel */ // TODO: make this use UI controls for the buttons void ANIM_channel_draw (bAnimContext *ac, bAnimListElem *ale, float yminc, float ymaxc) { bAnimChannelType *acf= ANIM_channel_get_typeinfo(ale); - View2D *v2d= &ac->ar->v2d; short selected, offset; float y, ymid, ytext; @@ -1970,27 +1972,7 @@ void ANIM_channel_draw (bAnimContext *ac, bAnimListElem *ale, float yminc, float offset += 3; UI_DrawString(offset, ytext, name); } - - /* step 6) draw mute+protection toggles + (sliders) ....................... */ - /* reset offset - now goes from RHS of panel */ - offset = 0; - - // TODO: we need a mechanism of drawing over (and hiding) stuff from here... - // TODO: when drawing sliders, make those draw instead of these toggles if not enough space - - if (v2d) { - /* protect... */ - if (acf->has_setting(ac, ale, ACHANNEL_SETTING_PROTECT)) { - /* just skip - drawn as widget now */ - offset += ICON_WIDTH; - } - /* mute... */ - if (acf->has_setting(ac, ale, ACHANNEL_SETTING_MUTE)) { - /* just skip - drawn as widget now */ - offset += ICON_WIDTH; } - } -} /* ------------------ */ @@ -2000,6 +1982,44 @@ static void achannel_setting_widget_cb(bContext *C, void *poin, void *poin2) WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL); } +/* callback for widget sliders - insert keyframes */ +static void achannel_setting_slider_cb(bContext *C, void *id_poin, void *fcu_poin) +{ + ID *id= (ID *)id_poin; + FCurve *fcu= (FCurve *)fcu_poin; + + Scene *scene= CTX_data_scene(C); + PointerRNA id_ptr, ptr; + PropertyRNA *prop; + short flag=0, done=0; + float cfra; + + /* get current frame */ + // NOTE: this will do for now... + cfra= (float)CFRA; + + /* get flags for keyframing */ + if (IS_AUTOKEY_FLAG(INSERTNEEDED)) + flag |= INSERTKEY_NEEDED; + if (IS_AUTOKEY_FLAG(AUTOMATKEY)) + flag |= INSERTKEY_MATRIX; + + + /* get RNA pointer, and resolve the path */ + RNA_id_pointer_create(id, &id_ptr); + + /* try to resolve the path stored in the F-Curve */ + if (RNA_path_resolve(&id_ptr, fcu->rna_path, &ptr, &prop)) { + /* insert a keyframe for this F-Curve */ + done= insert_keyframe_direct(ptr, prop, fcu, cfra, flag); + + if (done) + WM_event_add_notifier(C, NC_ANIMATION|ND_ANIMCHAN_EDIT, NULL); + } +} + + + /* Draw a widget for some setting */ static void draw_setting_widget (bAnimContext *ac, bAnimListElem *ale, bAnimChannelType *acf, uiBlock *block, int xpos, int ypos, int setting) { @@ -2164,6 +2184,28 @@ void ANIM_channel_draw_widgets (bAnimContext *ac, bAnimListElem *ale, uiBlock *b // TODO: when drawing sliders, make those draw instead of these toggles if not enough space if (v2d) { + short draw_sliders = 0; + + /* check if we need to show the sliders */ + if ((ac->sa) && ELEM(ac->spacetype, SPACE_ACTION, SPACE_IPO)) { + switch (ac->spacetype) { + case SPACE_ACTION: + { + SpaceAction *saction= (SpaceAction *)ac->sa->spacedata.first; + draw_sliders= (saction->flag & SACTION_SLIDERS); + } + break; + case SPACE_IPO: + { + SpaceIpo *sipo= (SpaceIpo *)ac->sa->spacedata.first; + draw_sliders= (sipo->flag & SIPO_SLIDERS); + } + break; + } + } + + /* check if there's enough space for the toggles if the sliders are drawn too */ + if ( !(draw_sliders) || ((v2d->mask.xmax-v2d->mask.xmin) > ACHANNEL_BUTTON_WIDTH/2) ) { /* protect... */ if (acf->has_setting(ac, ale, ACHANNEL_SETTING_PROTECT)) { offset += ICON_WIDTH; @@ -2175,6 +2217,44 @@ void ANIM_channel_draw_widgets (bAnimContext *ac, bAnimListElem *ale, uiBlock *b draw_setting_widget(ac, ale, acf, block, (int)v2d->cur.xmax-offset, ymid, ACHANNEL_SETTING_MUTE); } } + + /* draw slider + * - even if we can draw sliders for this view, we must also check that the channel-type supports them + * (only only F-Curves really can support them for now) + * - to make things easier, we use RNA-autobuts for this so that changes are reflected immediately, + * whereever they occurred. BUT, we don't use the layout engine, otherwise we'd get wrong alignment, + * and wouldn't be able to auto-keyframe... + * - slider should start before the toggles (if they're visible) to keep a clean line down the side + */ + if ((draw_sliders) && (ale->type == ANIMTYPE_FCURVE)) { + /* adjust offset */ + offset += SLIDER_WIDTH; + + /* need backdrop behind sliders... */ + uiBlockSetEmboss(block, UI_EMBOSS); + + if (ale->id) { /* Slider using RNA Access -------------------- */ + FCurve *fcu= (FCurve *)ale->data; + PointerRNA id_ptr, ptr; + PropertyRNA *prop; + + /* get RNA pointer, and resolve the path */ + RNA_id_pointer_create(ale->id, &id_ptr); + + /* try to resolve the path */ + if (RNA_path_resolve(&id_ptr, fcu->rna_path, &ptr, &prop)) { + uiBut *but; + + /* create the slider button, and assign relevant callback to ensure keyframes are inserted... */ + but= uiDefAutoButR(block, &ptr, prop, fcu->array_index, "", 0, (int)v2d->cur.xmax-offset, ymid, SLIDER_WIDTH, (int)ymaxc-yminc); + uiButSetFunc(but, achannel_setting_slider_cb, ale->id, fcu); +} + } + else { /* Special Slider for stuff without RNA Access ---------- */ + // TODO: only implement this case when we really need it... + } + } + } } /* *********************************************** */ diff --git a/source/blender/editors/animation/anim_ipo_utils.c b/source/blender/editors/animation/anim_ipo_utils.c index 394cc53dda2..ecf0bdbf285 100644 --- a/source/blender/editors/animation/anim_ipo_utils.c +++ b/source/blender/editors/animation/anim_ipo_utils.c @@ -93,9 +93,8 @@ int geticon_anim_blocktype(short blocktype) } /* Write into "name" buffer, the name of the property (retrieved using RNA from the curve's settings) - * WARNING: name buffer we're writing to cannot exceed 128 chars (check action_draw.c for details) + * WARNING: name buffer we're writing to cannot exceed 256 chars (check anim_channels_defines.c for details) */ -// TODO: have an extra var to indicate if prop was valid? void getname_anim_fcurve(char *name, ID *id, FCurve *fcu) { /* sanity checks */ diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index 2da082a9b7c..b62c69c7b38 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -740,6 +740,12 @@ short insert_keyframe_direct (PointerRNA ptr, PropertyRNA *prop, FCurve *fcu, fl printf("ERROR: no F-Curve to add keyframes to \n"); return 0; } + /* F-Curve not editable? */ + if ( (fcu->flag & FCURVE_PROTECTED) || ((fcu->grp) && (fcu->grp->flag & AGRP_PROTECTED)) ) { + if (G.f & G_DEBUG) + printf("WARNING: not inserting keyframe for locked F-Curve \n"); + return 0; + } /* if no property given yet, try to validate from F-Curve info */ if ((ptr.id.data == NULL) && (ptr.data==NULL)) { @@ -911,8 +917,19 @@ short delete_keyframe (ID *id, bAction *act, const char group[], const char rna_ /* we don't check the validity of the path here yet, but it should be ok... */ fcu= verify_fcurve(act, group, rna_path, array_index, 0); - /* only continue if we have an F-Curve to remove keyframes from */ - if (act && fcu) { + /* check if F-Curve exists and/or whether it can be edited */ + if ELEM(NULL, act, fcu) { + printf("ERROR: no F-Curve and/or Action to delete keyframe from \n"); + return 0; + } + if ( (fcu->flag & FCURVE_PROTECTED) || ((fcu->grp) && (fcu->grp->flag & AGRP_PROTECTED)) ) { + if (G.f & G_DEBUG) + printf("WARNING: not inserting keyframe for locked F-Curve \n"); + return 0; + } + + /* it should be fine to continue now... */ + { short found = -1; int i; diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 5f93743493a..0cb6964b39e 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -645,7 +645,6 @@ void uiTemplateImageLayers(uiLayout *layout, struct bContext *C, struct Image *i void uiTemplateRunningJobs(uiLayout *layout, struct bContext *C); void uiTemplateOperatorSearch(uiLayout *layout); void uiTemplateHeader3D(uiLayout *layout, struct bContext *C); -void uiTemplate_view3d_select_metaballmenu(uiLayout *layout, struct bContext *C); void uiTemplate_view3d_select_faceselmenu(uiLayout *layout, struct bContext *C); void uiTemplateTextureImage(uiLayout *layout, struct bContext *C, struct Tex *tex); diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c index 8676fe62a3a..3b4471bd4b9 100644 --- a/source/blender/editors/interface/interface_layout.c +++ b/source/blender/editors/interface/interface_layout.c @@ -793,11 +793,11 @@ static void ui_item_rna_size(uiLayout *layout, char *name, int icon, PropertyRNA } else if(ui_layout_vary_direction(layout) == UI_ITEM_VARY_X) { if(type == PROP_BOOLEAN && strcmp(name, "") != 0) - w += UI_UNIT_X; + w += UI_UNIT_X/5; else if(type == PROP_ENUM) w += UI_UNIT_X/2; else if(type == PROP_FLOAT || type == PROP_INT) - w += UI_UNIT_X*2; + w += UI_UNIT_X*3; } *r_w= w; diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 48de2343c97..a55b11afe48 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -1085,7 +1085,7 @@ static struct uiWidgetColors wcol_tool= { {255, 255, 255, 255}, 1, - 25, -25 + 15, -15 }; static struct uiWidgetColors wcol_box= { @@ -1897,7 +1897,7 @@ static void widget_swatch(uiBut *but, uiWidgetColors *wcol, rcti *rect, int stat widget_init(&wtb); /* half rounded */ - round_box_edges(&wtb, roundboxalign, rect, 4.0f); + round_box_edges(&wtb, roundboxalign, rect, 5.0f); ui_get_but_vectorf(but, col); wcol->inner[0]= FTOCHAR(col[0]); @@ -1916,7 +1916,7 @@ static void widget_textbut(uiWidgetColors *wcol, rcti *rect, int state, int roun widget_init(&wtb); /* half rounded */ - round_box_edges(&wtb, roundboxalign, rect, 5.0f); + round_box_edges(&wtb, roundboxalign, rect, 4.0f); widgetbase_draw(&wtb, wcol); @@ -1950,8 +1950,8 @@ static void widget_pulldownbut(uiWidgetColors *wcol, rcti *rect, int state, int widget_init(&wtb); - /* fully rounded */ - round_box_edges(&wtb, 15, rect, rad); + /* half rounded */ + round_box_edges(&wtb, 15, rect, 4.0f); widgetbase_draw(&wtb, wcol); } @@ -2049,8 +2049,8 @@ static void widget_roundbut(uiWidgetColors *wcol, rcti *rect, int state, int rou widget_init(&wtb); - /* fully rounded */ - round_box_edges(&wtb, roundboxalign, rect, rad); + /* half rounded */ + round_box_edges(&wtb, roundboxalign, rect, 5.0f); widgetbase_draw(&wtb, wcol); } diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c index 5b51d898235..8aaede7515a 100644 --- a/source/blender/editors/interface/resources.c +++ b/source/blender/editors/interface/resources.c @@ -445,6 +445,7 @@ void ui_theme_init_userdef(void) SETCOL(btheme->tv3d.text_hi, 255, 255, 255, 255); SETCOLF(btheme->tv3d.header, 0.45, 0.45, 0.45, 1.0); + SETCOLF(btheme->tv3d.button, 0.45, 0.45, 0.45, 1.0); SETCOL(btheme->tv3d.panel, 165, 165, 165, 127); SETCOL(btheme->tv3d.shade1, 160, 160, 160, 100); diff --git a/source/blender/editors/mesh/editmesh_mods.c b/source/blender/editors/mesh/editmesh_mods.c index d27aa3f7e3a..f2c5b7fb727 100644 --- a/source/blender/editors/mesh/editmesh_mods.c +++ b/source/blender/editors/mesh/editmesh_mods.c @@ -4349,7 +4349,7 @@ void MESH_OT_vertices_smooth(wmOperatorType *ot) /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; - RNA_def_int(ot->srna, "repeat", 1, 1, 100, "Number of times to smooth the mesh", "", 1, INT_MAX); + RNA_def_int(ot->srna, "repeat", 1, 1, 100, "Smooth Iterations", "", 1, INT_MAX); } void vertexnoise(Object *obedit, EditMesh *em) @@ -4475,7 +4475,8 @@ void MESH_OT_vertices_transform_to_sphere(wmOperatorType *ot) { /* identifiers */ ot->name= "Vertices to Sphere"; - ot->description= "Move selected vertices outward in a spherical shape."; + //added "around cursor" to differentiate between "TFM_OT_tosphere()" + ot->description= "Move selected vertices outward in a spherical shape around cursor."; ot->idname= "MESH_OT_vertices_transform_to_sphere"; /* api callbacks */ diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 380390cf543..799bb0741f3 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -3329,7 +3329,6 @@ void ED_keymap_screen(wmWindowManager *wm) WM_keymap_verify_item(keymap, "SCREEN_OT_repeat_history", F3KEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "SCREEN_OT_repeat_last", RKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "SCREEN_OT_repeat_last", RKEY, KM_PRESS, KM_OSKEY, 0); - WM_keymap_add_item(keymap, "SCREEN_OT_repeat_last", F4KEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "SCREEN_OT_region_flip", F5KEY, KM_PRESS, 0, 0); WM_keymap_verify_item(keymap, "SCREEN_OT_redo_last", F6KEY, KM_PRESS, 0, 0); @@ -3348,18 +3347,17 @@ void ED_keymap_screen(wmWindowManager *wm) /* render */ WM_keymap_add_item(keymap, "SCREEN_OT_render", F12KEY, KM_PRESS, 0, 0); - WM_keymap_add_item(keymap, "SCREEN_OT_render", RETKEY, KM_PRESS, KM_CTRL, 0); - WM_keymap_add_item(keymap, "SCREEN_OT_render", RETKEY, KM_PRESS, KM_OSKEY, 0); +// WM_keymap_add_item(keymap, "SCREEN_OT_render", RETKEY, KM_PRESS, KM_CTRL, 0); +// WM_keymap_add_item(keymap, "SCREEN_OT_render", RETKEY, KM_PRESS, KM_OSKEY, 0); RNA_boolean_set(WM_keymap_add_item(keymap, "SCREEN_OT_render", F12KEY, KM_PRESS, KM_CTRL, 0)->ptr, "animation", 1); - RNA_boolean_set(WM_keymap_add_item(keymap, "SCREEN_OT_render", RETKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0)->ptr, "animation", 1); - RNA_boolean_set(WM_keymap_add_item(keymap, "SCREEN_OT_render", RETKEY, KM_PRESS, KM_OSKEY|KM_SHIFT, 0)->ptr, "animation", 1); +// RNA_boolean_set(WM_keymap_add_item(keymap, "SCREEN_OT_render", RETKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0)->ptr, "animation", 1); +// RNA_boolean_set(WM_keymap_add_item(keymap, "SCREEN_OT_render", RETKEY, KM_PRESS, KM_OSKEY|KM_SHIFT, 0)->ptr, "animation", 1); WM_keymap_add_item(keymap, "SCREEN_OT_render_view_cancel", ESCKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "SCREEN_OT_render_view_show", F11KEY, KM_PRESS, 0, 0); /* user prefs */ WM_keymap_add_item(keymap, "SCREEN_OT_userpref_show", COMMAKEY, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "SCREEN_OT_userpref_show", COMMAKEY, KM_PRESS, KM_OSKEY, 0); - WM_keymap_add_item(keymap, "SCREEN_OT_userpref_show", UKEY, KM_PRESS, KM_ALT, 0); /* Anim Playback ------------------------------------------------ */ keymap= WM_keymap_listbase(wm, "Frames", 0, 0); diff --git a/source/blender/editors/sculpt_paint/sculpt_stroke.c b/source/blender/editors/sculpt_paint/sculpt_stroke.c deleted file mode 100644 index 554ff580358..00000000000 --- a/source/blender/editors/sculpt_paint/sculpt_stroke.c +++ /dev/null @@ -1,274 +0,0 @@ -/* - * $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) 2007 by Nicholas Bishop - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - * - * Storage and manipulation of sculptmode brush strokes. - * - */ - -#include "MEM_guardedalloc.h" - -#include "DNA_listBase.h" -#include "DNA_scene_types.h" - -#include "BKE_sculpt.h" -#include "BLI_blenlib.h" -#include "BIF_gl.h" - -#include "sculpt_intern.h" - -#include <math.h> - -/* Temporary storage of input stroke control points */ -typedef struct StrokePoint { - struct StrokePoint *next, *prev; - short x, y; -} StrokePoint; -typedef struct SculptStroke { - short (*loc)[2]; - int max; - int index; - float length; - ListBase final; - StrokePoint *final_mem; - float offset; -} SculptStroke; - -SculptStroke *sculpt_stroke_new(const int max) -{ - SculptStroke *stroke = MEM_callocN(sizeof(SculptStroke), "SculptStroke"); - stroke->loc = MEM_callocN(sizeof(short) * 4 * max, "SculptStroke.loc"); - stroke->max = max; - stroke->index = -1; - return stroke; -} - -void sculpt_stroke_free(SculptStroke *stroke) -{ - if(stroke) { - if(stroke->loc) MEM_freeN(stroke->loc); - if(stroke->final_mem) MEM_freeN(stroke->final_mem); - - MEM_freeN(stroke); - } -} - -void sculpt_stroke_add_point(SculptStroke *stroke, const short x, const short y) -{ - const int next = stroke->index + 1; - - if(stroke->index == -1) { - stroke->loc[0][0] = x; - stroke->loc[0][1] = y; - stroke->index = 0; - } - else if(next < stroke->max) { - const int dx = x - stroke->loc[stroke->index][0]; - const int dy = y - stroke->loc[stroke->index][1]; - stroke->loc[next][0] = x; - stroke->loc[next][1] = y; - stroke->length += sqrt(dx*dx + dy*dy); - stroke->index = next; - } -} - -static void sculpt_stroke_smooth(SculptStroke *stroke) -{ - /* Apply smoothing (exclude the first and last points)*/ - StrokePoint *p = stroke->final.first; - if(p && p->next && p->next->next) { - for(p = p->next->next; p && p->next && p->next->next; p = p->next) { - p->x = p->prev->prev->x*0.1 + p->prev->x*0.2 + p->x*0.4 + p->next->x*0.2 + p->next->next->x*0.1; - p->y = p->prev->prev->y*0.1 + p->prev->y*0.2 + p->y*0.4 + p->next->y*0.2 + p->next->next->y*0.1; - } - } -} - -static void sculpt_stroke_create_final(SculptStroke *stroke) -{ - if(stroke) { - StrokePoint *p, *pnext; - int i; - - /* Copy loc into final */ - if(stroke->final_mem) - MEM_freeN(stroke->final_mem); - stroke->final_mem = MEM_callocN(sizeof(StrokePoint) * (stroke->index + 1) * 2, "SculptStroke.final"); - stroke->final.first = stroke->final.last = NULL; - for(i = 0; i <= stroke->index; ++i) { - p = &stroke->final_mem[i]; - p->x = stroke->loc[i][0]; - p->y = stroke->loc[i][1]; - BLI_addtail(&stroke->final, p); - } - - /* Remove shortest edges */ - if(stroke->final.first) { - for(p = ((StrokePoint*)stroke->final.first)->next; p && p->next; p = pnext) { - const int dx = p->x - p->prev->x; - const int dy = p->y - p->prev->y; - const float len = sqrt(dx*dx + dy*dy); - pnext = p->next; - if(len < 10) { - BLI_remlink(&stroke->final, p); - } - } - } - - sculpt_stroke_smooth(stroke); - - /* Subdivide edges */ - for(p = stroke->final.first; p && p->next; p = pnext) { - StrokePoint *np = &stroke->final_mem[i++]; - - pnext = p->next; - np->x = (p->x + p->next->x) / 2; - np->y = (p->y + p->next->y) / 2; - BLI_insertlink(&stroke->final, p, np); - } - - sculpt_stroke_smooth(stroke); - } -} - -static float sculpt_stroke_seglen(StrokePoint *p1, StrokePoint *p2) -{ - int dx = p2->x - p1->x; - int dy = p2->y - p1->y; - return sqrt(dx*dx + dy*dy); -} - -static float sculpt_stroke_final_length(SculptStroke *stroke) -{ - StrokePoint *p; - float len = 0; - for(p = stroke->final.first; p && p->next; ++p) - len += sculpt_stroke_seglen(p, p->next); - return len; -} - -/* If partial is nonzero, cuts off apply after that length has been processed */ -static StrokePoint *sculpt_stroke_apply_generic(Sculpt *sd, SculptStroke *stroke, const int partial) -{ - const int sdspace = 0; //XXX: sd->spacing; - const short spacing = sdspace > 0 ? sdspace : 2; - const int dots = sculpt_stroke_final_length(stroke) / spacing; - int i; - StrokePoint *p = stroke->final.first; - float startloc = stroke->offset; - - for(i = 0; i < dots && p && p->next; ++i) { - const float dotloc = spacing * i; - short co[2]; - float len = sculpt_stroke_seglen(p, p->next); - float u, v; - - /* Find edge containing dot */ - while(dotloc > startloc + len && p && p->next && p->next->next) { - p = p->next; - startloc += len; - len = sculpt_stroke_seglen(p, p->next); - } - - if(!p || !p->next || dotloc > startloc + len) - break; - - if(partial && startloc > partial) { - /* Calculate offset for next stroke segment */ - stroke->offset = startloc + len - dotloc; - break; - } - - u = (dotloc - startloc) / len; - v = 1 - u; - - co[0] = p->x*v + p->next->x*u; - co[1] = p->y*v + p->next->y*u; - - //do_symmetrical_brush_actions(sd, a, co, NULL); - } - - return p ? p->next : NULL; -} - -void sculpt_stroke_apply(Sculpt *sd, SculptStroke *stroke) -{ - /* TODO: make these values user-modifiable? */ - const int partial_len = 100; - const int min_len = 200; - - if(stroke) { - sculpt_stroke_create_final(stroke); - - if(sculpt_stroke_final_length(stroke) > min_len) { - StrokePoint *p = sculpt_stroke_apply_generic(sd, stroke, partial_len); - - /* Replace remaining values in stroke->loc with remaining stroke->final values */ - stroke->index = -1; - stroke->length = 0; - for(; p; p = p->next) { - ++stroke->index; - stroke->loc[stroke->index][0] = p->x; - stroke->loc[stroke->index][1] = p->y; - if(p->next) { - stroke->length += sculpt_stroke_seglen(p, p->next); - } - } - } - } -} - -void sculpt_stroke_apply_all(Sculpt *sd, SculptStroke *stroke) -{ - sculpt_stroke_create_final(stroke); - - if(stroke) { - sculpt_stroke_apply_generic(sd, stroke, 0); - } -} - -/* XXX: drawing goes elsewhere */ -void sculpt_stroke_draw(SculptStroke *stroke) -{ - if(stroke) { - StrokePoint *p; - - /* Draws the original stroke */ - /*glColor3f(1, 0, 0); - glBegin(GL_LINE_STRIP); - for(i = 0; i <= stroke->index; ++i) - glVertex2s(stroke->loc[i][0], stroke->loc[i][1]); - glEnd();*/ - - /* Draws the smoothed stroke */ - glColor3f(0, 1, 0); - glBegin(GL_LINE_STRIP); - for(p = stroke->final.first; p; p = p->next) - glVertex2s(p->x, p->y); - glEnd(); - } -} diff --git a/source/blender/editors/space_action/action_draw.c b/source/blender/editors/space_action/action_draw.c index 4fb22064c17..1403b6c8ff6 100644 --- a/source/blender/editors/space_action/action_draw.c +++ b/source/blender/editors/space_action/action_draw.c @@ -92,307 +92,7 @@ #include "ED_screen.h" #include "ED_space_api.h" -#if 0 // XXX old includes for reference only - #include "BIF_editaction.h" - #include "BIF_editkey.h" - #include "BIF_editnla.h" - #include "BIF_drawgpencil.h" - #include "BIF_keyframing.h" - #include "BIF_language.h" - #include "BIF_space.h" - #include "BDR_editcurve.h" - #include "BDR_gpencil.h" - - #include "BSE_drawnla.h" - #include "BSE_drawipo.h" - #include "BSE_drawview.h" - #include "BSE_editaction_types.h" - #include "BSE_editipo.h" - #include "BSE_headerbuttons.h" - #include "BSE_time.h" - #include "BSE_view.h" -#endif // XXX old defines for reference only - -/* XXX */ -extern void gl_round_box(int mode, float minx, float miny, float maxx, float maxy, float rad); - -/********************************** Slider Stuff **************************** */ - -#if 0 // XXX all of this slider stuff will need a rethink! -/* sliders for shapekeys */ -static void meshactionbuts(SpaceAction *saction, Object *ob, Key *key) -{ - int i; - char str[64]; - float x, y; - uiBlock *block; - uiBut *but; - - /* lets make the shapekey sliders */ - - /* reset the damn myortho2 or the sliders won't draw/redraw - * correctly *grumble* - */ - mywinset(curarea->win); - myortho2(-0.375f, curarea->winx-0.375f, G.v2d->cur.ymin, G.v2d->cur.ymax); - - sprintf(str, "actionbuttonswin %d", curarea->win); - block= uiNewBlock (&curarea->uiblocks, str, UI_EMBOSS); - - x = ACHANNEL_NAMEWIDTH + 1; - y = 0.0f; - - uiBlockSetEmboss(block, UI_EMBOSSN); - - if (!(G.saction->flag & SACTION_SLIDERS)) { - ACTWIDTH = ACHANNEL_NAMEWIDTH; - but=uiDefIconButBitS(block, TOG, SACTION_SLIDERS, B_REDR, - ICON_DISCLOSURE_TRI_RIGHT, - ACHANNEL_NAMEWIDTH - XIC - 5, (short)y + CHANNELHEIGHT, - XIC,YIC-2, - &(G.saction->flag), 0, 0, 0, 0, - "Show action window sliders"); - /* no hilite, the winmatrix is not correct later on... */ - uiButSetFlag(but, UI_NO_HILITE); - } - else { - but= uiDefIconButBitS(block, TOG, SACTION_SLIDERS, B_REDR, - ICON_DISCLOSURE_TRI_DOWN, - ACHANNEL_NAMEWIDTH - XIC - 5, (short)y + CHANNELHEIGHT, - XIC,YIC-2, - &(G.saction->flag), 0, 0, 0, 0, - "Hide action window sliders"); - /* no hilite, the winmatrix is not correct later on... */ - uiButSetFlag(but, UI_NO_HILITE); - - ACTWIDTH = ACHANNEL_NAMEWIDTH + SLIDERWIDTH; - - /* sliders are open so draw them */ - BIF_ThemeColor(TH_FACE); - - glRects(ACHANNEL_NAMEWIDTH, 0, ACHANNEL_NAMEWIDTH+SLIDERWIDTH, curarea->winy); - uiBlockSetEmboss(block, UI_EMBOSS); - for (i=1; i < key->totkey; i++) { - make_rvk_slider(block, ob, i, - (int)x, (int)y, SLIDERWIDTH-2, CHANNELHEIGHT-1, "Slider to control Shape Keys"); - - y-=CHANNELHEIGHT+CHANNELSKIP; - - /* see sliderval array in editkey.c */ - if (i >= 255) break; - } - } - uiDrawBlock(C, block); -} - -static void icu_slider_func(void *voidicu, void *voidignore) -{ - /* the callback for the icu sliders ... copies the - * value from the icu->curval into a bezier at the - * right frame on the right ipo curve (creating both the - * ipo curve and the bezier if needed). - */ - IpoCurve *icu= voidicu; - BezTriple *bezt=NULL; - float cfra, icuval; - - cfra = frame_to_float(CFRA); - if (G.saction->pin==0 && OBACT) - cfra= get_action_frame(OBACT, cfra); - - /* if the ipocurve exists, try to get a bezier - * for this frame - */ - bezt = get_bezt_icu_time(icu, &cfra, &icuval); - - /* create the bezier triple if one doesn't exist, - * otherwise modify it's value - */ - if (bezt == NULL) { - insert_vert_icu(icu, cfra, icu->curval, 0); - } - else { - bezt->vec[1][1] = icu->curval; - } - - /* make sure the Ipo's are properly processed and - * redraw as necessary - */ - sort_time_ipocurve(icu); - testhandles_ipocurve(icu); - - /* nla-update (in case this affects anything) */ - synchronize_action_strips(); - - /* do redraw pushes, and also the depsgraph flushes */ - if (OBACT->pose || ob_get_key(OBACT)) - DAG_object_flush_update(G.scene, OBACT, OB_RECALC); - else - DAG_object_flush_update(G.scene, OBACT, OB_RECALC_OB); - - allqueue(REDRAWVIEW3D, 0); - allqueue(REDRAWACTION, 0); - allqueue(REDRAWNLA, 0); - allqueue(REDRAWIPO, 0); - allspace(REMAKEIPO, 0); - allqueue(REDRAWBUTSALL, 0); -} - -static void make_icu_slider(uiBlock *block, IpoCurve *icu, - int x, int y, int w, int h, char *tip) -{ - /* create a slider for the ipo-curve*/ - uiBut *but; - - if(icu == NULL) return; - - if (IS_EQ(icu->slide_max, icu->slide_min)) { - if (IS_EQ(icu->ymax, icu->ymin)) { - if (ELEM(icu->blocktype, ID_CO, ID_KE)) { - /* hack for constraints and shapekeys (and maybe a few others) */ - icu->slide_min= 0.0; - icu->slide_max= 1.0; - } - else { - icu->slide_min= -100; - icu->slide_max= 100; - } - } - else { - icu->slide_min= icu->ymin; - icu->slide_max= icu->ymax; - } - } - if (icu->slide_min >= icu->slide_max) { - SWAP(float, icu->slide_min, icu->slide_max); - } - - but=uiDefButF(block, NUMSLI, REDRAWVIEW3D, "", - x, y , w, h, - &(icu->curval), icu->slide_min, icu->slide_max, - 10, 2, tip); - - uiButSetFunc(but, icu_slider_func, icu, NULL); - - // no hilite, the winmatrix is not correct later on... - uiButSetFlag(but, UI_NO_HILITE); -} - -/* sliders for ipo-curves of active action-channel */ -static void action_icu_buts(SpaceAction *saction) -{ - ListBase act_data = {NULL, NULL}; - bActListElem *ale; - int filter; - void *data; - short datatype; - - char str[64]; - float x, y; - uiBlock *block; - - /* lets make the action sliders */ - - /* reset the damn myortho2 or the sliders won't draw/redraw - * correctly *grumble* - */ - mywinset(curarea->win); - myortho2(-0.375f, curarea->winx-0.375f, G.v2d->cur.ymin, G.v2d->cur.ymax); - - sprintf(str, "actionbuttonswin %d", curarea->win); - block= uiNewBlock (&curarea->uiblocks, str, UI_EMBOSS); - - x = (float)ACHANNEL_NAMEWIDTH + 1; - y = 0.0f; - - uiBlockSetEmboss(block, UI_EMBOSSN); - - if (G.saction->flag & SACTION_SLIDERS) { - /* sliders are open so draw them */ - - /* get editor data */ - data= get_action_context(&datatype); - if (data == NULL) return; - - /* build list of channels to draw */ - filter= (ACTFILTER_FORDRAWING|ACTFILTER_VISIBLE|ACTFILTER_CHANNELS); - actdata_filter(&act_data, filter, data, datatype); - - /* draw backdrop first */ - BIF_ThemeColor(TH_FACE); // change this color... it's ugly - glRects(ACHANNEL_NAMEWIDTH, (short)G.v2d->cur.ymin, ACHANNEL_NAMEWIDTH+SLIDERWIDTH, (short)G.v2d->cur.ymax); - - uiBlockSetEmboss(block, UI_EMBOSS); - for (ale= act_data.first; ale; ale= ale->next) { - const float yminc= y-CHANNELHEIGHT/2; - const float ymaxc= y+CHANNELHEIGHT/2; - - /* check if visible */ - if ( IN_RANGE(yminc, G.v2d->cur.ymin, G.v2d->cur.ymax) || - IN_RANGE(ymaxc, G.v2d->cur.ymin, G.v2d->cur.ymax) ) - { - /* determine what needs to be drawn */ - switch (ale->type) { - case ACTTYPE_CONCHAN: /* constraint channel */ - { - bActionChannel *achan = (bActionChannel *)ale->owner; - IpoCurve *icu = (IpoCurve *)ale->key_data; - - /* only show if owner is selected */ - if ((ale->ownertype == ACTTYPE_OBJECT) || SEL_ACHAN(achan)) { - make_icu_slider(block, icu, - (int)x, (int)y, SLIDERWIDTH-2, CHANNELHEIGHT-2, - "Slider to control current value of Constraint Influence"); - } - } - break; - case ACTTYPE_ICU: /* ipo-curve channel */ - { - bActionChannel *achan = (bActionChannel *)ale->owner; - IpoCurve *icu = (IpoCurve *)ale->key_data; - - /* only show if owner is selected */ - if ((ale->ownertype == ACTTYPE_OBJECT) || SEL_ACHAN(achan)) { - make_icu_slider(block, icu, - (int)x, (int)y, SLIDERWIDTH-2, CHANNELHEIGHT-2, - "Slider to control current value of IPO-Curve"); - } - } - break; - case ACTTYPE_SHAPEKEY: /* shapekey channel */ - { - Object *ob= (Object *)ale->id; - IpoCurve *icu= (IpoCurve *)ale->key_data; - - // TODO: only show if object is active - if (icu) { - make_icu_slider(block, icu, - (int)x, (int)y, SLIDERWIDTH-2, CHANNELHEIGHT-2, - "Slider to control ShapeKey"); - } - else if (ob && ale->index) { - make_rvk_slider(block, ob, ale->index, - (int)x, (int)y, SLIDERWIDTH-2, CHANNELHEIGHT-1, "Slider to control Shape Keys"); - } - } - break; - } - } - - /* adjust y-position for next one */ - y-=CHANNELHEIGHT+CHANNELSKIP; - } - - /* free tempolary channels */ - BLI_freelistN(&act_data); - } - uiDrawBlock(C, block); -} - -#endif // XXX all of this slider stuff will need a rethink - - /* ************************************************************************* */ /* Channel List */ @@ -518,7 +218,6 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar) adt= ANIM_nla_mapping_get(ac, NULL); /* start and end of action itself */ - // TODO: this has not had scaling applied calc_action_range(ac->data, &act_start, &act_end, 0); } @@ -550,43 +249,14 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *ar) if ( IN_RANGE(yminc, v2d->cur.ymin, v2d->cur.ymax) || IN_RANGE(ymaxc, v2d->cur.ymin, v2d->cur.ymax) ) { + bAnimChannelType *acf= ANIM_channel_get_typeinfo(ale); int sel=0; /* determine if any need to draw channel */ if (ale->datatype != ALE_NONE) { /* determine if channel is selected */ - switch (ale->type) { - case ANIMTYPE_SCENE: - { - Scene *sce= (Scene *)ale->data; - sel = SEL_SCEC(sce); - } - break; - case ANIMTYPE_OBJECT: - { - Base *base= (Base *)ale->data; - sel = SEL_OBJC(base); - } - break; - case ANIMTYPE_GROUP: - { - bActionGroup *agrp = (bActionGroup *)ale->data; - sel = SEL_AGRP(agrp); - } - break; - case ANIMTYPE_FCURVE: - { - FCurve *fcu = (FCurve *)ale->data; - sel = SEL_FCU(fcu); - } - break; - case ANIMTYPE_GPLAYER: - { - bGPDlayer *gpl = (bGPDlayer *)ale->data; - sel = SEL_GPL(gpl); - } - break; - } + if (acf->has_setting(ac, ale, ACHANNEL_SETTING_SELECT)) + sel= ANIM_channel_setting_get(ac, ale, ACHANNEL_SETTING_SELECT); if (ELEM(ac->datatype, ANIMCONT_ACTION, ANIMCONT_DOPESHEET)) { switch (ale->type) { diff --git a/source/blender/editors/space_action/action_header.c b/source/blender/editors/space_action/action_header.c index 375136d199e..33a97b5a80a 100644 --- a/source/blender/editors/space_action/action_header.c +++ b/source/blender/editors/space_action/action_header.c @@ -404,13 +404,13 @@ void action_header_buttons(const bContext *C, ARegion *ar) if (saction->flag & SACTION_DRAWTIME) { uiDefButC(block, MENU, B_REDR, "Auto-Snap Keyframes %t|No Snap %x0|Second Step %x1|Nearest Second %x2|Nearest Marker %x3", - xco,yco,70,YIC, &(saction->autosnap), 0, 1, 0, 0, + xco,yco,90,YIC, &(saction->autosnap), 0, 1, 0, 0, "Auto-snapping mode for keyframes when transforming"); } else { uiDefButC(block, MENU, B_REDR, "Auto-Snap Keyframes %t|No Snap %x0|Frame Step %x1|Nearest Frame %x2|Nearest Marker %x3", - xco,yco,70,YIC, &(saction->autosnap), 0, 1, 0, 0, + xco,yco,90,YIC, &(saction->autosnap), 0, 1, 0, 0, "Auto-snapping mode for keyframes when transforming"); } diff --git a/source/blender/editors/space_action/space_action.c b/source/blender/editors/space_action/space_action.c index 275ac4ea4c1..2977d07d845 100644 --- a/source/blender/editors/space_action/space_action.c +++ b/source/blender/editors/space_action/space_action.c @@ -243,7 +243,7 @@ static void action_channel_area_draw(const bContext *C, ARegion *ar) /* data */ if (ANIM_animdata_get_context(C, &ac)) { - draw_channel_names(C, &ac, saction, ar); + draw_channel_names((bContext *)C, &ac, saction, ar); } /* reset view matrix */ @@ -294,6 +294,7 @@ static void action_channel_area_listener(ARegion *ar, wmNotifier *wmn) case NC_SCENE: switch(wmn->data) { case ND_OB_ACTIVE: + case ND_FRAME: ED_region_tag_redraw(ar); break; } diff --git a/source/blender/editors/space_console/console_ops.c b/source/blender/editors/space_console/console_ops.c index fa9055f2d8d..f8dbe0c3dd4 100644 --- a/source/blender/editors/space_console/console_ops.c +++ b/source/blender/editors/space_console/console_ops.c @@ -280,6 +280,7 @@ void CONSOLE_OT_move(wmOperatorType *ot) { /* identifiers */ ot->name= "Move Cursor"; + ot->description= "Move cursor position."; ot->idname= "CONSOLE_OT_move"; /* api callbacks */ @@ -324,6 +325,7 @@ void CONSOLE_OT_insert(wmOperatorType *ot) { /* identifiers */ ot->name= "Insert"; + ot->description= "Insert text at cursor position."; ot->idname= "CONSOLE_OT_insert"; /* api callbacks */ @@ -391,6 +393,7 @@ void CONSOLE_OT_delete(wmOperatorType *ot) { /* identifiers */ ot->name= "Delete"; + ot->description= "Delete text by cursor position."; ot->idname= "CONSOLE_OT_delete"; /* api callbacks */ @@ -434,6 +437,7 @@ void CONSOLE_OT_clear(wmOperatorType *ot) { /* identifiers */ ot->name= "Clear"; + ot->description= "Clear text by type."; ot->idname= "CONSOLE_OT_clear"; /* api callbacks */ @@ -478,6 +482,7 @@ void CONSOLE_OT_history_cycle(wmOperatorType *ot) { /* identifiers */ ot->name= "History Cycle"; + ot->description= "Cycle through history."; ot->idname= "CONSOLE_OT_history_cycle"; /* api callbacks */ @@ -525,6 +530,7 @@ void CONSOLE_OT_history_append(wmOperatorType *ot) { /* identifiers */ ot->name= "History Append"; + ot->description= "Append history at cursor position."; ot->idname= "CONSOLE_OT_history_append"; /* api callbacks */ @@ -572,6 +578,7 @@ void CONSOLE_OT_scrollback_append(wmOperatorType *ot) /* identifiers */ ot->name= "Scrollback Append"; + ot->description= "Append scrollback text by type."; ot->idname= "CONSOLE_OT_scrollback_append"; /* api callbacks */ @@ -614,6 +621,7 @@ void CONSOLE_OT_copy(wmOperatorType *ot) { /* identifiers */ ot->name= "Copy to Clipboard"; + ot->description= "Copy selected text to clipboard."; ot->idname= "CONSOLE_OT_copy"; /* api callbacks */ @@ -648,6 +656,7 @@ void CONSOLE_OT_paste(wmOperatorType *ot) { /* identifiers */ ot->name= "Paste from Clipboard"; + ot->description= "Paste text from clipboard."; ot->idname= "CONSOLE_OT_paste"; /* api callbacks */ @@ -679,6 +688,9 @@ void CONSOLE_OT_zoom(wmOperatorType *ot) { /* identifiers */ ot->name= "Console Zoom"; + /*optionals - + "Zoom view font." */ + ot->description= "Zoom screen area."; ot->idname= "CONSOLE_OT_zoom"; /* api callbacks */ diff --git a/source/blender/editors/space_console/console_report.c b/source/blender/editors/space_console/console_report.c index 2e23c4039f1..08d003f0706 100644 --- a/source/blender/editors/space_console/console_report.c +++ b/source/blender/editors/space_console/console_report.c @@ -114,6 +114,7 @@ void CONSOLE_OT_report_replay(wmOperatorType *ot) { /* identifiers */ ot->name= "Replay Operators"; + ot->description= "Replay selected reports."; ot->idname= "CONSOLE_OT_report_replay"; /* api callbacks */ @@ -160,6 +161,7 @@ void CONSOLE_OT_select_pick(wmOperatorType *ot) { /* identifiers */ ot->name= "Select report"; + ot->description= "Select reports by index."; ot->idname= "CONSOLE_OT_select_pick"; /* api callbacks */ @@ -213,6 +215,7 @@ void CONSOLE_OT_select_all_toggle(wmOperatorType *ot) { /* identifiers */ ot->name= "(De)Select All"; + ot->description= "(de)select all reports."; ot->idname= "CONSOLE_OT_select_all_toggle"; /* api callbacks */ @@ -304,6 +307,7 @@ void CONSOLE_OT_select_border(wmOperatorType *ot) { /* identifiers */ ot->name= "Border Select"; + ot->description= "Toggle border selection."; ot->idname= "CONSOLE_OT_select_border"; /* api callbacks */ @@ -357,6 +361,7 @@ void CONSOLE_OT_report_delete(wmOperatorType *ot) { /* identifiers */ ot->name= "Delete Reports"; + ot->description= "Delete selected reports."; ot->idname= "CONSOLE_OT_report_delete"; /* api callbacks */ @@ -401,6 +406,7 @@ void CONSOLE_OT_report_copy(wmOperatorType *ot) { /* identifiers */ ot->name= "Copy Reports to Clipboard"; + ot->description= "Copy selected reports to Clipboard."; ot->idname= "CONSOLE_OT_report_copy"; /* api callbacks */ diff --git a/source/blender/editors/space_graph/graph_header.c b/source/blender/editors/space_graph/graph_header.c index fc02cadb475..06d48fe20f3 100644 --- a/source/blender/editors/space_graph/graph_header.c +++ b/source/blender/editors/space_graph/graph_header.c @@ -81,6 +81,8 @@ static void graph_viewmenu(bContext *C, uiLayout *layout, void *arg_unused) uiItemS(layout); uiItemR(layout, NULL, 0, &spaceptr, "show_cframe_indicator", 0); + uiItemR(layout, NULL, 0, &spaceptr, "show_sliders", 0); + uiItemR(layout, NULL, 0, &spaceptr, "automerge_keyframes", 0); if (sipo->flag & SIPO_NOHANDLES) uiItemO(layout, "Show Handles", ICON_CHECKBOX_DEHLT, "GRAPH_OT_handles_view_toggle"); @@ -88,7 +90,7 @@ static void graph_viewmenu(bContext *C, uiLayout *layout, void *arg_unused) uiItemO(layout, "Show Handles", ICON_CHECKBOX_HLT, "GRAPH_OT_handles_view_toggle"); uiItemR(layout, NULL, 0, &spaceptr, "only_selected_curves_handles", 0); - uiItemR(layout, NULL, 0, &spaceptr, "automerge_keyframes", 0); + if (sipo->flag & SIPO_DRAWTIME) uiItemO(layout, "Show Frames", 0, "ANIM_OT_time_toggle"); diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c index cda79ea0764..06bd95f060f 100644 --- a/source/blender/editors/space_logic/logic_window.c +++ b/source/blender/editors/space_logic/logic_window.c @@ -1314,10 +1314,16 @@ static short draw_sensorbuttons(bSensor *sens, uiBlock *block, short xco, short * proper compatibility with older .blend files. */ str= "Type %t|Left button %x1|Middle button %x2|" "Right button %x4|Wheel Up %x5|Wheel Down %x6|Movement %x8|Mouse over %x16|Mouse over any%x32"; - uiDefButS(block, MENU, B_REDR, str, xco+10, yco-44, width-20, 19, + uiDefButS(block, MENU, B_REDR, str, xco+10, yco-44, (width*0.8f)-20, 19, &ms->type, 0, 31, 0, 0, "Specify the type of event this mouse sensor should trigger on"); + if(ms->type==32) { + uiDefButBitS(block, TOG, SENS_MOUSE_FOCUS_PULSE, B_REDR, "Pulse",(short)(xco + 10) + (width*0.8f)-20,(short)(yco - 44), + (short)(0.20 * (width-20)), 19, &ms->flag, 0.0, 0.0, 0, 0, + "Moving the mouse over a different object generates a pulse"); + } + yco-= ysize; break; } diff --git a/source/blender/editors/space_text/text_header.c b/source/blender/editors/space_text/text_header.c index 0e2d2ce1698..089436cfcf9 100644 --- a/source/blender/editors/space_text/text_header.c +++ b/source/blender/editors/space_text/text_header.c @@ -215,6 +215,7 @@ void TEXT_OT_properties(wmOperatorType *ot) { /* identifiers */ ot->name= "Properties"; + ot->description= "Toggle text properties panel."; ot->idname= "TEXT_OT_properties"; /* api callbacks */ diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index 4c9f47ed170..7e514ea723a 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -176,6 +176,7 @@ void TEXT_OT_new(wmOperatorType *ot) { /* identifiers */ ot->name= "New"; + ot->description= "Create a new text data block."; ot->idname= "TEXT_OT_new"; /* api callbacks */ @@ -223,6 +224,7 @@ void TEXT_OT_open(wmOperatorType *ot) { /* identifiers */ ot->name= "Open"; + ot->description= "Open a new text data block."; ot->idname= "TEXT_OT_open"; /* api callbacks */ @@ -260,6 +262,7 @@ void TEXT_OT_reload(wmOperatorType *ot) { /* identifiers */ ot->name= "Reload"; + ot->description= "Reload active text data block from its file."; ot->idname= "TEXT_OT_reload"; /* api callbacks */ @@ -337,6 +340,7 @@ void TEXT_OT_unlink(wmOperatorType *ot) { /* identifiers */ ot->name= "Unlink"; + ot->description= "Unlink active text data block."; ot->idname= "TEXT_OT_unlink"; /* api callbacks */ @@ -367,6 +371,7 @@ void TEXT_OT_make_internal(wmOperatorType *ot) { /* identifiers */ ot->name= "Make Internal"; + ot->description= "Make active text file internal."; ot->idname= "TEXT_OT_make_internal"; /* api callbacks */ @@ -435,6 +440,7 @@ void TEXT_OT_save(wmOperatorType *ot) { /* identifiers */ ot->name= "Save"; + ot->description= "Save active text data block."; ot->idname= "TEXT_OT_save"; /* api callbacks */ @@ -490,6 +496,7 @@ void TEXT_OT_save_as(wmOperatorType *ot) { /* identifiers */ ot->name= "Save As"; + ot->description= "Save active text file with options."; ot->idname= "TEXT_OT_save_as"; /* api callbacks */ @@ -527,6 +534,7 @@ void TEXT_OT_run_script(wmOperatorType *ot) { /* identifiers */ ot->name= "Run Script"; + ot->description= "Run active script."; ot->idname= "TEXT_OT_run_script"; /* api callbacks */ @@ -583,6 +591,7 @@ void TEXT_OT_refresh_pyconstraints(wmOperatorType *ot) { /* identifiers */ ot->name= "Refresh PyConstraints"; + ot->description= "Refresh all pyconstraints."; ot->idname= "TEXT_OT_refresh_pyconstraints"; /* api callbacks */ @@ -704,6 +713,7 @@ void TEXT_OT_paste(wmOperatorType *ot) { /* identifiers */ ot->name= "Paste"; + ot->description= "Paste text from clipboard."; ot->idname= "TEXT_OT_paste"; /* api callbacks */ @@ -744,6 +754,7 @@ void TEXT_OT_copy(wmOperatorType *ot) { /* identifiers */ ot->name= "Copy"; + ot->description= "Copy selected text to clipboard."; ot->idname= "TEXT_OT_copy"; /* api callbacks */ @@ -774,6 +785,7 @@ void TEXT_OT_cut(wmOperatorType *ot) { /* identifiers */ ot->name= "Cut"; + ot->description= "Cut selected text to clipboard."; ot->idname= "TEXT_OT_cut"; /* api callbacks */ @@ -809,6 +821,7 @@ void TEXT_OT_indent(wmOperatorType *ot) { /* identifiers */ ot->name= "Indent"; + ot->description= "Indent selected text."; ot->idname= "TEXT_OT_indent"; /* api callbacks */ @@ -844,6 +857,7 @@ void TEXT_OT_unindent(wmOperatorType *ot) { /* identifiers */ ot->name= "Unindent"; + ot->description= "Unindent selected text."; ot->idname= "TEXT_OT_unindent"; /* api callbacks */ @@ -884,6 +898,7 @@ void TEXT_OT_line_break(wmOperatorType *ot) { /* identifiers */ ot->name= "Line Break"; + ot->description= "Insert line break at cursor position."; ot->idname= "TEXT_OT_line_break"; /* api callbacks */ @@ -916,6 +931,7 @@ void TEXT_OT_comment(wmOperatorType *ot) { /* identifiers */ ot->name= "Comment"; + ot->description= "Convert selected text to comment."; ot->idname= "TEXT_OT_comment"; /* api callbacks */ @@ -949,6 +965,7 @@ void TEXT_OT_uncomment(wmOperatorType *ot) { /* identifiers */ ot->name= "Uncomment"; + ot->description= "Convert selected comment to text."; ot->idname= "TEXT_OT_uncomment"; /* api callbacks */ @@ -1090,6 +1107,7 @@ void TEXT_OT_convert_whitespace(wmOperatorType *ot) { /* identifiers */ ot->name= "Convert Whitespace"; + ot->description= "Convert whitespaces by type."; ot->idname= "TEXT_OT_convert_whitespace"; /* api callbacks */ @@ -1120,6 +1138,7 @@ void TEXT_OT_select_all(wmOperatorType *ot) { /* identifiers */ ot->name= "Select All"; + ot->description= "Select all text."; ot->idname= "TEXT_OT_select_all"; /* api callbacks */ @@ -1147,6 +1166,7 @@ void TEXT_OT_select_line(wmOperatorType *ot) { /* identifiers */ ot->name= "Select Line"; + ot->description= "Select text by line."; ot->idname= "TEXT_OT_select_line"; /* api clinebacks */ @@ -1184,6 +1204,7 @@ void TEXT_OT_previous_marker(wmOperatorType *ot) { /* identifiers */ ot->name= "Previous Marker"; + ot->description= "Move to previous marker."; ot->idname= "TEXT_OT_previous_marker"; /* api callbacks */ @@ -1221,6 +1242,7 @@ void TEXT_OT_next_marker(wmOperatorType *ot) { /* identifiers */ ot->name= "Next Marker"; + ot->description= "Move to next marker"; ot->idname= "TEXT_OT_next_marker"; /* api callbacks */ @@ -1248,6 +1270,7 @@ void TEXT_OT_markers_clear(wmOperatorType *ot) { /* identifiers */ ot->name= "Clear All Markers"; + ot->description= "Clear all markers."; ot->idname= "TEXT_OT_markers_clear"; /* api callbacks */ @@ -1531,6 +1554,7 @@ void TEXT_OT_move(wmOperatorType *ot) { /* identifiers */ ot->name= "Move Cursor"; + ot->description= "Move cursor to position type."; ot->idname= "TEXT_OT_move"; /* api callbacks */ @@ -1557,6 +1581,7 @@ void TEXT_OT_move_select(wmOperatorType *ot) { /* identifiers */ ot->name= "Move Select"; + ot->description= "Make selection from current cursor position to new cursor position type."; ot->idname= "TEXT_OT_move_select"; /* api callbacks */ @@ -1596,6 +1621,7 @@ void TEXT_OT_jump(wmOperatorType *ot) { /* identifiers */ ot->name= "Jump"; + ot->description= "Jump cursor to line."; ot->idname= "TEXT_OT_jump"; /* api callbacks */ @@ -1648,6 +1674,7 @@ void TEXT_OT_delete(wmOperatorType *ot) { /* identifiers */ ot->name= "Delete"; + ot->description= "Delete text by cursor position."; ot->idname= "TEXT_OT_delete"; /* api callbacks */ @@ -1828,6 +1855,10 @@ void TEXT_OT_scroll(wmOperatorType *ot) { /* identifiers */ ot->name= "Scroll"; + /*don't really see the difference between this and + scroll_bar. Both do basically the same thing (aside + from keymaps).*/ + ot->description= "Scroll text screen."; ot->idname= "TEXT_OT_scroll"; /* api callbacks */ @@ -1876,6 +1907,10 @@ void TEXT_OT_scroll_bar(wmOperatorType *ot) { /* identifiers */ ot->name= "Scrollbar"; + /*don't really see the difference between this and + scroll. Both do basically the same thing (aside + from keymaps).*/ + ot->description= "Scroll text screen."; ot->idname= "TEXT_OT_scroll_bar"; /* api callbacks */ @@ -2151,6 +2186,7 @@ void TEXT_OT_cursor_set(wmOperatorType *ot) { /* identifiers */ ot->name= "Set Cursor"; + ot->description= "Set cursor selection."; ot->idname= "TEXT_OT_cursor_set"; /* api callbacks */ @@ -2274,6 +2310,7 @@ void TEXT_OT_insert(wmOperatorType *ot) { /* identifiers */ ot->name= "Insert"; + ot->description= "Insert text at cursor position."; ot->idname= "TEXT_OT_insert"; /* api callbacks */ @@ -2378,6 +2415,7 @@ void TEXT_OT_find(wmOperatorType *ot) { /* identifiers */ ot->name= "Find"; + ot->description= "Find specified text."; ot->idname= "TEXT_OT_find"; /* api callbacks */ @@ -2396,6 +2434,7 @@ void TEXT_OT_replace(wmOperatorType *ot) { /* identifiers */ ot->name= "Replace"; + ot->description= "Replace text with specified text."; ot->idname= "TEXT_OT_replace"; /* api callbacks */ @@ -2414,6 +2453,7 @@ void TEXT_OT_mark_all(wmOperatorType *ot) { /* identifiers */ ot->name= "Mark All"; + ot->description= "Mark all specified text."; ot->idname= "TEXT_OT_mark_all"; /* api callbacks */ @@ -2443,6 +2483,7 @@ void TEXT_OT_find_set_selected(wmOperatorType *ot) { /* identifiers */ ot->name= "Find Set Selected"; + ot->description= "Find specified text and set as selected."; ot->idname= "TEXT_OT_find_set_selected"; /* api callbacks */ @@ -2469,6 +2510,7 @@ void TEXT_OT_replace_set_selected(wmOperatorType *ot) { /* identifiers */ ot->name= "Replace Set Selected"; + ot->description= "Replace text with specified text and set as selected."; ot->idname= "TEXT_OT_replace_set_selected"; /* api callbacks */ @@ -2631,6 +2673,7 @@ void TEXT_OT_to_3d_object(wmOperatorType *ot) { /* identifiers */ ot->name= "To 3D Object"; + ot->description= "Create 3d text object from active text data block."; ot->idname= "TEXT_OT_to_3d_object"; /* api callbacks */ diff --git a/source/blender/editors/space_view3d/drawvolume.c b/source/blender/editors/space_view3d/drawvolume.c index 53f193382bd..bc5db5e906f 100644 --- a/source/blender/editors/space_view3d/drawvolume.c +++ b/source/blender/editors/space_view3d/drawvolume.c @@ -197,7 +197,6 @@ void draw_volume(Scene *scene, ARegion *ar, View3D *v3d, Base *base, GPUTexture RegionView3D *rv3d= ar->regiondata; float viewnormal[3]; - // int res[3]; int i, j, n; float d, d0, dd; float *points = NULL; @@ -237,9 +236,12 @@ void draw_volume(Scene *scene, ARegion *ar, View3D *v3d, Base *base, GPUTexture GPU_texture_bind(tex, 0); + if (!GLEW_ARB_texture_non_power_of_two) + { cor[0] = (float)res[0]/(float)larger_pow2(res[0]); cor[1] = (float)res[1]/(float)larger_pow2(res[1]); cor[2] = (float)res[2]/(float)larger_pow2(res[2]); + } // our slices are defined by the plane equation a*x + b*y +c*z + d = 0 // (a,b,c), the plane normal, are given by viewdir diff --git a/source/blender/editors/space_view3d/view3d_header.c b/source/blender/editors/space_view3d/view3d_header.c index 73cd65cafcd..6773985e07c 100644 --- a/source/blender/editors/space_view3d/view3d_header.c +++ b/source/blender/editors/space_view3d/view3d_header.c @@ -188,55 +188,6 @@ static void handle_view3d_lock(bContext *C) } } -/* XXX; all this context stuff... should become operator */ -void do_layer_buttons(bContext *C, short event) -{ - wmWindow *win= CTX_wm_window(C); - Scene *scene= CTX_data_scene(C); - ScrArea *sa= CTX_wm_area(C); - View3D *v3d= sa->spacedata.first; - static int oldlay= 1; - short shift, alt, ctrl; - - shift= win->eventstate->shift; - alt= win->eventstate->alt; - ctrl= win->eventstate->ctrl; - - if(v3d==0) return; - if(v3d->localview) return; - - if(event==-1 && ctrl) { - v3d->scenelock= !v3d->scenelock; - do_view3d_header_buttons(C, NULL, B_SCENELOCK); - } else if (event<0) { - if(v3d->lay== (1<<20)-1) { - if(event==-2 || shift) v3d->lay= oldlay; - } - else { - oldlay= v3d->lay; - v3d->lay= (1<<20)-1; - } - - if(v3d->scenelock) handle_view3d_lock(C); - - /* new layers might need unflushed events events */ - DAG_scene_update_flags(scene, v3d->lay); /* tags all that moves and flushes */ - } - else { - if(alt) { - if(event<11) event+= 10; - } - if(shift) { - if(v3d->lay & (1<<event)) v3d->lay -= (1<<event); - else v3d->lay += (1<<event); - } - do_view3d_header_buttons(C, NULL, event+B_LAY); - } - ED_area_tag_redraw(sa); - - if(v3d->drawtype == OB_SHADED) reshadeall_displist(scene); -} - static int layers_exec(bContext *C, wmOperator *op) { Scene *scene= CTX_data_scene(C); @@ -315,403 +266,6 @@ void VIEW3D_OT_layers(wmOperatorType *ot) RNA_def_boolean(ot->srna, "extend", 0, "Extend", ""); } - -#if 0 -static void do_view3d_view_camerasmenu(bContext *C, void *arg, int event) -{ - Scene *scene= CTX_data_scene(C); - Base *base; - int i=1; - - if (event == 1) { - /* Set Active Object as Active Camera */ - /* XXX ugly hack alert */ -// G.qual |= LR_CTRLKEY; -// persptoetsen(PAD0); -// G.qual &= ~LR_CTRLKEY; - } else { - - for( base = FIRSTBASE; base; base = base->next ) { - if (base->object->type == OB_CAMERA) { - i++; - - if (event==i) { - /* XXX use api call! */ - - break; - } - } - } - } - -} - - -static uiBlock *view3d_view_camerasmenu(bContext *C, ARegion *ar, void *arg_unused) -{ - Scene *scene= CTX_data_scene(C); - Base *base; - uiBlock *block; - short yco= 0, menuwidth=120; - int i=1; - char camname[48]; - - block= uiBeginBlock(C, ar, "view3d_view_camerasmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_view3d_view_camerasmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set Active Object as Active Camera|Ctrl NumPad 0", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, 140, 6, NULL, 0.0, 0.0, 0, 0, ""); - - for( base = FIRSTBASE; base; base = base->next ) { - if (base->object->type == OB_CAMERA) { - i++; - - strcpy(camname, base->object->id.name+2); - if (base->object == scene->camera) strcat(camname, " (Active)"); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, camname, 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, i, ""); - } - } - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 50); - return block; -} -#endif - -#if 0 -static void do_view3d_view_cameracontrolsmenu(bContext *C, void *arg, int event) -{ - switch(event) { - case 0: /* Orbit Left */ - persptoetsen(PAD4); - break; - case 1: /* Orbit Right */ - persptoetsen(PAD6); - break; - case 2: /* Orbit Up */ - persptoetsen(PAD8); - break; - case 3: /* Orbit Down */ - persptoetsen(PAD2); - break; - case 4: /* Pan left */ - /* XXX ugly hack alert */ -// G.qual |= LR_CTRLKEY; - persptoetsen(PAD4); -// G.qual &= ~LR_CTRLKEY; - break; - case 5: /* Pan right */ - /* XXX ugly hack alert */ -// G.qual |= LR_CTRLKEY; - persptoetsen(PAD6); -// G.qual &= ~LR_CTRLKEY; - break; - case 6: /* Pan up */ - /* ugly hack alert */ -// G.qual |= LR_CTRLKEY; - persptoetsen(PAD8); -// G.qual &= ~LR_CTRLKEY; - break; - case 7: /* Pan down */ - /* ugly hack alert */ -// G.qual |= LR_CTRLKEY; - persptoetsen(PAD2); -// G.qual &= ~LR_CTRLKEY; - break; - case 8: /* Zoom In */ - persptoetsen(PADPLUSKEY); - break; - case 9: /* Zoom Out */ - persptoetsen(PADMINUS); - break; - case 10: /* Reset Zoom */ - persptoetsen(PADENTER); - break; - case 11: /* Camera Fly mode */ - fly(); - break; - } -} - - -static uiBlock *view3d_view_cameracontrolsmenu(bContext *C, ARegion *ar, void *arg_unused) -{ -/* static short tog=0; */ - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiBeginBlock(C, ar, "view3d_view_cameracontrolsmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_view3d_view_cameracontrolsmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Camera Fly Mode|Shift F", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 11, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, 140, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Orbit Left|NumPad 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Orbit Right|NumPad 6", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Orbit Up|NumPad 8", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Orbit Down|NumPad 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, 140, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pan Left|Ctrl NumPad 4", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pan Right|Ctrl NumPad 6", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pan Up|Ctrl NumPad 8", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Pan Down|Ctrl NumPad 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, 140, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom In|NumPad +", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom Out|NumPad -", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reset Zoom|NumPad Enter", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 10, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 50); - return block; -} - -static void do_view3d_view_alignviewmenu(bContext *C, void *arg, int event) -{ - Scene *scene= CTX_data_scene(C); - ScrArea *sa= CTX_wm_area(C); - View3D *v3d= sa->spacedata.first; - Object *obedit = CTX_data_edit_object(C); - float *curs; - - switch(event) { - - case 0: /* Align View to Selected (edit/faceselect mode) */ - case 1: - case 2: - if ((obedit) && (obedit->type == OB_MESH)) { - editmesh_align_view_to_selected(v3d, event + 1); - } - else if (paint_facesel_test(CTX_data_active_object(C))) { - Object *obact= OBACT; - if (obact && obact->type==OB_MESH) { - Mesh *me= obact->data; - - if (me->mtface) { -// XXX faceselect_align_view_to_selected(v3d, me, event + 1); - ED_area_tag_redraw(sa); - } - } - } - break; - case 3: /* Center View to Cursor */ - curs= give_cursor(scene, v3d); - v3d->ofs[0]= -curs[0]; - v3d->ofs[1]= -curs[1]; - v3d->ofs[2]= -curs[2]; - ED_area_tag_redraw(sa); - break; - case 4: /* Align Active Camera to View */ - /* XXX This ugly hack is a symptom of the nasty persptoetsen function, - * but at least it works for now. - */ -// G.qual |= LR_CTRLKEY|LR_ALTKEY; - persptoetsen(PAD0); -// G.qual &= ~(LR_CTRLKEY|LR_ALTKEY); - break; - case 5: /* Align View to Selected (object mode) */ -// XXX mainqenter(PADASTERKEY, 1); - break; - case 6: /* Center View and Cursor to Origin */ - WM_operator_name_call(C, "VIEW3D_OT_view_center", WM_OP_EXEC_REGION_WIN, NULL); - curs= give_cursor(scene, v3d); - curs[0]=curs[1]=curs[2]= 0.0; - break; - } -} - -static uiBlock *view3d_view_alignviewmenu(bContext *C, ARegion *ar, void *arg_unused) -{ -/* static short tog=0; */ - uiBlock *block; - Object *obedit = CTX_data_edit_object(C); - short yco= 0, menuwidth=120; - - block= uiBeginBlock(C, ar, "view3d_view_alignviewmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_view3d_view_alignviewmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Center View to Cursor|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Center Cursor and View All|Shift C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align Active Camera to View|Ctrl Alt NumPad 0", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); - - if (((obedit) && (obedit->type == OB_MESH)) || (paint_facesel_test(CTX_data_active_object(C)))) { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align View to Selected (Top)|Shift V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align View to Selected (Front)|Shift V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align View to Selected (Side)|Shift V", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); - } else { - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Align View to Selected|NumPad *", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, ""); - } - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 50); - return block; -} -#endif - -#if 0 -static uiBlock *view3d_view_spacehandlers(bContext *C, ARegion *ar, void *arg_unused) -{ - /* XXX */ - return NULL; -} - - -static void do_view3d_viewmenu(bContext *C, void *arg, int event) -{ - - switch(event) { - case 0: /* User */ - break; - case 1: /* Camera */ - break; - case 2: /* Top */ - break; - case 3: /* Front */ - break; - case 4: /* Side */ - break; - case 5: /* Perspective */ - break; - case 6: /* Orthographic */ - break; - case 7: /* Local View */ - break; - case 8: /* Global View */ - break; - case 9: /* View All (Home) */ - WM_operator_name_call(C, "VIEW3D_OT_view_all", WM_OP_EXEC_REGION_WIN, NULL); - break; - case 11: /* View Selected */ - WM_operator_name_call(C, "VIEW3D_OT_view_center", WM_OP_EXEC_REGION_WIN, NULL); - break; - case 13: /* Play Back Animation */ - break; - case 15: /* Background Image... */ -// add_blockhandler(sa, VIEW3D_HANDLER_BACKGROUND, UI_PNL_UNSTOW); - break; - case 16: /* View Panel */ -// add_blockhandler(sa, VIEW3D_HANDLER_PROPERTIES, UI_PNL_UNSTOW); - break; - case 17: /* Set Clipping Border */ - WM_operator_name_call(C, "VIEW3D_OT_clip_border", WM_OP_INVOKE_REGION_WIN, NULL); - break; - case 18: /* render preview */ -// toggle_blockhandler(sa, VIEW3D_HANDLER_PREVIEW, 0); - break; - case 19: /* zoom within border */ -// view3d_border_zoom(); - break; - case 20: /* Transform Space Panel */ -// add_blockhandler(sa, VIEW3D_HANDLER_TRANSFORM, UI_PNL_UNSTOW); - break; - case 21: /* Grease Pencil */ -// add_blockhandler(sa, VIEW3D_HANDLER_GREASEPENCIL, UI_PNL_UNSTOW); - break; - case 22: /* View all layers */ - do_layer_buttons(C, -2); - break; - } -} -#endif - -#if 0 -static uiBlock *view3d_viewmenu(bContext *C, ARegion *ar, void *arg_unused) -{ - ScrArea *sa= CTX_wm_area(C); - View3D *v3d= sa->spacedata.first; - RegionView3D *rv3d= wm_region_view3d(C); - uiBlock *block; - short yco= 0, menuwidth=120; - - block= uiBeginBlock(C, ar, "view3d_viewmenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_view3d_viewmenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Transform Orientations...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 20, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Render Preview...|Shift P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 18, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "View Properties...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 16, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Background Image...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 15, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Grease Pencil...", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 21, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - if ((rv3d->viewbut == 0) && !(rv3d->persp == V3D_CAMOB)) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "User", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "User", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, ""); - if (rv3d->persp == V3D_CAMOB) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Camera|NumPad 0", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Camera|NumPad 0", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - if (rv3d->viewbut == 1) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Top|NumPad 7", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Top|NumPad 7", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, ""); - if (rv3d->viewbut == 2) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Front|NumPad 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Front|NumPad 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, ""); - if (rv3d->viewbut == 3) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Side|NumPad 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Side|NumPad 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, ""); - - uiDefIconTextBlockBut(block, view3d_view_camerasmenu, NULL, ICON_RIGHTARROW_THIN, "Cameras", 0, yco-=20, 120, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - if(rv3d->persp==V3D_PERSP) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Perspective|NumPad 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Perspective|NumPad 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, ""); - if(rv3d->persp==V3D_ORTHO) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Orthographic|NumPad 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Orthographic|NumPad 5", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - if(v3d->lay== (1<<20)-1) uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show Previous Layers|Shift ~", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 22, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Show All Layers| ~", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 22, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - if(v3d->localview) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Local View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Local View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, ""); - if(!v3d->localview) uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_HLT, "Global View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, ""); - else uiDefIconTextBut(block, BUTM, 1, ICON_CHECKBOX_DEHLT, "Global View|NumPad /", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBlockBut(block, view3d_view_cameracontrolsmenu, NULL, ICON_RIGHTARROW_THIN, "View Navigation", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, view3d_view_alignviewmenu, NULL, ICON_RIGHTARROW_THIN, "Align View", 0, yco-=20, 120, 19, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - if(rv3d->rflag & RV3D_CLIPPING) - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Clipping Border|Alt B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 17, ""); - else - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Set Clipping Border|Alt B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 17, ""); - if (rv3d->persp==V3D_ORTHO) uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Zoom Within Border...|Shift B", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 19, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View Selected|NumPad .", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 11, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "View All|Home", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, ""); - if(!sa->full) uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Maximize Window|Ctrl UpArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 99, ""); - else uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1, "Tile Window|Ctrl DownArrow", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 99, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Play Back Animation|Alt A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 13, ""); - -#ifndef DISABLE_PYTHON - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBlockBut(block, view3d_view_spacehandlers, NULL, ICON_RIGHTARROW_THIN, "Space Handler Scripts", 0, yco-=20, 120, 19, ""); -#endif - - if(ar->alignment==RGN_ALIGN_TOP) { - uiBlockSetDirection(block, UI_DOWN); - } - else { - uiBlockSetDirection(block, UI_TOP); - uiBlockFlipOrder(block); - } - - uiTextBoundsBlock(block, 50); - - return block; -} -#endif - #if 0 void do_view3d_select_object_typemenu(bContext *C, void *arg, int event) { @@ -932,23 +486,6 @@ static uiBlock *view3d_select_object_groupedmenu(bContext *C, ARegion *ar, void #endif -static void view3d_select_metaballmenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - uiItemO(layout, NULL, 0, "VIEW3D_OT_select_border"); - uiItemS(layout); - uiItemO(layout, NULL, 0, "MBALL_OT_select_deselect_all_metaelems"); - uiItemO(layout, NULL, 0, "MBALL_OT_select_inverse_metaelems"); - uiItemS(layout); - uiItemO(layout, NULL, 0, "MBALL_OT_select_random_metaelems"); -} - -/* wrapper for python layouts */ -void uiTemplate_view3d_select_metaballmenu(uiLayout *layout, bContext *C) -{ - void *arg_unused = NULL; - view3d_select_metaballmenu(C, layout, arg_unused); -} - void do_view3d_select_faceselmenu(bContext *C, void *arg, int event) { #if 0 @@ -1027,19 +564,6 @@ void uiTemplate_view3d_select_faceselmenu(uiLayout *layout, bContext *C) view3d_select_faceselmenu(C, ar, arg_unused); } -static void view3d_edit_snapmenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - uiItemO(layout, NULL, 0, "VIEW3D_OT_snap_selected_to_grid"); - uiItemO(layout, NULL, 0, "VIEW3D_OT_snap_selected_to_cursor"); - uiItemO(layout, NULL, 0, "VIEW3D_OT_snap_selected_to_center"); - - uiItemS(layout); - - uiItemO(layout, NULL, 0, "VIEW3D_OT_snap_cursor_to_selected"); - uiItemO(layout, NULL, 0, "VIEW3D_OT_snap_cursor_to_grid"); - uiItemO(layout, NULL, 0, "VIEW3D_OT_snap_cursor_to_active"); -} - #if 0 void do_view3d_transform_moveaxismenu(bContext *C, void *arg, int event) { @@ -1813,618 +1337,6 @@ static void do_view3d_edit_objectmenu(bContext *C, void *arg, int event) } #endif -#if 0 -/* visible buttons ported to python, check ifedout buttons */ -static void view3d_edit_mesh_verticesmenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - uiItemO(layout, "Merge...", 0, "MESH_OT_merge"); - uiItemO(layout, "Rip", 0, "MESH_OT_rip"); - uiItemO(layout, "Split", 0, "MESH_OT_split"); - uiItemO(layout, "Separate", 0, "MESH_OT_separate"); - - uiItemS(layout); - - uiItemO(layout, "Smooth", 0, "MESH_OT_vertices_smooth"); - uiItemO(layout, "Remove Doubles", 0, "MESH_OT_remove_doubles"); - -#if 0 - uiItemS(layout); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Make Vertex Parent|Ctrl P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); // add_hook_menu(); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Hook|Ctrl H", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); // make_parent(); -#endif -} -#endif - -#if 0 -/* visible buttons ported to python, check ifedout buttons */ -static void view3d_edit_mesh_edgesmenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - uiItemO(layout, NULL, 0, "MESH_OT_edge_face_add"); - -#if 0 - uiItemO(layout, "Bevel", 0, "MESH_OT_bevel"); // bevelmenu(em) - uiItemO(layout, "Loop Subdivide...", 0, "MESH_OT_loop_subdivide"); // Ctr R, CutEdgeloop(1); - uiItemO(layout, "Knife Subdivide...", 0, "MESH_OT_loop_subdivide"); // Shift K, KnifeSubdivide(KNIFE_PROMPT); - - uiItemS(layout); -#endif - - uiItemO(layout, "Subdivide", 0, "MESH_OT_subdivide"); - uiItemFloatO(layout, "Subdivide Smooth", 0, "MESH_OT_subdivide", "smoothness", 1.0f); - - uiItemS(layout); - - uiItemO(layout, "Mark Seam", 0, "MESH_OT_mark_seam"); - uiItemBooleanO(layout, "Clear Seam", 0, "MESH_OT_mark_seam", "clear", 1); - - uiItemS(layout); - - uiItemO(layout, "Mark Sharp", 0, "MESH_OT_mark_sharp"); - uiItemBooleanO(layout, "Clear Sharp", 0, "MESH_OT_mark_sharp", "clear", 1); - -#if 0 - uiItemS(layout); - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Adjust Bevel Weight|Ctrl Shift E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 17, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Crease SubSurf|Shift E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 9, ""); -#endif - - uiItemS(layout); - - uiItemEnumO(layout, "Rotate Edge CW", 0, "MESH_OT_edge_rotate", "direction", 1); - uiItemEnumO(layout, "Rotate Edge CCW", 0, "MESH_OT_edge_rotate", "direction", 2); - -#if 0 - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Slide Edge |Ctrl E", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Edge Loop|X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 13, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Collapse", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 14, ""); -#endif -} -#endif - -#if 0 -void do_view3d_edit_mirrormenu(bContext *C, void *arg, int event) -{ - float mat[3][3]; - - Mat3One(mat); - - switch(event) { - case 0: - initTransform(TFM_MIRROR, CTX_NO_PET); - Transform(); - break; - case 1: - initTransform(TFM_MIRROR, CTX_NO_PET|CTX_AUTOCONFIRM); - BIF_setSingleAxisConstraint(mat[0], " on global X axis"); - Transform(); - break; - case 2: - initTransform(TFM_MIRROR, CTX_NO_PET|CTX_AUTOCONFIRM); - BIF_setSingleAxisConstraint(mat[1], " on global Y axis"); - Transform(); - break; - case 3: - initTransform(TFM_MIRROR, CTX_NO_PET|CTX_AUTOCONFIRM); - BIF_setSingleAxisConstraint(mat[2], "on global Z axis"); - Transform(); - break; - case 4: - initTransform(TFM_MIRROR, CTX_NO_PET|CTX_AUTOCONFIRM); - BIF_setLocalAxisConstraint('X', " on local X axis"); - Transform(); - break; - case 5: - initTransform(TFM_MIRROR, CTX_NO_PET|CTX_AUTOCONFIRM); - BIF_setLocalAxisConstraint('Y', " on local Y axis"); - Transform(); - break; - case 6: - initTransform(TFM_MIRROR, CTX_NO_PET|CTX_AUTOCONFIRM); - BIF_setLocalAxisConstraint('Z', " on local Z axis"); - Transform(); - break; - } -} - -static uiBlock *view3d_edit_mirrormenu(bContext *C, ARegion *ar, void *arg_unused) -{ - uiBlock *block; - short yco = 20, menuwidth = 120; - - block= uiBeginBlock(C, ar, "view3d_edit_mirrormenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_view3d_edit_mirrormenu, NULL); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Interactive Mirror|Ctrl M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "X Global|Ctrl M, X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Y Global|Ctrl M, Y", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Z Global|Ctrl M, Z", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "X Local|Ctrl M, X X", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Y Local|Ctrl M, Y Y", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Z Local|Ctrl M, Z Z", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - return block; -} -#endif - -#ifndef DISABLE_PYTHON -#if 0 -static void do_view3d_edit_mesh_scriptsmenu(bContext *C, void *arg, int event) -{ - BPY_menu_do_python(PYMENU_MESH, event); -} - -static uiBlock *view3d_edit_mesh_scriptsmenu(bContext *C, ARegion *ar, void *arg_unused) -{ - uiBlock *block; -// short yco = 20, menuwidth = 120; -// XXX BPyMenu *pym; -// int i = 0; - - block= uiBeginBlock(C, ar, "v3d_emesh_pymenu", UI_EMBOSSP); - uiBlockSetButmFunc(block, do_view3d_edit_mesh_scriptsmenu, NULL); - -// for (pym = BPyMenuTable[PYMENU_MESH]; pym; pym = pym->next, i++) { -// uiDefIconTextBut(block, BUTM, 1, ICON_PYTHON, pym->name, 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, i, pym->tooltip?pym->tooltip:pym->filename); -// } - - uiBlockSetDirection(block, UI_RIGHT); - uiTextBoundsBlock(block, 60); - - return block; -} -#endif -#endif /* DISABLE_PYTHON */ - -#if 0 -static void do_view3d_edit_meshmenu(bContext *C, void *arg, int event) -{ - ScrArea *sa= CTX_wm_area(C); - - switch(event) { - - case 2: /* transform properties */ - add_blockhandler(sa, VIEW3D_HANDLER_OBJECT, 0); - break; - case 4: /* insert keyframe */ - common_insertkey(); - break; - case 16: /* delete keyframe */ - common_deletekey(); - break; - } -} -#endif - -#if 0 -/* visible buttons ported to python, check ifedout buttons */ -static void view3d_edit_meshmenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - Scene *scene= CTX_data_scene(C); - ToolSettings *ts= CTX_data_tool_settings(C); - PointerRNA tsptr; - - RNA_pointer_create(&scene->id, &RNA_ToolSettings, ts, &tsptr); - - uiItemO(layout, "Undo Editing", 0, "ED_OT_undo"); - uiItemO(layout, "Redo Editing", 0, "ED_OT_redo"); - -#if 0 - uiDefIconTextBlockBut(block, editmode_undohistorymenu, NULL, ICON_RIGHTARROW_THIN, "Undo History", 0, yco-=20, 120, 19, ""); -#endif - - uiItemS(layout); - -#if 0 - uiDefIconTextBlockBut(block, view3d_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, view3d_edit_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, view3d_edit_snapmenu, NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 19, ""); -#endif - - uiItemMenuF(layout, "Snap", 0, view3d_edit_snapmenu, NULL); - - uiItemS(layout); - -#if 0 - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Insert Keyframe|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Keyframe|Alt I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, ""); - - uiItemS(layout); -#endif - - uiItemO(layout, NULL, 0, "UV_OT_mapping_menu"); - - uiItemS(layout); - - uiItemO(layout, NULL, 0, "MESH_OT_extrude"); - uiItemO(layout, NULL, 0, "MESH_OT_duplicate"); - uiItemO(layout, "Delete...", 0, "MESH_OT_delete"); - - uiItemS(layout); - - uiItemMenuF(layout, "Vertices", 0, view3d_edit_mesh_verticesmenu, NULL); - uiItemMenuF(layout, "Edges", 0, view3d_edit_mesh_edgesmenu, NULL); - uiItemMenuF(layout, "Faces", 0, view3d_edit_mesh_facesmenu, NULL); - uiItemMenuF(layout, "Normals", 0, view3d_edit_mesh_normalsmenu, NULL); - - uiItemS(layout); - - uiItemR(layout, NULL, 0, &tsptr, "automerge_editing", 0); - uiItemR(layout, NULL, 0, &tsptr, "proportional_editing", 0); // |O - uiItemMenuEnumR(layout, NULL, 0, &tsptr, "proportional_editing_falloff"); // |Shift O - - uiItemS(layout); - - uiItemMenuF(layout, "Show/Hide", 0, view3d_edit_mesh_showhidemenu, NULL); - -#if 0 -#ifndef DISABLE_PYTHON - uiItemS(layout); - uiDefIconTextBlockBut(block, view3d_edit_mesh_scriptsmenu, NULL, ICON_RIGHTARROW_THIN, "Scripts", 0, yco-=20, 120, 19, ""); -#endif -#endif -} -#endif - -#if 0 -/* visible buttons ported to python, check ifedout buttons */ -static void view3d_edit_curve_controlpointsmenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - Object *obedit= CTX_data_edit_object(C); - - if(obedit->type == OB_CURVE) { - uiItemEnumO(layout, NULL, 0, "TFM_OT_transform", "mode", TFM_TILT); - uiItemO(layout, NULL, 0, "CURVE_OT_tilt_clear"); - uiItemO(layout, NULL, 0, "CURVE_OT_separate"); - - uiItemS(layout); - - uiItemEnumO(layout, NULL, 0, "CURVE_OT_handle_type_set", "type", 1); - uiItemEnumO(layout, NULL, 0, "CURVE_OT_handle_type_set", "type", 3); - uiItemEnumO(layout, NULL, 0, "CURVE_OT_handle_type_set", "type", 2); - - uiItemS(layout); - } - - // XXX uiItemO(layout, NULL, 0, "OBJECT_OT_make_vertex_parent"); Make VertexParent|Ctrl P - // make_parent() - // XXX uiItemO(layout, NULL, 0, "OBJECT_OT_add_hook"); Add Hook| Ctrl H - // add_hook_menu() -} -#endif - -#if 0 -/* visible buttons ported to python, check ifedout buttons */ -static void view3d_edit_curvemenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - Scene *scene= CTX_data_scene(C); - ToolSettings *ts= CTX_data_tool_settings(C); - PointerRNA tsptr; - - RNA_pointer_create(&scene->id, &RNA_ToolSettings, ts, &tsptr); - -#if 0 - uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Transform Properties...|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, ""); - uiDefIconTextBlockBut(block, view3d_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, view3d_edit_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, menuwidth, 19, ""); -#endif - - uiItemMenuF(layout, "Snap", 0, view3d_edit_snapmenu, NULL); - - uiItemS(layout); - - // XXX uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Insert Keyframe|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - // common_insertkey(); - // XXX uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Keyframe|Alt I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, ""); - // common_deletekey(); - - - uiItemO(layout, NULL, 0, "CURVE_OT_extrude"); - uiItemO(layout, NULL, 0, "CURVE_OT_duplicate"); - uiItemO(layout, NULL, 0, "CURVE_OT_separate"); - uiItemO(layout, NULL, 0, "CURVE_OT_make_segment"); - uiItemO(layout, NULL, 0, "CURVE_OT_cyclic_toggle"); - uiItemO(layout, NULL, 0, "CURVE_OT_delete"); // Delete... - - uiItemS(layout); - - uiItemMenuF(layout, "Control Points", 0, view3d_edit_curve_controlpointsmenu, NULL); - uiItemMenuF(layout, "Segments", 0, view3d_edit_curve_segmentsmenu, NULL); - - uiItemS(layout); - - uiItemR(layout, NULL, 0, &tsptr, "proportional_editing", 0); // |O - uiItemMenuEnumR(layout, NULL, 0, &tsptr, "proportional_editing_falloff"); // |Shift O - - uiItemS(layout); - - uiItemMenuF(layout, "Show/Hide Control Points", 0, view3d_edit_curve_showhidemenu, NULL); -} -#endif - -#if 0 -/* visible buttons ported to python, check ifedout buttons */ -static void view3d_edit_latticemenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - Scene *scene= CTX_data_scene(C); - ToolSettings *ts= CTX_data_tool_settings(C); - PointerRNA tsptr; - - RNA_pointer_create(&scene->id, &RNA_ToolSettings, ts, &tsptr); - -#if 0 - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Editing|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - - uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiDefIconTextBlockBut(block, view3d_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, view3d_edit_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, menuwidth, 19, ""); -#endif - - uiItemMenuF(layout, "Snap", 0, view3d_edit_snapmenu, NULL); - - uiItemS(layout); - - // XXX uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Insert Keyframe|I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, ""); - // common_insertkey(); - // XXX uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Keyframe|Alt I", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 16, ""); - // common_deletekey(); - - uiItemO(layout, NULL, 0, "LATTICE_OT_make_regular"); - - uiItemS(layout); - - uiItemR(layout, NULL, 0, &tsptr, "proportional_editing", 0); // |O - uiItemMenuEnumR(layout, NULL, 0, &tsptr, "proportional_editing_falloff"); // |Shift O -} -#endif - -#if 0 -static void do_view3d_edit_armaturemenu(bContext *C, void *arg, int event) -{ - static short numcuts= 2; - - switch(event) { - case 0: /* Undo Editing */ - remake_editArmature(); - break; - - case 6: /* Shear */ - initTransform(TFM_SHEAR, CTX_NONE); - Transform(); - break; - case 7: /* Warp */ - initTransform(TFM_WARP, CTX_NONE); - Transform(); - case 23: /* bone sketching panel */ - add_blockhandler(curarea, VIEW3D_HANDLER_BONESKETCH, UI_PNL_UNSTOW); - break; - } -} -#endif - -#if 0 -/* visible buttons ported to python, check ifedout buttons */ -static void view3d_edit_armaturemenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - Object *obedit = CTX_data_edit_object(C); - bArmature *arm= obedit->data; - -#if 0 - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Undo Editing|U", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Bone Sketching|P", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 23, ""); - uiDefIconTextBlockBut(block, view3d_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, ""); - uiDefIconTextBlockBut(block, view3d_edit_mirrormenu, NULL, ICON_RIGHTARROW_THIN, "Mirror", 0, yco-=20, menuwidth, 19, ""); -#endif - uiItemMenuF(layout, "Snap", 0, view3d_edit_snapmenu, NULL); - uiItemMenuF(layout, "Bone Roll", 0, view3d_edit_armature_rollmenu, NULL); - - if (arm->drawtype == ARM_ENVELOPE) - uiItemEnumO(layout, "Scale Envelope Distance", 0, "TFM_OT_transform", "mode", TFM_BONESIZE); - else - uiItemEnumO(layout, "Scale B-Bone Width", 0, "TFM_OT_transform", "mode", TFM_BONESIZE); - - uiItemS(layout); - - uiItemO(layout, "Extrude", 0, "ARMATURE_OT_extrude"); - if (arm->flag & ARM_MIRROR_EDIT) - uiItemBooleanO(layout, "Extrude Forked", 0, "ARMATURE_OT_extrude", "forked", 1); - - uiItemO(layout, NULL, 0, "ARMATURE_OT_duplicate"); - uiItemO(layout, NULL, 0, "ARMATURE_OT_merge"); - uiItemO(layout, NULL, 0, "ARMATURE_OT_fill"); - uiItemO(layout, NULL, 0, "ARMATURE_OT_delete"); - uiItemO(layout, NULL, 0, "ARMATURE_OT_separate"); - - uiItemS(layout); - - uiItemO(layout, NULL, 0, "ARMATURE_OT_subdivide_simple"); - uiItemO(layout, NULL, 0, "ARMATURE_OT_subdivide_multi"); - - uiItemEnumO(layout, "AutoName Left/Right", 0, "ARMATURE_OT_autoside_names", "axis", 0); - uiItemEnumO(layout, "AutoName Front/Back", 0, "ARMATURE_OT_autoside_names", "axis", 1); - uiItemEnumO(layout, "AutoName Top/Bottom", 0, "ARMATURE_OT_autoside_names", "axis", 2); - - uiItemO(layout, "Flip Left/Right Names", 0, "ARMATURE_OT_flip_names"); - - uiItemS(layout); - - uiItemO(layout, NULL, 0, "ARMATURE_OT_armature_layers"); - uiItemO(layout, NULL, 0, "ARMATURE_OT_bone_layers"); - - uiItemS(layout); - - uiItemMenuF(layout, "Parent", 0, view3d_edit_armature_parentmenu, NULL); - - uiItemS(layout); - - uiItemMenuF(layout, "Bone Settings ", 0, view3d_edit_armature_settingsmenu, NULL); -} -#endif - -static void view3d_pose_armature_transformmenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - //uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear User Transform|W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 4, ""); - //used: clear_user_transform(scene, ob); - //uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, ""); - - uiItemO(layout, NULL, 0, "POSE_OT_loc_clear"); - uiItemO(layout, NULL, 0, "POSE_OT_rot_clear"); - uiItemO(layout, NULL, 0, "POSE_OT_scale_clear"); - - // ??? - //uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Clear Origin|Alt O", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, ""); - //used:clear_object('o'); -} - -static void view3d_pose_armature_showhidemenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - uiItemO(layout, "Show Hidden", 0, "POSE_OT_reveal"); - - uiItemO(layout, "Hide Selected", 0, "POSE_OT_hide"); - uiItemBooleanO(layout, "Hide Unselected", 0, "POSE_OT_hide", "unselected", 1); -} - -static void view3d_pose_armature_ikmenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - uiItemO(layout, NULL, 0, "POSE_OT_ik_add"); - uiItemO(layout, NULL, 0, "POSE_OT_ik_clear"); -} - -static void view3d_pose_armature_constraintsmenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - uiItemO(layout, NULL, 0, "POSE_OT_constraint_add_with_targets"); - uiItemO(layout, NULL, 0, "POSE_OT_constraints_clear"); -} - -static void view3d_pose_armature_groupmenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - uiItemO(layout, "Add Selected to Active Group", 0, "POSE_OT_group_assign"); - //uiItemO(layout, "Add Selected to Group", 0, "POSE_OT_group_assign"); - - uiItemO(layout, "Add New Group", 0, "POSE_OT_group_add"); - - uiItemO(layout, "Remove from All Groups", 0, "POSE_OT_group_unassign"); - uiItemO(layout, "Remove Active Group", 0, "POSE_OT_group_remove"); -} - -static void view3d_pose_armature_motionpathsmenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - uiItemO(layout, NULL, 0, "POSE_OT_paths_calculate"); - uiItemO(layout, NULL, 0, "POSE_OT_paths_clear"); -} - -static void view3d_pose_armature_poselibmenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - uiItemO(layout, NULL, 0, "POSELIB_OT_browse_interactive"); - - uiItemS(layout); - - uiItemO(layout, NULL, 0, "POSELIB_OT_pose_add"); - uiItemO(layout, NULL, 0, "POSELIB_OT_pose_rename"); - uiItemO(layout, NULL, 0, "POSELIB_OT_pose_remove"); -} - -static void view3d_pose_armature_settingsmenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - uiItemEnumO(layout, "Toggle a Setting", 0, "POSE_OT_flags_set", "mode", 2); - uiItemEnumO(layout, "Enable a Setting", 0, "POSE_OT_flags_set", "mode", 1); - uiItemEnumO(layout, "Disable a Setting", 0, "POSE_OT_flags_set", "mode", 0); -} - -#if 0 -static void do_view3d_pose_armaturemenu(bContext *C, void *arg, int event) -{ - Object *ob; - ob=OBACT; - - switch(event) { - case 5: - pose_copy_menu(); - break; - case 15: - pose_relax(); - break; - } -} -#endif - -static void view3d_pose_armaturemenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - Object *ob = CTX_data_active_object(C); - bArmature *arm= ob->data; - -#if 0 // XXX to be ported, using uiItemMenuF(layout, "<Name>", 0, view3d_pose_armature_<category>menu); - uiDefIconTextBlockBut(block, view3d_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, ""); -#endif - if ( (arm) && ((arm->drawtype == ARM_B_BONE) || (arm->drawtype == ARM_ENVELOPE)) ) - uiItemEnumO(layout, "Scale Envelope Distance", 0, "TFM_OT_transform", "mode", TFM_BONESIZE); - uiItemMenuF(layout, "Clear Transform", 0, view3d_pose_armature_transformmenu, NULL); - - uiItemS(layout); - - // TODO: these operators may get renamed - uiItemO(layout, NULL, 0, "ANIM_OT_insert_keyframe_menu"); - uiItemO(layout, NULL, 0, "ANIM_OT_delete_keyframe_v3d"); - - uiItemS(layout); - -#if 0 - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Relax Pose|W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 15, ""); -#endif - uiItemO(layout, NULL, 0, "POSE_OT_apply"); - - uiItemS(layout); - - uiItemO(layout, "Copy Current Pose", 0, "POSE_OT_copy"); - uiItemO(layout, "Paste Pose", 0, "POSE_OT_paste"); - uiItemBooleanO(layout, "Paste X-Flipped Pose", 0, "POSE_OT_paste", "flipped", 1); - - uiItemS(layout); - - uiItemMenuF(layout, "Pose Library", 0, view3d_pose_armature_poselibmenu, NULL); - uiItemMenuF(layout, "Motion Paths", 0, view3d_pose_armature_motionpathsmenu, NULL); - uiItemMenuF(layout, "Bone Groups", 0, view3d_pose_armature_groupmenu, NULL); - - uiItemS(layout); - - uiItemMenuF(layout, "Inverse Kinematics", 0, view3d_pose_armature_ikmenu, NULL); - uiItemMenuF(layout, "Constraints", 0, view3d_pose_armature_constraintsmenu, NULL); - - uiItemS(layout); - - uiItemEnumO(layout, "AutoName Left/Right", 0, "POSE_OT_autoside_names", "axis", 0); - uiItemEnumO(layout, "AutoName Front/Back", 0, "POSE_OT_autoside_names", "axis", 1); - uiItemEnumO(layout, "AutoName Top/Bottom", 0, "POSE_OT_autoside_names", "axis", 2); - - uiItemO(layout, "Flip Left/Right Names", 0, "POSE_OT_flip_names"); - - uiItemS(layout); - - uiItemO(layout, NULL, 0, "POSE_OT_armature_layers"); - uiItemO(layout, NULL, 0, "POSE_OT_bone_layers"); - - uiItemS(layout); - - uiItemMenuF(layout, "Show/Hide Bones", 0, view3d_pose_armature_showhidemenu, NULL); - uiItemMenuF(layout, "Bone Settings", 0, view3d_pose_armature_settingsmenu, NULL); - -#if 0 - uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Copy Attributes...|Ctrl C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 5, ""); -#endif -} /* texture paint menu (placeholder, no items yet??) */ static void do_view3d_tpaintmenu(bContext *C, void *arg, int event) @@ -2622,39 +1534,6 @@ static uiBlock *view3d_faceselmenu(bContext *C, ARegion *ar, void *arg_unused) return block; } -static void view3d_particle_showhidemenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - uiItemO(layout, NULL, 0, "PARTICLE_OT_reveal"); - uiItemO(layout, NULL, 0, "PARTICLE_OT_hide"); - uiItemBooleanO(layout, "Hide Unselected", 0, "PARTICLE_OT_hide", "unselected", 1); -} - -static void view3d_particlemenu(bContext *C, uiLayout *layout, void *arg_unused) -{ - ToolSettings *ts= CTX_data_tool_settings(C); - - // XXX uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Particle Edit Properties|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, ""); - // add_blockhandler(sa, VIEW3D_HANDLER_OBJECT, UI_PNL_UNSTOW); - // XXX uiItemS(layout); - // - // XXX uiDefIconTextBut(block, BUTM, 1, (pset->flag & PE_X_MIRROR)? ICON_CHECKBOX_HLT: ICON_CHECKBOX_DEHLT, "X-Axis Mirror Editing", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 6, ""); - // pset->flag ^= PE_X_MIRROR; - - uiItemO(layout, NULL, 0, "PARTICLE_OT_mirror"); // |Ctrl M - - uiItemS(layout); - - uiItemO(layout, NULL, 0, "PARTICLE_OT_remove_doubles"); // |W, 5 - uiItemO(layout, NULL, 0, "PARTICLE_OT_delete"); - if(ts->particle.selectmode & SCE_SELECT_POINT) - uiItemO(layout, NULL, 0, "PARTICLE_OT_subdivide"); // |W, 2 - uiItemO(layout, NULL, 0, "PARTICLE_OT_rekey"); // |W, 1 - - uiItemS(layout); - - uiItemMenuF(layout, "Show/Hide Particles", 0, view3d_particle_showhidemenu, NULL); -} - static char *view3d_modeselect_pup(Scene *scene) { Object *ob= OBACT; @@ -2998,15 +1877,11 @@ static void view3d_header_pulldowns(const bContext *C, uiBlock *block, Object *o } } else if(ob && ob->mode & OB_MODE_PARTICLE_EDIT) { - xmax= GetButStringLength("Particle"); - uiDefMenuBut(block, view3d_particlemenu, NULL, "Particle", xco,yco, xmax-3, 20, ""); - xco+= xmax; + /* ported to python */ } else { if (ob && (ob->mode & OB_MODE_POSE)) { - xmax= GetButStringLength("Pose"); - uiDefMenuBut(block, view3d_pose_armaturemenu, NULL, "Pose", xco,yco, xmax-3, 20, ""); - xco+= xmax; + /* ported to python */ } } diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 168a65a2e75..edcbd858e37 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -269,7 +269,7 @@ static void editmesh_apply_to_mirror(TransInfo *t) /* tags the given ID block for refreshes (if applicable) due to * Animation Editor editing */ -static void animedit_refresh_id_tags (ID *id) +static void animedit_refresh_id_tags (Scene *scene, ID *id) { if (id) { AnimData *adt= BKE_animdata_from_id(id); @@ -279,12 +279,11 @@ static void animedit_refresh_id_tags (ID *id) adt->recalc |= ADT_RECALC_ANIM; /* if ID-block is Object, set recalc flags */ - // TODO: this should probably go through the depsgraph instead... but for now, let's be lazy switch (GS(id->name)) { case ID_OB: { Object *ob= (Object *)id; - ob->recalc |= OB_RECALC; + DAG_object_flush_update(scene, ob, OB_RECALC_DATA); /* sets recalc flags */ } break; } @@ -384,7 +383,7 @@ void recalcData(TransInfo *t) /* just tag these animdata-blocks to recalc, assuming that some data there changed */ for (ale= anim_data.first; ale; ale= ale->next) { /* set refresh tags for objects using this animation */ - animedit_refresh_id_tags(ale->id); + animedit_refresh_id_tags(t->scene, ale->id); } /* now free temp channels */ @@ -432,7 +431,7 @@ void recalcData(TransInfo *t) calchandles_fcurve(fcu); /* set refresh tags for objects using this animation */ - animedit_refresh_id_tags(ale->id); + animedit_refresh_id_tags(t->scene, ale->id); } /* do resort and other updates? */ @@ -463,7 +462,7 @@ void recalcData(TransInfo *t) continue; /* set refresh tags for objects using this animation */ - animedit_refresh_id_tags(tdn->id); + animedit_refresh_id_tags(t->scene, tdn->id); /* if cancelling transform, just write the values without validating, then move on */ if (t->state == TRANS_CANCEL) { diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index 081e9589fb8..08d22faf7e7 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -148,6 +148,7 @@ void TFM_OT_select_orientation(struct wmOperatorType *ot) /* identifiers */ ot->name = "Select Orientation"; + ot->description= "Select orientation type."; ot->idname = "TFM_OT_select_orientation"; /* api callbacks */ @@ -308,6 +309,7 @@ void TFM_OT_translate(struct wmOperatorType *ot) { /* identifiers */ ot->name = "Translate"; + ot->description= "Translate selected items."; ot->idname = OP_TRANSLATION; ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; @@ -333,6 +335,7 @@ void TFM_OT_resize(struct wmOperatorType *ot) { /* identifiers */ ot->name = "Resize"; + ot->description= "Resize selected items."; ot->idname = OP_RESIZE; ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; @@ -359,6 +362,7 @@ void TFM_OT_trackball(struct wmOperatorType *ot) { /* identifiers */ ot->name = "Trackball"; + ot->description= "Trackball style rotation of selected items."; ot->idname = OP_TRACKBALL; ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; @@ -380,6 +384,7 @@ void TFM_OT_rotate(struct wmOperatorType *ot) { /* identifiers */ ot->name = "Rotate"; + ot->description= "Rotate selected items."; ot->idname = OP_ROTATION; ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; @@ -405,6 +410,10 @@ void TFM_OT_tilt(struct wmOperatorType *ot) { /* identifiers */ ot->name = "Tilt"; + /*optionals - + "Tilt selected vertices." + "Specify an extra axis rotation for selected vertices of 3d curve." */ + ot->description= "Tilt selected control vertices of 3d curve."; ot->idname = OP_TILT; ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; @@ -428,6 +437,7 @@ void TFM_OT_warp(struct wmOperatorType *ot) { /* identifiers */ ot->name = "Warp"; + ot->description= "Warp selected items around the cursor."; ot->idname = OP_WARP; ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; @@ -452,6 +462,7 @@ void TFM_OT_shear(struct wmOperatorType *ot) { /* identifiers */ ot->name = "Shear"; + ot->description= "Shear selected items along the horizontal screen axis."; ot->idname = OP_SHEAR; ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; @@ -476,6 +487,7 @@ void TFM_OT_shrink_fatten(struct wmOperatorType *ot) { /* identifiers */ ot->name = "Shrink/Fatten"; + ot->description= "Shrink/fatten selected vertices along normals."; ot->idname = OP_SHRINK_FATTEN; ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; @@ -497,6 +509,8 @@ void TFM_OT_tosphere(struct wmOperatorType *ot) { /* identifiers */ ot->name = "To Sphere"; + //added "around mesh center" to differentiate between "MESH_OT_vertices_to_sphere()" + ot->description= "Move selected vertices outward in a spherical shape around mesh center."; ot->idname = OP_TOSPHERE; ot->flag = OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; @@ -548,6 +562,7 @@ void TFM_OT_transform(struct wmOperatorType *ot) /* identifiers */ ot->name = "Transform"; + ot->description= "Transform selected items by mode type."; ot->idname = "TFM_OT_transform"; ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO|OPTYPE_BLOCKING; diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c index 18159414cf6..41159397634 100644 --- a/source/blender/editors/util/undo.c +++ b/source/blender/editors/util/undo.c @@ -239,6 +239,7 @@ void ED_OT_undo(wmOperatorType *ot) { /* identifiers */ ot->name= "Undo"; + ot->description= "Undo previous action."; ot->idname= "ED_OT_undo"; /* api callbacks */ @@ -250,6 +251,7 @@ void ED_OT_redo(wmOperatorType *ot) { /* identifiers */ ot->name= "Redo"; + ot->description= "Redo previous action."; ot->idname= "ED_OT_redo"; /* api callbacks */ |