diff options
author | Ton Roosendaal <ton@blender.org> | 2005-12-07 15:36:26 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2005-12-07 15:36:26 +0300 |
commit | 1123be1bcc47b2e51d06371c9a174e145d3b0a73 (patch) | |
tree | dd5b41e3b95073aebb56b44c0b1e9ff486e7bd73 /source/blender/src/toolbox.c | |
parent | ee63a6fd79e6be8b873b20ce842e5beb6850f4cf (diff) |
Orange request; Bones in Armature now have own layer settings.
Works like for Object layers, but local within Armature itself. Each Bone
can be in (16 now) any layer, and the Armature layer defines what is
visible or not. Also note that hiding will still work too.
Since the Blender code is *stuffed* with Bone options now, this commit
requires a good test if all tools we got now comply to layers...
(I counted 130 cases for checking for selected Bones in code!)
In PoseMode; hotkey M will show 'movetolayer' menu. Not in editmode...
then its the mirror menu.
Todo: make action/nla drawing comply to Armature layer settings.
Diffstat (limited to 'source/blender/src/toolbox.c')
-rw-r--r-- | source/blender/src/toolbox.c | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/source/blender/src/toolbox.c b/source/blender/src/toolbox.c index d02119ae008..6238d253d35 100644 --- a/source/blender/src/toolbox.c +++ b/source/blender/src/toolbox.c @@ -1274,6 +1274,55 @@ int movetolayer_buts(unsigned int *lay) return 0; } +int movetolayer_short_buts(short *lay) +{ + uiBlock *block; + ListBase listb={0, 0}; + int dx, dy, a, x1, y1, sizex=120, sizey=30; + short pivot[2], mval[2], ret=0; + + getmouseco_sc(mval); + + pivot[0]= CLAMPIS(mval[0], (sizex+10), G.curscreen->sizex-30); + pivot[1]= CLAMPIS(mval[1], (sizey/2)+10, G.curscreen->sizey-(sizey/2)-10); + + if (pivot[0]!=mval[0] || pivot[1]!=mval[1]) + warp_pointer(pivot[0], pivot[1]); + + mywinset(G.curscreen->mainwin); + + x1= pivot[0]-sizex+10; + y1= pivot[1]-sizey/2; + + block= uiNewBlock(&listb, "button", UI_EMBOSS, UI_HELV, G.curscreen->mainwin); + uiBlockSetFlag(block, UI_BLOCK_LOOP|UI_BLOCK_REDRAW|UI_BLOCK_NUMSELECT|UI_BLOCK_ENTER_OK); + + dx= (sizex-5)/10; + dy= sizey/2; + + /* buttons have 0 as return event, to prevent menu to close on hotkeys */ + + uiBlockBeginAlign(block); + for(a=0; a<8; a++) + uiDefButBitS(block, TOGR, 1<<a, 0, "",(short)(x1+a*dx),(short)(y1+dy),(short)dx,(short)dy, lay, 0, 0, 0, 0, ""); + for(a=0; a<8; a++) + uiDefButBitS(block, TOGR, 1<<(a+8), 0, "",(short)(x1+a*dx),(short)y1,(short)dx,(short)dy, lay, 0, 0, 0, 0, ""); + + uiBlockEndAlign(block); + + x1-= 5; + uiDefBut(block, BUT, 1, "OK", (short)(x1+8*dx+10), (short)y1, (short)(3*dx), (short)(2*dy), NULL, 0, 0, 0, 0, ""); + + uiBoundsBlock(block, 2); + + ret= uiDoBlocks(&listb, 0); + + if(ret==UI_RETURN_OK) return 1; + return 0; +} + + + /* ********************** CLEVER_NUMBUTS ******************** */ #define MAXNUMBUTS 24 |