diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-11-03 16:28:32 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-11-03 16:28:32 +0400 |
commit | 17f90f8fe492622b7e66f09d5774fbf1fc7b6e85 (patch) | |
tree | fe73488f9604d41ea9a3a5e80319ebd13e9ecae9 /source/blender | |
parent | 6ea6e992ba427215bdd975effd3cb184866def0b (diff) |
Fix #29122: Curve Radius keyable from Outliner Datablock view but not Transform Radius field in 3D Viewport
If there's only one control point selected, show radius property for this point, not for medium value.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_buttons.c | 22 | ||||
-rw-r--r-- | source/blender/makesrna/RNA_access.h | 1 |
2 files changed, 19 insertions, 4 deletions
diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index 63b0f68f158..70cf113384b 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -139,6 +139,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float float median[7], ve_median[7]; int tot, totw, totweight, totedge, totradius; char defstr[320]; + PointerRNA radius_ptr; median[0]= median[1]= median[2]= median[3]= median[4]= median[5]= median[6]= 0.0; tot= totw= totweight= totedge= totradius= 0; @@ -210,6 +211,8 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float BezTriple *bezt; int a; ListBase *nurbs= curve_editnurbs(cu); + StructRNA *seltype= NULL; + void *selp= NULL; nu= nurbs->first; while(nu) { @@ -224,6 +227,8 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float totweight++; median[5]+= bezt->radius; totradius++; + selp= bezt; + seltype= &RNA_BezierSplinePoint; } else { if(bezt->f1 & SELECT) { @@ -251,12 +256,17 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float totweight++; median[5]+= bp->radius; totradius++; + selp= bp; + seltype= &RNA_SplinePoint; } bp++; } } nu= nu->next; } + + if(totradius==1) + RNA_pointer_create(&cu->id, seltype, selp, &radius_ptr); } else if(ob->type==OB_LATTICE) { Lattice *lt= ob->data; @@ -319,9 +329,11 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float uiBlockEndAlign(block); if(totweight) uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Weight:", 0, 20, 200, 20, &(tfp->ve_median[4]), 0.0, 1.0, 1, 3, ""); - if(totradius) - uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Radius:", 0, 20, 200, 20, &(tfp->ve_median[5]), 0.0, 100.0, 1, 3, "Radius of curve CPs"); + if(totradius) { + if(totradius==1) uiDefButR(block, NUM, 0, "Radius", 0, 20, 200, 20, &radius_ptr, "radius", 0, 0.0, 100.0, 10, 3, NULL); + else uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Radius:", 0, 20, 200, 20, &(tfp->ve_median[5]), 0.0, 100.0, 1, 3, "Radius of curve CPs"); } + } else { uiBlockBeginAlign(block); uiDefButBitS(block, TOG, V3D_GLOBAL_STATS, B_REDR, "Global", 0, 65, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays global values"); @@ -329,8 +341,10 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float uiBlockEndAlign(block); if(totweight) uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Weight:", 0, 40, 200, 20, &(tfp->ve_median[4]), 0.0, 1.0, 10, 3, ""); - if(totradius) - uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Radius:", 0, 40, 200, 20, &(tfp->ve_median[5]), 0.0, 100.0, 10, 3, "Radius of curve CPs"); + if(totradius) { + if(totradius==1) uiDefButR(block, NUM, 0, "Radius", 0, 40, 200, 20, &radius_ptr, "radius", 0, 0.0, 100.0, 10, 3, NULL); + else uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Radius:", 0, 40, 200, 20, &(tfp->ve_median[5]), 0.0, 100.0, 10, 3, "Radius of curve CPs"); + } } } else { diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index cf593555bc7..204f7b0b0ec 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -70,6 +70,7 @@ extern StructRNA RNA_ArmatureSensor; extern StructRNA RNA_ArrayModifier; extern StructRNA RNA_BackgroundImage; extern StructRNA RNA_BevelModifier; +extern StructRNA RNA_SplinePoint; extern StructRNA RNA_BezierSplinePoint; extern StructRNA RNA_BlendData; extern StructRNA RNA_BlendTexture; |