Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/blender/blenkernel/intern/fmodifier.c20
-rw-r--r--source/blender/editors/animation/CMakeLists.txt1
-rw-r--r--source/blender/editors/animation/SConscript2
-rw-r--r--source/blender/editors/animation/fmodifier_ui.c93
-rw-r--r--source/blender/editors/gpencil/CMakeLists.txt1
-rw-r--r--source/blender/editors/gpencil/SConscript2
-rw-r--r--source/blender/editors/gpencil/gpencil_buttons.c221
-rw-r--r--source/blender/editors/interface/interface_layout.c4
-rw-r--r--source/blender/editors/space_file/file_draw.c8
-rw-r--r--source/blender/editors/space_file/file_panels.c8
-rw-r--r--source/blender/editors/space_graph/graph_buttons.c101
-rw-r--r--source/blender/editors/space_graph/graph_edit.c7
-rw-r--r--source/blender/editors/space_view3d/view3d_buttons.c761
-rw-r--r--source/blender/makesrna/intern/rna_gpencil.c8
-rw-r--r--source/blender/render/CMakeLists.txt1
-rw-r--r--source/blender/render/SConscript2
-rw-r--r--source/blender/render/intern/source/external_engine.c6
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c2
18 files changed, 663 insertions, 585 deletions
diff --git a/source/blender/blenkernel/intern/fmodifier.c b/source/blender/blenkernel/intern/fmodifier.c
index 19b036d9ccf..ae474f9d9c3 100644
--- a/source/blender/blenkernel/intern/fmodifier.c
+++ b/source/blender/blenkernel/intern/fmodifier.c
@@ -39,6 +39,8 @@
#include "DNA_anim_types.h"
+#include "BLF_translation.h"
+
#include "BLI_blenlib.h"
#include "BLI_math.h" /* windows needs for M_PI */
#include "BLI_utildefines.h"
@@ -264,7 +266,7 @@ static FModifierTypeInfo FMI_GENERATOR = {
sizeof(FMod_Generator), /* size */
FMI_TYPE_GENERATE_CURVE, /* action type */
FMI_REQUIRES_NOTHING, /* requirements */
- "Generator", /* name */
+ N_("Generator"), /* name */
"FMod_Generator", /* struct name */
fcm_generator_free, /* free data */
fcm_generator_copy, /* copy data */
@@ -386,7 +388,7 @@ static FModifierTypeInfo FMI_FN_GENERATOR = {
sizeof(FMod_FunctionGenerator), /* size */
FMI_TYPE_GENERATE_CURVE, /* action type */
FMI_REQUIRES_NOTHING, /* requirements */
- "Built-In Function", /* name */
+ N_("Built-In Function"), /* name */
"FMod_FunctionGenerator", /* struct name */
NULL, /* free data */
NULL, /* copy data */
@@ -493,7 +495,7 @@ static FModifierTypeInfo FMI_ENVELOPE = {
sizeof(FMod_Envelope), /* size */
FMI_TYPE_REPLACE_VALUES, /* action type */
0, /* requirements */
- "Envelope", /* name */
+ N_("Envelope"), /* name */
"FMod_Envelope", /* struct name */
fcm_envelope_free, /* free data */
fcm_envelope_copy, /* copy data */
@@ -690,7 +692,7 @@ static FModifierTypeInfo FMI_CYCLES = {
sizeof(FMod_Cycles), /* size */
FMI_TYPE_EXTRAPOLATION, /* action type */
FMI_REQUIRES_ORIGINAL_DATA, /* requirements */
- "Cycles", /* name */
+ N_("Cycles"), /* name */
"FMod_Cycles", /* struct name */
NULL, /* free data */
NULL, /* copy data */
@@ -748,7 +750,7 @@ static FModifierTypeInfo FMI_NOISE = {
sizeof(FMod_Noise), /* size */
FMI_TYPE_REPLACE_VALUES, /* action type */
0, /* requirements */
- "Noise", /* name */
+ N_("Noise"), /* name */
"FMod_Noise", /* struct name */
NULL, /* free data */
NULL, /* copy data */
@@ -766,7 +768,7 @@ static FModifierTypeInfo FMI_FILTER = {
sizeof(FMod_Filter), /* size */
FMI_TYPE_REPLACE_VALUES, /* action type */
0, /* requirements */
- "Filter", /* name */
+ N_("Filter"), /* name */
"FMod_Filter", /* struct name */
NULL, /* free data */
NULL, /* copy data */
@@ -822,7 +824,7 @@ static FModifierTypeInfo FMI_PYTHON = {
sizeof(FMod_Python), /* size */
FMI_TYPE_GENERATE_CURVE, /* action type */
FMI_REQUIRES_RUNTIME_CHECK, /* requirements */
- "Python", /* name */
+ N_("Python"), /* name */
"FMod_Python", /* struct name */
fcm_python_free, /* free data */
fcm_python_copy, /* copy data */
@@ -865,7 +867,7 @@ static FModifierTypeInfo FMI_LIMITS = {
sizeof(FMod_Limits), /* size */
FMI_TYPE_GENERATE_CURVE, /* action type */ /* XXX... err... */
FMI_REQUIRES_RUNTIME_CHECK, /* requirements */
- "Limits", /* name */
+ N_("Limits"), /* name */
"FMod_Limits", /* struct name */
NULL, /* free data */
NULL, /* copy data */
@@ -918,7 +920,7 @@ static FModifierTypeInfo FMI_STEPPED = {
sizeof(FMod_Limits), /* size */
FMI_TYPE_GENERATE_CURVE, /* action type */ /* XXX... err... */
FMI_REQUIRES_RUNTIME_CHECK, /* requirements */
- "Stepped", /* name */
+ N_("Stepped"), /* name */
"FMod_Stepped", /* struct name */
NULL, /* free data */
NULL, /* copy data */
diff --git a/source/blender/editors/animation/CMakeLists.txt b/source/blender/editors/animation/CMakeLists.txt
index 0386af9776c..2549358f285 100644
--- a/source/blender/editors/animation/CMakeLists.txt
+++ b/source/blender/editors/animation/CMakeLists.txt
@@ -20,6 +20,7 @@
set(INC
../include
+ ../../blenfont
../../blenkernel
../../blenlib
../../blenloader
diff --git a/source/blender/editors/animation/SConscript b/source/blender/editors/animation/SConscript
index 3e5133c1174..120000fedc4 100644
--- a/source/blender/editors/animation/SConscript
+++ b/source/blender/editors/animation/SConscript
@@ -3,7 +3,7 @@ Import ('env')
sources = env.Glob('*.c')
-incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../makesrna ../../imbuf'
+incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../makesrna ../../imbuf ../../blenfont'
incs += ' ../../bmesh ../../windowmanager #/intern/guardedalloc #/extern/glew/include ../../blenloader'
env.BlenderLib ( 'bf_editors_animation', sources, Split(incs), [], libtype=['core'], priority=[125] )
diff --git a/source/blender/editors/animation/fmodifier_ui.c b/source/blender/editors/animation/fmodifier_ui.c
index 0b63a0ad752..f2e18983e05 100644
--- a/source/blender/editors/animation/fmodifier_ui.c
+++ b/source/blender/editors/animation/fmodifier_ui.c
@@ -45,6 +45,8 @@
#include "MEM_guardedalloc.h"
+#include "BLF_translation.h"
+
#include "BLI_blenlib.h"
#include "BLI_utildefines.h"
@@ -141,39 +143,50 @@ static void draw_modifier__generator(uiLayout *layout, ID *id, FModifier *fcm, s
/* draw polynomial order selector */
row= uiLayoutRow(layout, 0);
block= uiLayoutGetBlock(row);
- but= uiDefButI(block, NUM, B_FMODIFIER_REDRAW, "Poly Order: ", 10,0,width-30,19, &data->poly_order, 1, 100, 0, 0, "'Order' of the Polynomial - for a polynomial with n terms, 'order' is n-1");
+ but= uiDefButI(block, NUM, B_FMODIFIER_REDRAW, IFACE_("Poly Order:"), 10, 0, width-30, 19,
+ &data->poly_order, 1, 100, 0, 0,
+ TIP_("'Order' of the Polynomial (for a polynomial with n terms, 'order' is n-1)"));
uiButSetFunc(but, validate_fmodifier_cb, fcm, NULL);
/* draw controls for each coefficient and a + sign at end of row */
row= uiLayoutRow(layout, 1);
block= uiLayoutGetBlock(row);
- uiDefBut(block, LABEL, 1, "y = ", 0, 0, 50, 20, NULL, 0.0, 0.0, 0, 0, "");
cp= data->coefficients;
for (i=0; (i < data->arraysize) && (cp); i++, cp++) {
+ /* To align with first line. */
+ if (i)
+ uiDefBut(block, LABEL, 1, " ", 0, 0, 50, 20, NULL, 0.0, 0.0, 0, 0, "");
+ else
+ uiDefBut(block, LABEL, 1, "y =", 0, 0, 50, 20, NULL, 0.0, 0.0, 0, 0, "");
/* coefficient */
- uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 0, 0, 150, 20, cp, -UI_FLT_MAX, UI_FLT_MAX, 10, 3, "Coefficient for polynomial");
+ uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 0, 0, 150, 20, cp, -UI_FLT_MAX, UI_FLT_MAX,
+ 10, 3, TIP_("Coefficient for polynomial"));
/* 'x' param (and '+' if necessary) */
- if (i) {
- if (i == 1)
- strcpy(xval, "x");
- else
- sprintf(xval, "x^%u", i);
- uiDefBut(block, LABEL, 1, xval, 0, 0, 50, 20, NULL, 0.0, 0.0, 0, 0, "Power of x");
- }
+ if (i == 0)
+ strcpy(xval, "");
+ else if (i == 1)
+ strcpy(xval, "x");
+ else
+ sprintf(xval, "x^%u", i);
+ uiDefBut(block, LABEL, 1, xval, 0, 0, 50, 20, NULL, 0.0, 0.0, 0, 0, TIP_("Power of x"));
if ( (i != (data->arraysize - 1)) || ((i==0) && data->arraysize==2) ) {
- uiDefBut(block, LABEL, 1, "+", 0,0 , 30, 20, NULL, 0.0, 0.0, 0, 0, "");
+ uiDefBut(block, LABEL, 1, "+", 0, 0, 30, 20, NULL, 0.0, 0.0, 0, 0, "");
/* next coefficient on a new row */
row= uiLayoutRow(layout, 1);
block= uiLayoutGetBlock(row);
}
+ else {
+ /* For alignement in UI! */
+ uiDefBut(block, LABEL, 1, " ", 0, 0, 30, 20, NULL, 0.0, 0.0, 0, 0, "");
+ }
}
- }
break;
+ }
case FCM_GENERATOR_POLYNOMIAL_FACTORISED: /* Factorized polynomial expression */
{
@@ -183,26 +196,34 @@ static void draw_modifier__generator(uiLayout *layout, ID *id, FModifier *fcm, s
/* draw polynomial order selector */
row= uiLayoutRow(layout, 0);
block= uiLayoutGetBlock(row);
- but= uiDefButI(block, NUM, B_FMODIFIER_REDRAW, "Poly Order: ", 0,0,width-30,19, &data->poly_order, 1, 100, 0, 0, "'Order' of the Polynomial - for a polynomial with n terms, 'order' is n-1");
+ but= uiDefButI(block, NUM, B_FMODIFIER_REDRAW, IFACE_("Poly Order:"), 0, 0, width-30, 19,
+ &data->poly_order, 1, 100, 0, 0,
+ TIP_("'Order' of the Polynomial (for a polynomial with n terms, 'order' is n-1)"));
uiButSetFunc(but, validate_fmodifier_cb, fcm, NULL);
/* draw controls for each pair of coefficients */
row= uiLayoutRow(layout, 1);
block= uiLayoutGetBlock(row);
- uiDefBut(block, LABEL, 1, "y=", 0, 0, 50, 20, NULL, 0.0, 0.0, 0, 0, "");
cp= data->coefficients;
for (i=0; (i < data->poly_order) && (cp); i++, cp+=2) {
+ /* To align with first line. */
+ if (i)
+ uiDefBut(block, LABEL, 1, " ", 0, 0, 50, 20, NULL, 0.0, 0.0, 0, 0, "");
+ else
+ uiDefBut(block, LABEL, 1, "y =", 0, 0, 50, 20, NULL, 0.0, 0.0, 0, 0, "");
/* opening bracket */
uiDefBut(block, LABEL, 1, "(", 0, 0, 20, 20, NULL, 0.0, 0.0, 0, 0, "");
/* coefficients */
- uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 0, 0, 100, 20, cp, -UI_FLT_MAX, UI_FLT_MAX, 10, 3, "Coefficient of x");
+ uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 0, 0, 100, 20, cp, -UI_FLT_MAX, UI_FLT_MAX,
+ 10, 3, TIP_("Coefficient of x"));
- uiDefBut(block, LABEL, 1, "x+", 0, 0, 40, 20, NULL, 0.0, 0.0, 0, 0, "");
+ uiDefBut(block, LABEL, 1, "x +", 0, 0, 40, 20, NULL, 0.0, 0.0, 0, 0, "");
- uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 0, 0, 100, 20, cp+1, -UI_FLT_MAX, UI_FLT_MAX, 10, 3, "Second coefficient");
+ uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "", 0, 0, 100, 20, cp+1, -UI_FLT_MAX, UI_FLT_MAX,
+ 10, 3, TIP_("Second coefficient"));
/* closing bracket and '+' sign */
if ( (i != (data->poly_order - 1)) || ((i==0) && data->poly_order==2) ) {
@@ -261,13 +282,13 @@ static void draw_modifier__cycles(uiLayout *layout, ID *id, FModifier *fcm, shor
/* before range */
col= uiLayoutColumn(split, 1);
- uiItemL(col, "Before:", ICON_NONE);
+ uiItemL(col, IFACE_("Before:"), ICON_NONE);
uiItemR(col, &ptr, "mode_before", 0, "", ICON_NONE);
uiItemR(col, &ptr, "cycles_before", 0, NULL, ICON_NONE);
/* after range */
col= uiLayoutColumn(split, 1);
- uiItemL(col, "After:", ICON_NONE);
+ uiItemL(col, IFACE_("After:"), ICON_NONE);
uiItemR(col, &ptr, "mode_after", 0, "", ICON_NONE);
uiItemR(col, &ptr, "cycles_after", 0, NULL, ICON_NONE);
}
@@ -479,12 +500,12 @@ static void draw_modifier__envelope(uiLayout *layout, ID *id, FModifier *fcm, sh
/* general settings */
col= uiLayoutColumn(layout, 1);
- uiItemL(col, "Envelope:", ICON_NONE);
+ uiItemL(col, IFACE_("Envelope:"), ICON_NONE);
uiItemR(col, &ptr, "reference_value", 0, NULL, ICON_NONE);
row= uiLayoutRow(col, 1);
- uiItemR(row, &ptr, "default_min", 0, "Min", ICON_NONE);
- uiItemR(row, &ptr, "default_max", 0, "Max", ICON_NONE);
+ uiItemR(row, &ptr, "default_min", 0, IFACE_("Min"), ICON_NONE);
+ uiItemR(row, &ptr, "default_max", 0, IFACE_("Max"), ICON_NONE);
/* control points header */
// TODO: move this control-point control stuff to using the new special widgets for lists
@@ -492,9 +513,10 @@ static void draw_modifier__envelope(uiLayout *layout, ID *id, FModifier *fcm, sh
row= uiLayoutRow(layout, 0);
block= uiLayoutGetBlock(row);
- uiDefBut(block, LABEL, 1, "Control Points:", 0, 0, 150, 20, NULL, 0.0, 0.0, 0, 0, "");
+ uiDefBut(block, LABEL, 1, IFACE_("Control Points:"), 0, 0, 150, 20, NULL, 0.0, 0.0, 0, 0, "");
- but= uiDefBut(block, BUT, B_FMODIFIER_REDRAW, "Add Point", 0,0,150,19, NULL, 0, 0, 0, 0, "Adds a new control-point to the envelope on the current frame");
+ but= uiDefBut(block, BUT, B_FMODIFIER_REDRAW, IFACE_("Add Point"), 0, 0, 150, 19,
+ NULL, 0, 0, 0, 0, TIP_("Add a new control-point to the envelope on the current frame"));
uiButSetFunc(but, fmod_envelope_addpoint_cb, env, NULL);
/* control points list */
@@ -504,13 +526,17 @@ static void draw_modifier__envelope(uiLayout *layout, ID *id, FModifier *fcm, sh
block= uiLayoutGetBlock(row);
uiBlockBeginAlign(block);
- but=uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Fra:", 0, 0, 90, 20, &fed->time, -MAXFRAMEF, MAXFRAMEF, 10, 1, "Frame that envelope point occurs");
+ but=uiDefButF(block, NUM, B_FMODIFIER_REDRAW, IFACE_("Fra:"), 0, 0, 90, 20,
+ &fed->time, -MAXFRAMEF, MAXFRAMEF, 10, 1, TIP_("Frame that envelope point occurs"));
uiButSetFunc(but, validate_fmodifier_cb, fcm, NULL);
- uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Min:", 0, 0, 100, 20, &fed->min, -UI_FLT_MAX, UI_FLT_MAX, 10, 2, "Minimum bound of envelope at this point");
- uiDefButF(block, NUM, B_FMODIFIER_REDRAW, "Max:", 0, 0, 100, 20, &fed->max, -UI_FLT_MAX, UI_FLT_MAX, 10, 2, "Maximum bound of envelope at this point");
+ uiDefButF(block, NUM, B_FMODIFIER_REDRAW, IFACE_("Min:"), 0, 0, 100, 20,
+ &fed->min, -UI_FLT_MAX, UI_FLT_MAX, 10, 2, TIP_("Minimum bound of envelope at this point"));
+ uiDefButF(block, NUM, B_FMODIFIER_REDRAW, IFACE_("Max:"), 0, 0, 100, 20,
+ &fed->max, -UI_FLT_MAX, UI_FLT_MAX, 10, 2, TIP_("Maximum bound of envelope at this point"));
- but= uiDefIconBut(block, BUT, B_FMODIFIER_REDRAW, ICON_X, 0, 0, 18, 20, NULL, 0.0, 0.0, 0.0, 0.0, "Delete envelope control point");
+ but= uiDefIconBut(block, BUT, B_FMODIFIER_REDRAW, ICON_X, 0, 0, 18, 20,
+ NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Delete envelope control point"));
uiButSetFunc(but, fmod_envelope_deletepoint_cb, env, SET_INT_IN_POINTER(i));
uiBlockBeginAlign(block);
}
@@ -648,7 +674,8 @@ void ANIM_uiTemplate_fmodifier_draw (uiLayout *layout, ID *id, ListBase *modifie
uiBlockSetEmboss(block, UI_EMBOSSN);
/* delete button */
- but= uiDefIconBut(block, BUT, B_REDR, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, "Delete F-Curve Modifier");
+ but= uiDefIconBut(block, BUT, B_REDR, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y,
+ NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Delete F-Curve Modifier"));
uiButSetFunc(but, delete_fmodifier_cb, modifiers, fcm);
uiBlockSetEmboss(block, UI_EMBOSS);
@@ -709,14 +736,14 @@ void ANIM_uiTemplate_fmodifier_draw (uiLayout *layout, ID *id, ListBase *modifie
/* second row: settings */
row = uiLayoutRow(col, 1);
- uiItemR(row, &ptr, "frame_start", 0, "Start", ICON_NONE);
- uiItemR(row, &ptr, "frame_end", 0, "End", ICON_NONE);
+ uiItemR(row, &ptr, "frame_start", 0, IFACE_("Start"), ICON_NONE);
+ uiItemR(row, &ptr, "frame_end", 0, IFACE_("End"), ICON_NONE);
/* third row: blending influence */
row = uiLayoutRow(col, 1);
- uiItemR(row, &ptr, "blend_in", 0, "In", ICON_NONE);
- uiItemR(row, &ptr, "blend_out", 0, "Out", ICON_NONE);
+ uiItemR(row, &ptr, "blend_in", 0, IFACE_("In"), ICON_NONE);
+ uiItemR(row, &ptr, "blend_out", 0, IFACE_("Out"), ICON_NONE);
}
/* influence -------------------------------------------------------------- */
diff --git a/source/blender/editors/gpencil/CMakeLists.txt b/source/blender/editors/gpencil/CMakeLists.txt
index 15707bfc4d0..ce21d47ae48 100644
--- a/source/blender/editors/gpencil/CMakeLists.txt
+++ b/source/blender/editors/gpencil/CMakeLists.txt
@@ -20,6 +20,7 @@
set(INC
../include
+ ../../blenfont
../../blenkernel
../../blenlib
../../blenloader
diff --git a/source/blender/editors/gpencil/SConscript b/source/blender/editors/gpencil/SConscript
index 6c23e77208a..dca419d2fb7 100644
--- a/source/blender/editors/gpencil/SConscript
+++ b/source/blender/editors/gpencil/SConscript
@@ -5,7 +5,7 @@ sources = env.Glob('*.c')
incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf'
incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
-incs += ' ../../gpu ../../blenloader ../../bmesh'
+incs += ' ../../gpu ../../blenloader ../../bmesh ../../blenfont'
incs += ' ../../makesrna ../../render/extern/include #/intern/elbeem/extern'
env.BlenderLib ( 'bf_editors_gpencil', sources, Split(incs), [], libtype=['core'], priority=[45] )
diff --git a/source/blender/editors/gpencil/gpencil_buttons.c b/source/blender/editors/gpencil/gpencil_buttons.c
index 46241f3d378..1036921db4b 100644
--- a/source/blender/editors/gpencil/gpencil_buttons.c
+++ b/source/blender/editors/gpencil/gpencil_buttons.c
@@ -27,7 +27,7 @@
* \ingroup edgpencil
*/
-
+
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
@@ -37,6 +37,8 @@
#include "BLI_math.h"
#include "BLI_blenlib.h"
+#include "BLF_translation.h"
+
#include "DNA_gpencil_types.h"
#include "DNA_screen_types.h"
@@ -69,207 +71,206 @@
/* These are just 'dummy wrappers' around gpencil api calls */
/* make layer active one after being clicked on */
-static void gp_ui_activelayer_cb (bContext *C, void *gpd, void *gpl)
+static void gp_ui_activelayer_cb(bContext *C, void *gpd, void *gpl)
{
/* make sure the layer we want to remove is the active one */
gpencil_layer_setactive(gpd, gpl);
- WM_event_add_notifier(C, NC_SCREEN|ND_GPENCIL|NA_EDITED, NULL); // XXX please work!
+ WM_event_add_notifier(C, NC_SCREEN|ND_GPENCIL|NA_EDITED, NULL); /* XXX please work! */
}
/* delete 'active' layer */
-static void gp_ui_dellayer_cb (bContext *C, void *gpd, void *gpl)
+static void gp_ui_dellayer_cb(bContext *C, void *gpd, void *gpl)
{
/* make sure the layer we want to remove is the active one */
- gpencil_layer_setactive(gpd, gpl);
+ gpencil_layer_setactive(gpd, gpl);
gpencil_layer_delactive(gpd);
-
- WM_event_add_notifier(C, NC_SCREEN|ND_GPENCIL|NA_EDITED, NULL); // XXX please work!
-}
+ WM_event_add_notifier(C, NC_SCREEN|ND_GPENCIL|NA_EDITED, NULL); /* XXX please work! */
+}
/* ------- Drawing Code ------- */
/* draw the controls for a given layer */
-static void gp_drawui_layer (uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl, const short is_v3d)
+static void gp_drawui_layer(uiLayout *layout, bGPdata *gpd, bGPDlayer *gpl, const short is_v3d)
{
- uiLayout *box=NULL, *split=NULL;
- uiLayout *col=NULL;
- uiLayout *row=NULL, *sub=NULL;
+ uiLayout *box = NULL, *split = NULL;
+ uiLayout *col = NULL;
+ uiLayout *row = NULL, *sub = NULL;
uiBlock *block;
uiBut *but;
PointerRNA ptr;
int icon;
-
+
/* make pointer to layer data */
RNA_pointer_create((ID *)gpd, &RNA_GPencilLayer, gpl, &ptr);
-
+
/* unless button has own callback, it adds this callback to button */
- block= uiLayoutGetBlock(layout);
+ block = uiLayoutGetBlock(layout);
uiBlockSetFunc(block, gp_ui_activelayer_cb, gpd, gpl);
-
+
/* draw header ---------------------------------- */
/* get layout-row + UI-block for header */
- box= uiLayoutBox(layout);
-
- row= uiLayoutRow(box, 0);
+ box = uiLayoutBox(layout);
+
+ row = uiLayoutRow(box, 0);
uiLayoutSetAlignment(row, UI_LAYOUT_ALIGN_EXPAND);
- block= uiLayoutGetBlock(row); // err...
-
+ block = uiLayoutGetBlock(row); /* err... */
+
uiBlockSetEmboss(block, UI_EMBOSSN);
-
+
/* left-align ............................... */
- sub= uiLayoutRow(row, 0);
-
+ sub = uiLayoutRow(row, 0);
+
/* active */
- block= uiLayoutGetBlock(sub);
- icon= (gpl->flag & GP_LAYER_ACTIVE) ? ICON_RADIOBUT_ON : ICON_RADIOBUT_OFF;
- but= uiDefIconButBitI(block, TOG, GP_LAYER_ACTIVE, 0, icon, 0, 0, UI_UNIT_X, UI_UNIT_Y, &gpd->flag, 0.0, 0.0, 0.0, 0.0, "Set active layer");
+ block = uiLayoutGetBlock(sub);
+ icon = (gpl->flag & GP_LAYER_ACTIVE) ? ICON_RADIOBUT_ON : ICON_RADIOBUT_OFF;
+ but = uiDefIconButBitI(block, TOG, GP_LAYER_ACTIVE, 0, icon, 0, 0, UI_UNIT_X, UI_UNIT_Y,
+ &gpd->flag, 0.0, 0.0, 0.0, 0.0, TIP_("Set active layer"));
uiButSetFunc(but, gp_ui_activelayer_cb, gpd, gpl);
/* locked */
- icon= (gpl->flag & GP_LAYER_LOCKED) ? ICON_LOCKED : ICON_UNLOCKED;
+ icon = (gpl->flag & GP_LAYER_LOCKED) ? ICON_LOCKED : ICON_UNLOCKED;
uiItemR(sub, &ptr, "lock", 0, "", icon);
-
+
/* when layer is locked or hidden, only draw header */
if (gpl->flag & (GP_LAYER_LOCKED|GP_LAYER_HIDE)) {
char name[256]; /* gpl->info is 128, but we need space for 'locked/hidden' as well */
-
+
/* visibility button (only if hidden but not locked!) */
if ((gpl->flag & GP_LAYER_HIDE) && !(gpl->flag & GP_LAYER_LOCKED))
- uiItemR(sub, &ptr, "hide", 0, "", ICON_RESTRICT_VIEW_ON);
-
-
+ uiItemR(sub, &ptr, "hide", 0, "", ICON_RESTRICT_VIEW_ON);
+
/* name */
if (gpl->flag & GP_LAYER_HIDE)
- BLI_snprintf(name, sizeof(name), "%s (Hidden)", gpl->info);
+ BLI_snprintf(name, sizeof(name), IFACE_("%s (Hidden)"), gpl->info);
else
- BLI_snprintf(name, sizeof(name), "%s (Locked)", gpl->info);
+ BLI_snprintf(name, sizeof(name), IFACE_("%s (Locked)"), gpl->info);
uiItemL(sub, name, ICON_NONE);
-
+
/* delete button (only if hidden but not locked!) */
if ((gpl->flag & GP_LAYER_HIDE) && !(gpl->flag & GP_LAYER_LOCKED)) {
/* right-align ............................... */
- sub= uiLayoutRow(row, 1);
+ sub = uiLayoutRow(row, 1);
uiLayoutSetAlignment(sub, UI_LAYOUT_ALIGN_RIGHT);
- block= uiLayoutGetBlock(sub); // XXX... err...
-
- but= uiDefIconBut(block, BUT, 0, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, "Delete layer");
+ block = uiLayoutGetBlock(sub); /* XXX... err... */
+
+ but = uiDefIconBut(block, BUT, 0, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y,
+ NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Delete layer"));
uiButSetFunc(but, gp_ui_dellayer_cb, gpd, gpl);
- }
+ }
uiBlockSetEmboss(block, UI_EMBOSS);
}
else {
/* draw rest of header -------------------------------- */
/* visibility button */
- uiItemR(sub, &ptr, "hide", 0, "", ICON_RESTRICT_VIEW_OFF);
-
+ uiItemR(sub, &ptr, "hide", 0, "", ICON_RESTRICT_VIEW_OFF);
+
/* frame locking */
- // TODO: this needs its own icons...
- icon= (gpl->flag & GP_LAYER_FRAMELOCK) ? ICON_RENDER_STILL : ICON_RENDER_ANIMATION;
- uiItemR(sub, &ptr, "lock_frame", 0, "", icon);
-
+ /* TODO: this needs its own icons... */
+ icon = (gpl->flag & GP_LAYER_FRAMELOCK) ? ICON_RENDER_STILL : ICON_RENDER_ANIMATION;
+ uiItemR(sub, &ptr, "lock_frame", 0, "", icon);
+
uiBlockSetEmboss(block, UI_EMBOSS);
-
+
/* name */
uiItemR(sub, &ptr, "info", 0, "", ICON_NONE);
-
+
/* delete 'button' */
uiBlockSetEmboss(block, UI_EMBOSSN);
- /* right-align ............................... */
- sub= uiLayoutRow(row, 1);
- uiLayoutSetAlignment(sub, UI_LAYOUT_ALIGN_RIGHT);
- block= uiLayoutGetBlock(sub); // XXX... err...
-
- but= uiDefIconBut(block, BUT, 0, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, "Delete layer");
- uiButSetFunc(but, gp_ui_dellayer_cb, gpd, gpl);
+ /* right-align ............................... */
+ sub = uiLayoutRow(row, 1);
+ uiLayoutSetAlignment(sub, UI_LAYOUT_ALIGN_RIGHT);
+ block = uiLayoutGetBlock(sub); /* XXX... err... */
+
+ but = uiDefIconBut(block, BUT, 0, ICON_X, 0, 0, UI_UNIT_X, UI_UNIT_Y,
+ NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Delete layer"));
+ uiButSetFunc(but, gp_ui_dellayer_cb, gpd, gpl);
uiBlockSetEmboss(block, UI_EMBOSS);
-
-
+
/* new backdrop ----------------------------------- */
- box= uiLayoutBox(layout);
- split= uiLayoutSplit(box, 0.5f, 0);
-
+ box = uiLayoutBox(layout);
+ split = uiLayoutSplit(box, 0.5f, 0);
+
/* draw settings ---------------------------------- */
/* left column ..................... */
- col= uiLayoutColumn(split, 0);
-
+ col = uiLayoutColumn(split, 0);
+
/* color */
- sub= uiLayoutColumn(col, 1);
+ sub = uiLayoutColumn(col, 1);
uiItemR(sub, &ptr, "color", 0, "", ICON_NONE);
uiItemR(sub, &ptr, "alpha", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
-
+
/* stroke thickness */
uiItemR(col, &ptr, "line_width", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
-
+
/* debugging options */
if (G.f & G_DEBUG) {
uiItemR(col, &ptr, "show_points", 0, NULL, ICON_NONE);
}
-
+
/* right column ................... */
- col= uiLayoutColumn(split, 0);
-
+ col = uiLayoutColumn(split, 0);
+
/* onion-skinning */
- sub= uiLayoutColumn(col, 1);
- uiItemR(sub, &ptr, "use_onion_skinning", 0, "Onion Skinning", ICON_NONE);
- uiItemR(sub, &ptr, "ghost_range_max", 0, "Frames", ICON_NONE); // XXX shorter name here? i.e. GStep
-
+ sub = uiLayoutColumn(col, 1);
+ uiItemR(sub, &ptr, "use_onion_skinning", 0, NULL, ICON_NONE);
+ uiItemR(sub, &ptr, "ghost_range_max", 0, IFACE_("Frames"), ICON_NONE);
+
/* 3d-view specific drawing options */
if (is_v3d) {
- uiItemR(col, &ptr, "show_x_ray", 0, "X-Ray", ICON_NONE);
+ uiItemR(col, &ptr, "show_x_ray", 0, NULL, ICON_NONE);
}
-
}
-}
+}
/* stroke drawing options available */
typedef enum eGP_Stroke_Ops {
- STROKE_OPTS_NORMAL = 0,
- STROKE_OPTS_V3D_OFF,
- STROKE_OPTS_V3D_ON,
+ STROKE_OPTS_NORMAL = 0,
+ STROKE_OPTS_V3D_OFF = 1,
+ STROKE_OPTS_V3D_ON = 2,
} eGP_Stroke_Ops;
/* Draw the contents for a grease-pencil panel*/
-static void draw_gpencil_panel (bContext *C, uiLayout *layout, bGPdata *gpd, PointerRNA *ctx_ptr)
+static void draw_gpencil_panel(bContext *C, uiLayout *layout, bGPdata *gpd, PointerRNA *ctx_ptr)
{
PointerRNA gpd_ptr;
bGPDlayer *gpl;
uiLayout *col, *row;
short v3d_stroke_opts = STROKE_OPTS_NORMAL;
- const short is_v3d= CTX_wm_view3d(C) != NULL;
-
+ const short is_v3d = CTX_wm_view3d(C) != NULL;
+
/* make new PointerRNA for Grease Pencil block */
RNA_id_pointer_create((ID *)gpd, &gpd_ptr);
-
+
/* draw gpd settings first ------------------------------------- */
- col= uiLayoutColumn(layout, 0);
- /* current Grease Pencil block */
- // TODO: show some info about who owns this?
- uiTemplateID(col, C, ctx_ptr, "grease_pencil", "GPENCIL_OT_data_add", NULL, "GPENCIL_OT_data_unlink");
-
- /* add new layer button - can be used even when no data, since it can add a new block too */
- uiItemO(col, "New Layer", ICON_NONE, "GPENCIL_OT_layer_add");
- row= uiLayoutRow(col, 1);
- uiItemO(row, "Delete Frame", ICON_NONE, "GPENCIL_OT_active_frame_delete");
- uiItemO(row, "Convert", ICON_NONE, "GPENCIL_OT_convert");
-
+ col = uiLayoutColumn(layout, 0);
+ /* current Grease Pencil block */
+ /* TODO: show some info about who owns this? */
+ uiTemplateID(col, C, ctx_ptr, "grease_pencil", "GPENCIL_OT_data_add", NULL, "GPENCIL_OT_data_unlink");
+
+ /* add new layer button - can be used even when no data, since it can add a new block too */
+ uiItemO(col, IFACE_("New Layer"), ICON_NONE, "GPENCIL_OT_layer_add");
+ row = uiLayoutRow(col, 1);
+ uiItemO(row, IFACE_("Delete Frame"), ICON_NONE, "GPENCIL_OT_active_frame_delete");
+ uiItemO(row, IFACE_("Convert"), ICON_NONE, "GPENCIL_OT_convert");
+
/* sanity checks... */
if (gpd == NULL)
return;
-
+
/* draw each layer --------------------------------------------- */
- for (gpl= gpd->layers.first; gpl; gpl= gpl->next) {
- col= uiLayoutColumn(layout, 1);
- gp_drawui_layer(col, gpd, gpl, is_v3d);
+ for (gpl = gpd->layers.first; gpl; gpl = gpl->next) {
+ col = uiLayoutColumn(layout, 1);
+ gp_drawui_layer(col, gpd, gpl, is_v3d);
}
-
+
/* draw gpd drawing settings first ------------------------------------- */
- col= uiLayoutColumn(layout, 1);
+ col = uiLayoutColumn(layout, 1);
/* label */
- uiItemL(col, "Drawing Settings:", ICON_NONE);
-
+ uiItemL(col, IFACE_("Drawing Settings:"), ICON_NONE);
+
/* check whether advanced 3D-View drawing space options can be used */
if (is_v3d) {
if (gpd->flag & (GP_DATA_DEPTH_STROKE|GP_DATA_DEPTH_VIEW))
@@ -277,7 +278,7 @@ static void draw_gpencil_panel (bContext *C, uiLayout *layout, bGPdata *gpd, Poi
else
v3d_stroke_opts = STROKE_OPTS_V3D_OFF;
}
-
+
/* drawing space options */
row= uiLayoutRow(col, 1);
uiItemEnumR_string(row, &gpd_ptr, "draw_mode", "VIEW", NULL, ICON_NONE);
@@ -286,11 +287,11 @@ static void draw_gpencil_panel (bContext *C, uiLayout *layout, bGPdata *gpd, Poi
uiLayoutSetActive(row, v3d_stroke_opts);
uiItemEnumR_string(row, &gpd_ptr, "draw_mode", "SURFACE", NULL, ICON_NONE);
uiItemEnumR_string(row, &gpd_ptr, "draw_mode", "STROKE", NULL, ICON_NONE);
-
+
row= uiLayoutRow(col, 0);
uiLayoutSetActive(row, v3d_stroke_opts==STROKE_OPTS_V3D_ON);
uiItemR(row, &gpd_ptr, "use_stroke_endpoints", 0, NULL, ICON_NONE);
-}
+}
/* Standard panel to be included wherever Grease Pencil is used... */
@@ -298,12 +299,12 @@ void gpencil_panel_standard(const bContext *C, Panel *pa)
{
bGPdata **gpd_ptr = NULL;
PointerRNA ptr;
-
- //if (v3d->flag2 & V3D_DISPGP)... etc.
-
+
+ /* if (v3d->flag2 & V3D_DISPGP)... etc. */
+
/* get pointer to Grease Pencil Data */
- gpd_ptr= gpencil_data_get_pointers((bContext *)C, &ptr);
-
+ gpd_ptr = gpencil_data_get_pointers((bContext *)C, &ptr);
+
if (gpd_ptr)
draw_gpencil_panel((bContext *)C, pa->layout, *gpd_ptr, &ptr);
}
diff --git a/source/blender/editors/interface/interface_layout.c b/source/blender/editors/interface/interface_layout.c
index a258d22a8dc..a0dbecbd4a6 100644
--- a/source/blender/editors/interface/interface_layout.c
+++ b/source/blender/editors/interface/interface_layout.c
@@ -2884,8 +2884,8 @@ void uiLayoutOperatorButs(const bContext *C, uiLayout *layout, wmOperator *op,in
col= uiLayoutColumn(layout, 0);
block= uiLayoutGetBlock(col);
- but = uiDefIconTextBut(block , BUT, 0, ICON_FILE_REFRESH, "Reset", 0, 0, 18, 20, NULL, 0.0, 0.0, 0.0, 0.0,
- "Reset operator defaults");
+ but = uiDefIconTextBut(block , BUT, 0, ICON_FILE_REFRESH, IFACE_("Reset"), 0, 0, 18, 20,
+ NULL, 0.0, 0.0, 0.0, 0.0, TIP_("Reset operator defaults"));
uiButSetFunc(but, ui_layout_operator_buts__reset_cb, op, NULL);
}
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c
index 33d14ec38ae..462e7030805 100644
--- a/source/blender/editors/space_file/file_draw.c
+++ b/source/blender/editors/space_file/file_draw.c
@@ -221,12 +221,10 @@ void file_draw_buttons(const bContext *C, ARegion *ar)
/* Execute / cancel buttons. */
if(loadbutton) {
- uiDefButO(block, BUT, "FILE_OT_execute", WM_OP_EXEC_REGION_WIN, params->title,
- max_x - loadbutton, line1_y, loadbutton, btn_h,
- params->title);
+ uiDefButO(block, BUT, "FILE_OT_execute", WM_OP_EXEC_REGION_WIN, IFACE_(params->title),
+ max_x - loadbutton, line1_y, loadbutton, btn_h, TIP_(params->title));
uiDefButO(block, BUT, "FILE_OT_cancel", WM_OP_EXEC_REGION_WIN, IFACE_("Cancel"),
- max_x - loadbutton, line2_y, loadbutton, btn_h,
- TIP_("Cancel"));
+ max_x - loadbutton, line2_y, loadbutton, btn_h, TIP_("Cancel"));
}
uiEndBlock(C, block);
diff --git a/source/blender/editors/space_file/file_panels.c b/source/blender/editors/space_file/file_panels.c
index 26083cbe625..a7cb800e5a7 100644
--- a/source/blender/editors/space_file/file_panels.c
+++ b/source/blender/editors/space_file/file_panels.c
@@ -205,25 +205,25 @@ void file_panels_register(ARegionType *art)
pt= MEM_callocN(sizeof(PanelType), "spacetype file system directories");
strcpy(pt->idname, "FILE_PT_system");
- strcpy(pt->label, "System");
+ strcpy(pt->label, N_("System"));
pt->draw= file_panel_system;
BLI_addtail(&art->paneltypes, pt);
pt= MEM_callocN(sizeof(PanelType), "spacetype file bookmarks");
strcpy(pt->idname, "FILE_PT_bookmarks");
- strcpy(pt->label, "Bookmarks");
+ strcpy(pt->label, N_("Bookmarks"));
pt->draw= file_panel_bookmarks;
BLI_addtail(&art->paneltypes, pt);
pt= MEM_callocN(sizeof(PanelType), "spacetype file recent directories");
strcpy(pt->idname, "FILE_PT_recent");
- strcpy(pt->label, "Recent");
+ strcpy(pt->label, N_("Recent"));
pt->draw= file_panel_recent;
BLI_addtail(&art->paneltypes, pt);
pt= MEM_callocN(sizeof(PanelType), "spacetype file operator properties");
strcpy(pt->idname, "FILE_PT_operator");
- strcpy(pt->label, "Operator");
+ strcpy(pt->label, N_("Operator"));
pt->poll= file_panel_operator_poll;
pt->draw_header= file_panel_operator_header;
pt->draw= file_panel_operator;
diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c
index 1115d3c4cb4..642d43f2e71 100644
--- a/source/blender/editors/space_graph/graph_buttons.c
+++ b/source/blender/editors/space_graph/graph_buttons.c
@@ -147,16 +147,16 @@ static void graph_panel_view(const bContext *C, Panel *pa)
sub= uiLayoutColumn(col, 1);
uiLayoutSetActive(sub, RNA_boolean_get(&spaceptr, "show_cursor"));
- uiItemO(sub, "Cursor from Selection", ICON_NONE, "GRAPH_OT_frame_jump");
+ uiItemO(sub, IFACE_("Cursor from Selection"), ICON_NONE, "GRAPH_OT_frame_jump");
sub= uiLayoutColumn(col, 1);
uiLayoutSetActive(sub, RNA_boolean_get(&spaceptr, "show_cursor"));
row= uiLayoutSplit(sub, 0.7, 1);
- uiItemR(row, &sceneptr, "frame_current", 0, "Cursor X", ICON_NONE);
- uiItemEnumO(row, "GRAPH_OT_snap", "To Keys", 0, "type", GRAPHKEYS_SNAP_CFRA);
+ uiItemR(row, &sceneptr, "frame_current", 0, IFACE_("Cursor X"), ICON_NONE);
+ uiItemEnumO(row, "GRAPH_OT_snap", IFACE_("To Keys"), 0, "type", GRAPHKEYS_SNAP_CFRA);
row= uiLayoutSplit(sub, 0.7, 1);
- uiItemR(row, &spaceptr, "cursor_position_y", 0, "Cursor Y", ICON_NONE);
- uiItemEnumO(row, "GRAPH_OT_snap", "To Keys", 0, "type", GRAPHKEYS_SNAP_VALUE);
+ uiItemR(row, &spaceptr, "cursor_position_y", 0, IFACE_("Cursor Y"), ICON_NONE);
+ uiItemEnumO(row, "GRAPH_OT_snap", IFACE_("To Keys"), 0, "type", GRAPHKEYS_SNAP_VALUE);
}
/* ******************* active F-Curve ************** */
@@ -182,7 +182,7 @@ static void graph_panel_properties(const bContext *C, Panel *pa)
RNA_pointer_create(ale->id, &RNA_FCurve, fcu, &fcu_ptr);
/* user-friendly 'name' for F-Curve */
- // TODO: only show the path if this is invalid?
+ /* TODO: only show the path if this is invalid? */
col= uiLayoutColumn(layout, 0);
icon= getname_anim_fcurve(name, ale->id, fcu);
uiItemL(col, name, icon);
@@ -195,7 +195,7 @@ static void graph_panel_properties(const bContext *C, Panel *pa)
/* color settings */
col= uiLayoutColumn(layout, 1);
- uiItemL(col, "Display Color:", ICON_NONE);
+ uiItemL(col, IFACE_("Display Color:"), ICON_NONE);
row= uiLayoutRow(col, 1);
uiItemR(row, &fcu_ptr, "color_mode", 0, "", ICON_NONE);
@@ -318,36 +318,42 @@ static void graph_panel_key_properties(const bContext *C, Panel *pa)
col= uiLayoutColumn(layout, 1);
/* keyframe itself */
{
- uiItemL(col, "Key:", ICON_NONE);
+ uiItemL(col, IFACE_("Key:"), ICON_NONE);
- but = uiDefButR(block, NUM, B_REDR, "Frame", 0, 0, UI_UNIT_X, UI_UNIT_Y, &bezt_ptr, "co", 0, 0, 0, -1, -1, NULL);
+ but = uiDefButR(block, NUM, B_REDR, IFACE_("Frame"), 0, 0, UI_UNIT_X, UI_UNIT_Y,
+ &bezt_ptr, "co", 0, 0, 0, -1, -1, NULL);
uiButSetFunc(but, graphedit_activekey_update_cb, fcu, bezt);
- but = uiDefButR(block, NUM, B_REDR, "Value", 0, 0, UI_UNIT_X, UI_UNIT_Y, &bezt_ptr, "co", 1, 0, 0, -1, -1, NULL);
+ but = uiDefButR(block, NUM, B_REDR, IFACE_("Value"), 0, 0, UI_UNIT_X, UI_UNIT_Y,
+ &bezt_ptr, "co", 1, 0, 0, -1, -1, NULL);
uiButSetFunc(but, graphedit_activekey_update_cb, fcu, bezt);
uiButSetUnitType(but, unit);
}
/* previous handle - only if previous was Bezier interpolation */
if ((prevbezt) && (prevbezt->ipo == BEZT_IPO_BEZ)) {
- uiItemL(col, "Left Handle:", ICON_NONE);
+ uiItemL(col, IFACE_("Left Handle:"), ICON_NONE);
- but = uiDefButR(block, NUM, B_REDR, "X", 0, 0, UI_UNIT_X, UI_UNIT_Y, &bezt_ptr, "handle_left", 0, 0, 0, -1, -1, NULL);
- uiButSetFunc(but, graphedit_activekey_handles_cb, fcu, bezt);
+ but = uiDefButR(block, NUM, B_REDR, "X", 0, 0, UI_UNIT_X, UI_UNIT_Y,
+ &bezt_ptr, "handle_left", 0, 0, 0, -1, -1, NULL);
+ uiButSetFunc(but, graphedit_activekey_handles_cb, fcu, bezt);
- but = uiDefButR(block, NUM, B_REDR, "Y", 0, 0, UI_UNIT_X, UI_UNIT_Y, &bezt_ptr, "handle_left", 1, 0, 0, -1, -1, NULL);
+ but = uiDefButR(block, NUM, B_REDR, "Y", 0, 0, UI_UNIT_X, UI_UNIT_Y,
+ &bezt_ptr, "handle_left", 1, 0, 0, -1, -1, NULL);
uiButSetFunc(but, graphedit_activekey_handles_cb, fcu, bezt);
uiButSetUnitType(but, unit);
}
/* next handle - only if current is Bezier interpolation */
if (bezt->ipo == BEZT_IPO_BEZ) {
- uiItemL(col, "Right Handle:", ICON_NONE);
+ uiItemL(col, IFACE_("Right Handle:"), ICON_NONE);
- but = uiDefButR(block, NUM, B_REDR, "X", 0, 0, UI_UNIT_X, UI_UNIT_Y, &bezt_ptr, "handle_right", 0, 0, 0, -1, -1, NULL);
+ but = uiDefButR(block, NUM, B_REDR, "X", 0, 0, UI_UNIT_X, UI_UNIT_Y,
+ &bezt_ptr, "handle_right", 0, 0, 0, -1, -1, NULL);
uiButSetFunc(but, graphedit_activekey_handles_cb, fcu, bezt);
- but = uiDefButR(block, NUM, B_REDR, "Y", 0, 0, UI_UNIT_X, UI_UNIT_Y, &bezt_ptr, "handle_right", 1, 0, 0, -1, -1, NULL);
+ but = uiDefButR(block, NUM, B_REDR, "Y", 0, 0, UI_UNIT_X, UI_UNIT_Y,
+ &bezt_ptr, "handle_right", 1, 0, 0, -1, -1, NULL);
uiButSetFunc(but, graphedit_activekey_handles_cb, fcu, bezt);
uiButSetUnitType(but, unit);
}
@@ -355,15 +361,16 @@ static void graph_panel_key_properties(const bContext *C, Panel *pa)
else {
if ((fcu->bezt == NULL) && (fcu->modifiers.first)) {
/* modifiers only - so no keyframes to be active */
- uiItemL(layout, "F-Curve only has F-Modifiers", ICON_NONE);
- uiItemL(layout, "See Modifiers panel below", ICON_INFO);
+ uiItemL(layout, IFACE_("F-Curve only has F-Modifiers"), ICON_NONE);
+ uiItemL(layout, IFACE_("See Modifiers panel below"), ICON_INFO);
}
else if (fcu->fpt) {
/* samples only */
- uiItemL(layout, "F-Curve doesn't have any keyframes as it only contains sampled points", ICON_NONE);
+ uiItemL(layout, IFACE_("F-Curve doesn't have any keyframes as it only contains sampled points"),
+ ICON_NONE);
}
else
- uiItemL(layout, "No active keyframe on F-Curve", ICON_NONE);
+ uiItemL(layout, IFACE_("No active keyframe on F-Curve"), ICON_NONE);
}
MEM_freeN(ale);
@@ -463,7 +470,7 @@ static void graph_panel_driverVar__singleProp(uiLayout *layout, ID *id, DriverVa
/* Target ID */
row= uiLayoutRow(layout, 0);
- uiTemplateAnyID(row, &dtar_ptr, "id", "id_type", "Prop:");
+ uiTemplateAnyID(row, &dtar_ptr, "id", "id_type", IFACE_("Prop:"));
/* Target Property */
// TODO: make this less technical...
@@ -475,7 +482,7 @@ static void graph_panel_driverVar__singleProp(uiLayout *layout, ID *id, DriverVa
col= uiLayoutColumn(layout, 1);
/* rna path */
- uiTemplatePathBuilder(col, &dtar_ptr, "data_path", &root_ptr, "Path");
+ uiTemplatePathBuilder(col, &dtar_ptr, "data_path", &root_ptr, IFACE_("Path"));
}
}
@@ -495,7 +502,7 @@ static void graph_panel_driverVar__rotDiff(uiLayout *layout, ID *id, DriverVar *
/* Bone 1 */
col= uiLayoutColumn(layout, 1);
- uiTemplateAnyID(col, &dtar_ptr, "id", "id_type", "Bone 1:");
+ uiTemplateAnyID(col, &dtar_ptr, "id", "id_type", IFACE_("Bone 1:"));
if (dtar->id && ob1->pose) {
PointerRNA tar_ptr;
@@ -505,7 +512,7 @@ static void graph_panel_driverVar__rotDiff(uiLayout *layout, ID *id, DriverVar *
}
col= uiLayoutColumn(layout, 1);
- uiTemplateAnyID(col, &dtar2_ptr, "id", "id_type", "Bone 2:");
+ uiTemplateAnyID(col, &dtar2_ptr, "id", "id_type", IFACE_("Bone 2:"));
if (dtar2->id && ob2->pose) {
PointerRNA tar_ptr;
@@ -531,7 +538,7 @@ static void graph_panel_driverVar__locDiff(uiLayout *layout, ID *id, DriverVar *
/* Bone 1 */
col= uiLayoutColumn(layout, 1);
- uiTemplateAnyID(col, &dtar_ptr, "id", "id_type", "Ob/Bone 1:");
+ uiTemplateAnyID(col, &dtar_ptr, "id", "id_type", IFACE_("Ob/Bone 1:"));
if (dtar->id && ob1->pose) {
PointerRNA tar_ptr;
@@ -543,7 +550,7 @@ static void graph_panel_driverVar__locDiff(uiLayout *layout, ID *id, DriverVar *
uiItemR(col, &dtar_ptr, "transform_space", 0, NULL, ICON_NONE);
col= uiLayoutColumn(layout, 1);
- uiTemplateAnyID(col, &dtar2_ptr, "id", "id_type", "Ob/Bone 2:");
+ uiTemplateAnyID(col, &dtar2_ptr, "id", "id_type", IFACE_("Ob/Bone 2:"));
if (dtar2->id && ob2->pose) {
PointerRNA tar_ptr;
@@ -568,7 +575,7 @@ static void graph_panel_driverVar__transChan(uiLayout *layout, ID *id, DriverVar
/* properties */
col= uiLayoutColumn(layout, 1);
- uiTemplateAnyID(col, &dtar_ptr, "id", "id_type", "Ob/Bone:");
+ uiTemplateAnyID(col, &dtar_ptr, "id", "id_type", IFACE_("Ob/Bone:"));
if (dtar->id && ob->pose) {
PointerRNA tar_ptr;
@@ -579,7 +586,7 @@ static void graph_panel_driverVar__transChan(uiLayout *layout, ID *id, DriverVar
sub= uiLayoutColumn(layout, 1);
uiItemR(sub, &dtar_ptr, "transform_type", 0, NULL, ICON_NONE);
- uiItemR(sub, &dtar_ptr, "transform_space", 0, "Space", ICON_NONE);
+ uiItemR(sub, &dtar_ptr, "transform_space", 0, IFACE_("Space"), ICON_NONE);
}
/* driver settings for active F-Curve (only for 'Drivers' mode) */
@@ -607,10 +614,12 @@ static void graph_panel_drivers(const bContext *C, Panel *pa)
/* general actions - management */
col= uiLayoutColumn(pa->layout, 0);
block= uiLayoutGetBlock(col);
- but= uiDefBut(block, BUT, B_IPO_DEPCHANGE, "Update Dependencies", 0, 0, 10*UI_UNIT_X, 22, NULL, 0.0, 0.0, 0, 0, "Force updates of dependencies");
+ but= uiDefBut(block, BUT, B_IPO_DEPCHANGE, IFACE_("Update Dependencies"), 0, 0, 10*UI_UNIT_X, 22,
+ NULL, 0.0, 0.0, 0, 0, TIP_("Force updates of dependencies"));
uiButSetFunc(but, driver_update_flags_cb, fcu, NULL);
- but= uiDefBut(block, BUT, B_IPO_DEPCHANGE, "Remove Driver", 0, 0, 10*UI_UNIT_X, 18, NULL, 0.0, 0.0, 0, 0, "Remove this driver");
+ but= uiDefBut(block, BUT, B_IPO_DEPCHANGE, IFACE_("Remove Driver"), 0, 0, 10*UI_UNIT_X, 18,
+ NULL, 0.0, 0.0, 0, 0, TIP_("Remove this driver"));
uiButSetNFunc(but, driver_remove_cb, MEM_dupallocN(ale), NULL);
/* driver-level settings - type, expressions, and errors */
@@ -623,16 +632,16 @@ static void graph_panel_drivers(const bContext *C, Panel *pa)
/* show expression box if doing scripted drivers, and/or error messages when invalid drivers exist */
if (driver->type == DRIVER_TYPE_PYTHON) {
/* expression */
- uiItemR(col, &driver_ptr, "expression", 0, "Expr", ICON_NONE);
+ uiItemR(col, &driver_ptr, "expression", 0, IFACE_("Expr"), ICON_NONE);
/* errors? */
if (driver->flag & DRIVER_FLAG_INVALID)
- uiItemL(col, "ERROR: invalid Python expression", ICON_ERROR);
+ uiItemL(col, IFACE_("ERROR: invalid Python expression"), ICON_ERROR);
}
else {
/* errors? */
if (driver->flag & DRIVER_FLAG_INVALID)
- uiItemL(col, "ERROR: invalid target channel(s)", ICON_ERROR);
+ uiItemL(col, IFACE_("ERROR: invalid target channel(s)"), ICON_ERROR);
}
col= uiLayoutColumn(pa->layout, 1);
@@ -644,7 +653,7 @@ static void graph_panel_drivers(const bContext *C, Panel *pa)
uiLayout *row= uiLayoutRow(col, 1);
char valBuf[32];
- uiItemL(row, "Driver Value:", ICON_NONE);
+ uiItemL(row, IFACE_("Driver Value:"), ICON_NONE);
BLI_snprintf(valBuf, sizeof(valBuf), "%.3f", driver->curval);
uiItemL(row, valBuf, ICON_NONE);
@@ -653,7 +662,8 @@ static void graph_panel_drivers(const bContext *C, Panel *pa)
/* add driver variables */
col= uiLayoutColumn(pa->layout, 0);
block= uiLayoutGetBlock(col);
- but= uiDefBut(block, BUT, B_IPO_DEPCHANGE, "Add Variable", 0, 0, 10*UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0, 0, "Add a new target variable for this Driver");
+ but= uiDefBut(block, BUT, B_IPO_DEPCHANGE, IFACE_("Add Variable"), 0, 0, 10*UI_UNIT_X, UI_UNIT_Y,
+ NULL, 0.0, 0.0, 0, 0, TIP_("Add a new target variable for this Driver"));
uiButSetFunc(but, driver_add_var_cb, driver, NULL);
/* loop over targets, drawing them */
@@ -676,7 +686,8 @@ static void graph_panel_drivers(const bContext *C, Panel *pa)
/* remove button */
uiBlockSetEmboss(block, UI_EMBOSSN);
- but= uiDefIconBut(block, BUT, B_IPO_DEPCHANGE, ICON_X, 290, 0, UI_UNIT_X, UI_UNIT_Y, NULL, 0.0, 0.0, 0.0, 0.0, "Delete target variable");
+ but= uiDefIconBut(block, BUT, B_IPO_DEPCHANGE, ICON_X, 290, 0, UI_UNIT_X, UI_UNIT_Y,
+ NULL, 0.0, 0.0, 0.0, 0.0, IFACE_("Delete target variable"));
uiButSetFunc(but, driver_delete_var_cb, driver, dvar);
uiBlockSetEmboss(block, UI_EMBOSS);
@@ -708,7 +719,7 @@ static void graph_panel_drivers(const bContext *C, Panel *pa)
box= uiLayoutBox(col);
row= uiLayoutRow(box, 1);
- uiItemL(row, "Value:", ICON_NONE);
+ uiItemL(row, IFACE_("Value:"), ICON_NONE);
BLI_snprintf(valBuf, sizeof(valBuf), "%.3f", dvar->curval);
uiItemL(row, valBuf, ICON_NONE);
@@ -753,8 +764,8 @@ static void graph_panel_modifiers(const bContext *C, Panel *pa)
block= uiLayoutGetBlock(row);
// XXX for now, this will be a operator button which calls a 'add modifier' operator
- uiDefButO(block, BUT, "GRAPH_OT_fmodifier_add", WM_OP_INVOKE_REGION_WIN, IFACE_("Add Modifier"), 10, 0, 150, 20,
- TIP_("Adds a new F-Curve Modifier for the active F-Curve"));
+ uiDefButO(block, BUT, "GRAPH_OT_fmodifier_add", WM_OP_INVOKE_REGION_WIN, IFACE_("Add Modifier"),
+ 10, 0, 150, 20, TIP_("Adds a new F-Curve Modifier for the active F-Curve"));
/* copy/paste (as sub-row)*/
row= uiLayoutRow(row, 1);
@@ -780,21 +791,21 @@ void graph_buttons_register(ARegionType *art)
pt= MEM_callocN(sizeof(PanelType), "spacetype graph panel view");
strcpy(pt->idname, "GRAPH_PT_view");
- strcpy(pt->label, "View Properties");
+ strcpy(pt->label, N_("View Properties"));
pt->draw= graph_panel_view;
pt->flag |= PNL_DEFAULT_CLOSED;
BLI_addtail(&art->paneltypes, pt);
pt= MEM_callocN(sizeof(PanelType), "spacetype graph panel properties");
strcpy(pt->idname, "GRAPH_PT_properties");
- strcpy(pt->label, "Active F-Curve");
+ strcpy(pt->label, N_("Active F-Curve"));
pt->draw= graph_panel_properties;
pt->poll= graph_panel_poll;
BLI_addtail(&art->paneltypes, pt);
pt= MEM_callocN(sizeof(PanelType), "spacetype graph panel properties");
strcpy(pt->idname, "GRAPH_PT_key_properties");
- strcpy(pt->label, "Active Keyframe");
+ strcpy(pt->label, N_("Active Keyframe"));
pt->draw= graph_panel_key_properties;
pt->poll= graph_panel_poll;
BLI_addtail(&art->paneltypes, pt);
@@ -802,14 +813,14 @@ void graph_buttons_register(ARegionType *art)
pt= MEM_callocN(sizeof(PanelType), "spacetype graph panel drivers");
strcpy(pt->idname, "GRAPH_PT_drivers");
- strcpy(pt->label, "Drivers");
+ strcpy(pt->label, N_("Drivers"));
pt->draw= graph_panel_drivers;
pt->poll= graph_panel_drivers_poll;
BLI_addtail(&art->paneltypes, pt);
pt= MEM_callocN(sizeof(PanelType), "spacetype graph panel modifiers");
strcpy(pt->idname, "GRAPH_PT_modifiers");
- strcpy(pt->label, "Modifiers");
+ strcpy(pt->label, N_("Modifiers"));
pt->draw= graph_panel_modifiers;
pt->poll= graph_panel_poll;
BLI_addtail(&art->paneltypes, pt);
diff --git a/source/blender/editors/space_graph/graph_edit.c b/source/blender/editors/space_graph/graph_edit.c
index ffe5147074a..9a965c3a109 100644
--- a/source/blender/editors/space_graph/graph_edit.c
+++ b/source/blender/editors/space_graph/graph_edit.c
@@ -53,6 +53,8 @@
#include "RNA_define.h"
#include "RNA_enum_types.h"
+#include "BLF_translation.h"
+
#include "BKE_fcurve.h"
#include "BKE_nla.h"
#include "BKE_context.h"
@@ -2074,7 +2076,7 @@ static int graph_fmodifier_add_invoke (bContext *C, wmOperator *op, wmEvent *UNU
uiLayout *layout;
int i;
- pup= uiPupMenuBegin(C, "Add F-Curve Modifier", ICON_NONE);
+ pup= uiPupMenuBegin(C, IFACE_("Add F-Curve Modifier"), ICON_NONE);
layout= uiPupMenuLayout(pup);
/* start from 1 to skip the 'Invalid' modifier type */
@@ -2087,7 +2089,8 @@ static int graph_fmodifier_add_invoke (bContext *C, wmOperator *op, wmEvent *UNU
continue;
/* create operator menu item with relevant properties filled in */
- props_ptr= uiItemFullO_ptr(layout, ot, fmi->name, ICON_NONE, NULL, WM_OP_EXEC_REGION_WIN, UI_ITEM_O_RETURN_PROPS);
+ props_ptr= uiItemFullO_ptr(layout, ot, IFACE_(fmi->name), ICON_NONE,
+ NULL, WM_OP_EXEC_REGION_WIN, UI_ITEM_O_RETURN_PROPS);
/* the only thing that gets set from the menu is the type of F-Modifier to add */
RNA_enum_set(&props_ptr, "type", i);
/* the following properties are just repeats of existing ones... */
diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c
index 9a588f698b9..f9ee50387d1 100644
--- a/source/blender/editors/space_view3d/view3d_buttons.c
+++ b/source/blender/editors/space_view3d/view3d_buttons.c
@@ -4,7 +4,7 @@
* 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.
+ * 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
@@ -18,7 +18,7 @@
* The Original Code is Copyright (C) 2009 Blender Foundation.
* All rights reserved.
*
- *
+ *
* Contributor(s): Blender Foundation
*
* ***** END GPL LICENSE BLOCK *****
@@ -45,6 +45,8 @@
#include "MEM_guardedalloc.h"
+#include "BLF_translation.h"
+
#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "BLI_rand.h"
@@ -77,7 +79,7 @@
#include "UI_interface.h"
#include "UI_resources.h"
-#include "view3d_intern.h" // own include
+#include "view3d_intern.h" /* own include */
/* ******************* view3d space & buttons ************** */
@@ -122,8 +124,8 @@
/* temporary struct for storing transform properties */
typedef struct {
- float ob_eul[4]; // used for quat too....
- float ob_scale[3]; // need temp space due to linked values
+ float ob_eul[4]; /* used for quat too... */
+ float ob_scale[3]; /* need temp space due to linked values */
float ob_dims[3];
short link_scale;
float ve_median[7];
@@ -165,34 +167,34 @@ static float compute_scale_factor(const float ve_median, const float median)
/* is used for both read and write... */
static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float lim)
{
- uiBlock *block= (layout)? uiLayoutAbsoluteBlock(layout): NULL;
- MDeformVert *dvert=NULL;
+ uiBlock *block = (layout)? uiLayoutAbsoluteBlock(layout): NULL;
+ MDeformVert *dvert =NULL;
TransformProperties *tfp;
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;
- defstr[0]= 0;
+ median[0] = median[1] = median[2] = median[3] = median[4] = median[5] = median[6] = 0.0;
+ tot = totw = totweight = totedge = totradius = 0;
+ defstr[0] = 0;
/* make sure we got storage */
- if (v3d->properties_storage==NULL)
- v3d->properties_storage= MEM_callocN(sizeof(TransformProperties), "TransformProperties");
- tfp= v3d->properties_storage;
-
- if (ob->type==OB_MESH) {
- Mesh *me= ob->data;
+ if (v3d->properties_storage == NULL)
+ v3d->properties_storage = MEM_callocN(sizeof(TransformProperties), "TransformProperties");
+ tfp = v3d->properties_storage;
+
+ if (ob->type == OB_MESH) {
+ Mesh *me = ob->data;
BMEditMesh *em = me->edit_btmesh;
BMesh *bm = em->bm;
- BMVert *eve, *evedef=NULL;
+ BMVert *eve, *evedef = NULL;
BMEdge *eed;
BMIter iter;
-
+
BM_ITER(eve, &iter, bm, BM_VERTS_OF_MESH, NULL) {
if (BM_elem_flag_test(eve, BM_ELEM_SELECT)) {
- evedef= eve;
+ evedef = eve;
tot++;
add_v3_v3(median, eve->co);
}
@@ -204,65 +206,65 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
totedge++;
f = (float *)CustomData_bmesh_get(&bm->edata, eed->head.data, CD_CREASE);
- median[3]+= f ? *f : 0.0f;
+ median[3] += f ? *f : 0.0f;
f = (float *)CustomData_bmesh_get(&bm->edata, eed->head.data, CD_BWEIGHT);
- median[6]+= f ? *f : 0.0f;
+ median[6] += f ? *f : 0.0f;
}
}
/* check for defgroups */
if (evedef)
- dvert= CustomData_bmesh_get(&bm->vdata, evedef->head.data, CD_MDEFORMVERT);
- if (tot==1 && dvert && dvert->totweight) {
+ dvert = CustomData_bmesh_get(&bm->vdata, evedef->head.data, CD_MDEFORMVERT);
+ if (tot == 1 && dvert && dvert->totweight) {
bDeformGroup *dg;
- int i, max=1, init=1;
+ int i, max = 1, init = 1;
char str[320];
-
- for (i=0; i<dvert->totweight; i++) {
+
+ for (i = 0; i<dvert->totweight; i++) {
dg = BLI_findlink (&ob->defbase, dvert->dw[i].def_nr);
if (dg) {
- max+= BLI_snprintf(str, sizeof(str), "%s %%x%d|", dg->name, dvert->dw[i].def_nr);
+ max += BLI_snprintf(str, sizeof(str), "%s %%x%d|", dg->name, dvert->dw[i].def_nr);
if (max < sizeof(str)) strcat(defstr, str);
}
- if (tfp->curdef==dvert->dw[i].def_nr) {
- init= 0;
- tfp->defweightp= &dvert->dw[i].weight;
+ if (tfp->curdef == dvert->dw[i].def_nr) {
+ init = 0;
+ tfp->defweightp = &dvert->dw[i].weight;
}
}
-
- if (init) { // needs new initialized
- tfp->curdef= dvert->dw[0].def_nr;
- tfp->defweightp= &dvert->dw[0].weight;
+
+ if (init) { /* needs new initialized */
+ tfp->curdef = dvert->dw[0].def_nr;
+ tfp->defweightp = &dvert->dw[0].weight;
}
}
}
- else if (ob->type==OB_CURVE || ob->type==OB_SURF) {
- Curve *cu= ob->data;
+ else if (ob->type == OB_CURVE || ob->type == OB_SURF) {
+ Curve *cu = ob->data;
Nurb *nu;
BPoint *bp;
BezTriple *bezt;
int a;
- ListBase *nurbs= curve_editnurbs(cu);
- StructRNA *seltype= NULL;
- void *selp= NULL;
+ ListBase *nurbs = curve_editnurbs(cu);
+ StructRNA *seltype = NULL;
+ void *selp = NULL;
- nu= nurbs->first;
+ nu = nurbs->first;
while (nu) {
if (nu->type == CU_BEZIER) {
- bezt= nu->bezt;
- a= nu->pntsu;
+ bezt = nu->bezt;
+ a = nu->pntsu;
while (a--) {
if (bezt->f2 & SELECT) {
add_v3_v3(median, bezt->vec[1]);
tot++;
- median[4]+= bezt->weight;
+ median[4] += bezt->weight;
totweight++;
- median[5]+= bezt->radius;
+ median[5] += bezt->radius;
totradius++;
- selp= bezt;
- seltype= &RNA_BezierSplinePoint;
+ selp = bezt;
+ seltype = &RNA_BezierSplinePoint;
}
else {
if (bezt->f1 & SELECT) {
@@ -278,50 +280,50 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
}
}
else {
- bp= nu->bp;
- a= nu->pntsu*nu->pntsv;
+ bp = nu->bp;
+ a = nu->pntsu*nu->pntsv;
while (a--) {
if (bp->f1 & SELECT) {
add_v3_v3(median, bp->vec);
- median[3]+= bp->vec[3];
+ median[3] += bp->vec[3];
totw++;
tot++;
- median[4]+= bp->weight;
+ median[4] += bp->weight;
totweight++;
- median[5]+= bp->radius;
+ median[5] += bp->radius;
totradius++;
- selp= bp;
- seltype= &RNA_SplinePoint;
+ selp = bp;
+ seltype = &RNA_SplinePoint;
}
bp++;
}
}
- nu= nu->next;
+ nu = nu->next;
}
- if (totradius==1)
+ if (totradius == 1)
RNA_pointer_create(&cu->id, seltype, selp, &radius_ptr);
}
- else if (ob->type==OB_LATTICE) {
- Lattice *lt= ob->data;
+ else if (ob->type == OB_LATTICE) {
+ Lattice *lt = ob->data;
BPoint *bp;
int a;
-
- a= lt->editlatt->latt->pntsu*lt->editlatt->latt->pntsv*lt->editlatt->latt->pntsw;
- bp= lt->editlatt->latt->def;
+
+ a = lt->editlatt->latt->pntsu * lt->editlatt->latt->pntsv * lt->editlatt->latt->pntsw;
+ bp = lt->editlatt->latt->def;
while (a--) {
if (bp->f1 & SELECT) {
add_v3_v3(median, bp->vec);
tot++;
- median[4]+= bp->weight;
+ median[4] += bp->weight;
totweight++;
}
bp++;
}
}
-
- if (tot==0) {
- uiDefBut(block, LABEL, 0, "Nothing selected",0, 130, 200, 20, NULL, 0, 0, 0, 0, "");
+
+ if (tot == 0) {
+ uiDefBut(block, LABEL, 0, IFACE_("Nothing selected"), 0, 130, 200, 20, NULL, 0, 0, 0, 0, "");
return;
}
median[0] /= (float)tot;
@@ -331,87 +333,105 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
median[3] /= (float)totedge;
median[6] /= (float)totedge;
}
- else if (totw) median[3] /= (float)totw;
- if (totweight) median[4] /= (float)totweight;
- if (totradius) median[5] /= (float)totradius;
-
+ else if (totw)
+ median[3] /= (float)totw;
+ if (totweight)
+ median[4] /= (float)totweight;
+ if (totradius)
+ median[5] /= (float)totradius;
+
if (v3d->flag & V3D_GLOBAL_STATS)
mul_m4_v3(ob->obmat, median);
-
- if (block) { // buttons
+
+ if (block) { /* buttons */
uiBut *but;
memcpy(tfp->ve_median, median, sizeof(tfp->ve_median));
uiBlockBeginAlign(block);
- if (tot==1) {
- uiDefBut(block, LABEL, 0, "Vertex:", 0, 150, 200, 20, NULL, 0, 0, 0, 0, "");
+ if (tot == 1) {
+ uiDefBut(block, LABEL, 0, IFACE_("Vertex:"), 0, 150, 200, 20, NULL, 0, 0, 0, 0, "");
}
else {
- uiDefBut(block, LABEL, 0, "Median:", 0, 150, 200, 20, NULL, 0, 0, 0, 0, "");
+ uiDefBut(block, LABEL, 0, IFACE_("Median:"), 0, 150, 200, 20, NULL, 0, 0, 0, 0, "");
}
uiBlockBeginAlign(block);
- but= uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "X:", 0, 130, 200, 20, &(tfp->ve_median[0]), -lim, lim, 10, 3, "");
+ /* Should be no need to translate these. */
+ but = uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "X:", 0, 130, 200, 20,
+ &(tfp->ve_median[0]), -lim, lim, 10, 3, "");
uiButSetUnitType(but, PROP_UNIT_LENGTH);
- but= uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Y:", 0, 110, 200, 20, &(tfp->ve_median[1]), -lim, lim, 10, 3, "");
+ but = uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Y:", 0, 110, 200, 20,
+ &(tfp->ve_median[1]), -lim, lim, 10, 3, "");
uiButSetUnitType(but, PROP_UNIT_LENGTH);
- but= uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Z:", 0, 90, 200, 20, &(tfp->ve_median[2]), -lim, lim, 10, 3, "");
+ but = uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Z:", 0, 90, 200, 20,
+ &(tfp->ve_median[2]), -lim, lim, 10, 3, "");
uiButSetUnitType(but, PROP_UNIT_LENGTH);
- if (totw==tot) {
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "W:", 0, 70, 200, 20, &(tfp->ve_median[3]), 0.01, 100.0, 1, 3, "");
+ if (totw == tot) {
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "W:", 0, 70, 200, 20,
+ &(tfp->ve_median[3]), 0.01, 100.0, 1, 3, "");
}
uiBlockBeginAlign(block);
- uiDefButBitS(block, TOG, V3D_GLOBAL_STATS, B_REDR, "Global", 0, 65, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays global values");
- uiDefButBitS(block, TOGN, V3D_GLOBAL_STATS, B_REDR, "Local", 100, 65, 100, 20, &v3d->flag, 0, 0, 0, 0, "Displays local values");
+ uiDefButBitS(block, TOG, V3D_GLOBAL_STATS, B_REDR, IFACE_("Global"), 0, 65, 100, 20,
+ &v3d->flag, 0, 0, 0, 0, "Displays global values");
+ uiDefButBitS(block, TOGN, V3D_GLOBAL_STATS, B_REDR, IFACE_("Local"), 100, 65, 100, 20,
+ &v3d->flag, 0, 0, 0, 0, "Displays local values");
uiBlockEndAlign(block);
if (totweight == 1) {
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Weight:", 0, 40, 200, 20, &(tfp->ve_median[4]), 0.0, 1.0, 1, 3, "Weight is used for SoftBody Goal");
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("Weight:"), 0, 40, 200, 20,
+ &(tfp->ve_median[4]), 0.0, 1.0, 1, 3, TIP_("Weight used for SoftBody Goal"));
}
else if (totweight > 1) {
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Mean Weight:", 0, 40, 200, 20, &(tfp->ve_median[4]), 0.0, 1.0, 1, 3, "Weight is used for SoftBody Goal");
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("Mean Weight:"), 0, 40, 200, 20,
+ &(tfp->ve_median[4]), 0.0, 1.0, 1, 3, TIP_("Weight used for SoftBody Goal"));
}
if (totradius == 1) {
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Radius:", 0, 20, 200, 20, &(tfp->ve_median[5]), 0.0, 100.0, 1, 3, "Radius of curve CPs");
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("Radius:"), 0, 20, 200, 20,
+ &(tfp->ve_median[5]), 0.0, 100.0, 1, 3, TIP_("Radius of curve control points"));
}
else if (totradius > 1) {
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Mean Radius:", 0, 20, 200, 20, &(tfp->ve_median[5]), 0.0, 100.0, 1, 3, "Radius of curve CPs");
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("Mean Radius:"), 0, 20, 200, 20,
+ &(tfp->ve_median[5]), 0.0, 100.0, 1, 3, TIP_("Radius of curve control points"));
}
- if (totedge==1) {
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Crease:", 0, 40, 200, 20, &(tfp->ve_median[3]), 0.0, 1.0, 1, 3, "");
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Bevel Weight:", 0, 20, 200, 20, &(tfp->ve_median[6]), 0.0, 1.0, 1, 3, "");
+ if (totedge == 1) {
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("Crease:"), 0, 40, 200, 20,
+ &(tfp->ve_median[3]), 0.0, 1.0, 1, 3, TIP_("Weight used by SubSurf modifier"));
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("Bevel Weight:"), 0, 20, 200, 20,
+ &(tfp->ve_median[6]), 0.0, 1.0, 1, 3, TIP_("Weight used by Bevel modifier"));
}
else if (totedge>1) {
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Mean Crease:", 0, 40, 200, 20, &(tfp->ve_median[3]), 0.0, 1.0, 1, 3, "");
- uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Mean Bevel Weight:", 0, 20, 200, 20, &(tfp->ve_median[6]), 0.0, 1.0, 1, 3, "");
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("Mean Crease:"), 0, 40, 200, 20,
+ &(tfp->ve_median[3]), 0.0, 1.0, 1, 3, TIP_("Weight used by SubSurf modifier"));
+ uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, IFACE_("Mean Bevel Weight:"), 0, 20, 200, 20,
+ &(tfp->ve_median[6]), 0.0, 1.0, 1, 3, TIP_("Weight used by Bevel modifier"));
}
uiBlockEndAlign(block);
uiBlockEndAlign(block);
}
- else { // apply
+ else { /* apply */
memcpy(ve_median, tfp->ve_median, sizeof(tfp->ve_median));
-
+
if (v3d->flag & V3D_GLOBAL_STATS) {
invert_m4_m4(ob->imat, ob->obmat);
mul_m4_v3(ob->imat, median);
mul_m4_v3(ob->imat, ve_median);
}
sub_v3_v3v3(median, ve_median, median);
- median[3]= ve_median[3]-median[3];
- median[4]= ve_median[4]-median[4];
- median[5]= ve_median[5]-median[5];
- median[6]= ve_median[6]-median[6];
-
- if (ob->type==OB_MESH) {
- Mesh *me= ob->data;
+ median[3] = ve_median[3] - median[3];
+ median[4] = ve_median[4] - median[4];
+ median[5] = ve_median[5] - median[5];
+ median[6] = ve_median[6] - median[6];
+
+ if (ob->type == OB_MESH) {
+ Mesh *me = ob->data;
BMEditMesh *em = me->edit_btmesh;
BMesh *bm = em->bm;
BMVert *eve;
@@ -424,10 +444,10 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
add_v3_v3(eve->co, median);
}
}
-
+
EDBM_RecalcNormals(em);
}
-
+
if (median[3] != 0.0f) {
BMEdge *eed;
const float sca = compute_scale_factor(ve_median[3], median[3]);
@@ -505,20 +525,20 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
}
EDBM_RecalcNormals(em);
}
- else if (ob->type==OB_CURVE || ob->type==OB_SURF) {
- Curve *cu= ob->data;
+ else if (ELEM(ob->type, OB_CURVE, OB_SURF)) {
+ Curve *cu = ob->data;
Nurb *nu;
BPoint *bp;
BezTriple *bezt;
int a;
- ListBase *nurbs= curve_editnurbs(cu);
+ ListBase *nurbs = curve_editnurbs(cu);
const float scale_w = compute_scale_factor(ve_median[4], median[4]);
- nu= nurbs->first;
+ nu = nurbs->first;
while (nu) {
if (nu->type == CU_BEZIER) {
- bezt= nu->bezt;
- a= nu->pntsu;
+ bezt = nu->bezt;
+ a = nu->pntsu;
while (a--) {
if (bezt->f2 & SELECT) {
add_v3_v3(bezt->vec[0], median);
@@ -536,7 +556,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
}
}
- bezt->radius+= median[5];
+ bezt->radius += median[5];
}
else {
if (bezt->f1 & SELECT) {
@@ -550,12 +570,12 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
}
}
else {
- bp= nu->bp;
- a= nu->pntsu*nu->pntsv;
+ bp = nu->bp;
+ a = nu->pntsu*nu->pntsv;
while (a--) {
if (bp->f1 & SELECT) {
add_v3_v3(bp->vec, median);
- bp->vec[3]+= median[3];
+ bp->vec[3] += median[3];
if (median[4] != 0.0f) {
if (ELEM(scale_w, 0.0f, 1.0f)) {
@@ -568,7 +588,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
}
}
- bp->radius+= median[5];
+ bp->radius += median[5];
}
bp++;
}
@@ -576,17 +596,17 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
test2DNurb(nu);
testhandlesNurb(nu); /* test for bezier too */
- nu= nu->next;
+ nu = nu->next;
}
}
- else if (ob->type==OB_LATTICE) {
- Lattice *lt= ob->data;
+ else if (ob->type == OB_LATTICE) {
+ Lattice *lt = ob->data;
BPoint *bp;
int a;
const float scale_w = compute_scale_factor(ve_median[4], median[4]);
- a= lt->editlatt->latt->pntsu*lt->editlatt->latt->pntsv*lt->editlatt->latt->pntsw;
- bp= lt->editlatt->latt->def;
+ a = lt->editlatt->latt->pntsu*lt->editlatt->latt->pntsv*lt->editlatt->latt->pntsw;
+ bp = lt->editlatt->latt->def;
while (a--) {
if (bp->f1 & SELECT) {
add_v3_v3(bp->vec, median);
@@ -605,8 +625,8 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
bp++;
}
}
-
-// ED_undo_push(C, "Transform properties");
+
+/* ED_undo_push(C, "Transform properties"); */
}
}
#define B_VGRP_PNL_COPY 1
@@ -616,8 +636,8 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float
static void act_vert_def(Object *ob, BMVert **eve, MDeformVert **dvert)
{
- if (ob && ob->mode & OB_MODE_EDIT && ob->type==OB_MESH && ob->defbase.first) {
- Mesh *me= ob->data;
+ if (ob && ob->mode & OB_MODE_EDIT && ob->type == OB_MESH && ob->defbase.first) {
+ Mesh *me = ob->data;
BMEditMesh *em = me->edit_btmesh;
BMEditSelection *ese = (BMEditSelection *)em->bm->selected.last;
@@ -628,34 +648,34 @@ static void act_vert_def(Object *ob, BMVert **eve, MDeformVert **dvert)
}
}
- *eve= NULL;
- *dvert= NULL;
+ *eve = NULL;
+ *dvert = NULL;
}
static void editvert_mirror_update(Object *ob, BMVert *eve, int def_nr, int index)
{
- Mesh *me= ob->data;
+ Mesh *me = ob->data;
BMEditMesh *em = me->edit_btmesh;
BMVert *eve_mirr;
- eve_mirr= editbmesh_get_x_mirror_vert(ob, em, eve, eve->co, index);
+ eve_mirr = editbmesh_get_x_mirror_vert(ob, em, eve, eve->co, index);
if (eve_mirr && eve_mirr != eve) {
- MDeformVert *dvert_src= CustomData_bmesh_get(&em->bm->vdata, eve->head.data, CD_MDEFORMVERT);
- MDeformVert *dvert_dst= CustomData_bmesh_get(&em->bm->vdata, eve_mirr->head.data, CD_MDEFORMVERT);
+ MDeformVert *dvert_src = CustomData_bmesh_get(&em->bm->vdata, eve->head.data, CD_MDEFORMVERT);
+ MDeformVert *dvert_dst = CustomData_bmesh_get(&em->bm->vdata, eve_mirr->head.data, CD_MDEFORMVERT);
if (dvert_dst) {
if (def_nr == -1) {
/* all vgroups, add groups where neded */
int flip_map_len;
- int *flip_map= defgroup_flip_map(ob, &flip_map_len, TRUE);
+ int *flip_map = defgroup_flip_map(ob, &flip_map_len, TRUE);
defvert_sync_mapped(dvert_dst, dvert_src, flip_map, flip_map_len, TRUE);
MEM_freeN(flip_map);
}
else {
/* single vgroup */
- MDeformWeight *dw= defvert_verify_index(dvert_dst, defgroup_flip_index(ob, def_nr, 1));
+ MDeformWeight *dw = defvert_verify_index(dvert_dst, defgroup_flip_index(ob, def_nr, 1));
if (dw) {
- dw->weight= defvert_find_weight(dvert_src, def_nr);
+ dw->weight = defvert_find_weight(dvert_src, def_nr);
}
}
}
@@ -682,20 +702,20 @@ static void vgroup_copy_active_to_sel(Object *ob)
act_vert_def(ob, &eve_act, &dvert_act);
- if (dvert_act==NULL) {
+ if (dvert_act == NULL) {
return;
}
else {
- Mesh *me= ob->data;
+ Mesh *me = ob->data;
BMEditMesh *em = me->edit_btmesh;
BMIter iter;
BMVert *eve;
MDeformVert *dvert;
- int index= 0;
+ int index = 0;
BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) {
if (BM_elem_flag_test(eve, BM_ELEM_SELECT) && eve != eve_act) {
- dvert= CustomData_bmesh_get(&em->bm->vdata, eve->head.data, CD_MDEFORMVERT);
+ dvert = CustomData_bmesh_get(&em->bm->vdata, eve->head.data, CD_MDEFORMVERT);
if (dvert) {
defvert_copy(dvert, dvert_act);
@@ -717,33 +737,33 @@ static void vgroup_copy_active_to_sel_single(Object *ob, const int def_nr)
act_vert_def(ob, &eve_act, &dv_act);
- if (dv_act==NULL) {
+ if (dv_act == NULL) {
return;
}
else {
- Mesh *me= ob->data;
+ Mesh *me = ob->data;
BMEditMesh *em = me->edit_btmesh;
BMIter iter;
BMVert *eve;
MDeformVert *dv;
MDeformWeight *dw;
float weight_act;
- int index= 0;
+ int index = 0;
- dw= defvert_find_index(dv_act, def_nr);
+ dw = defvert_find_index(dv_act, def_nr);
if (dw == NULL)
return;
-
- weight_act= dw->weight;
+
+ weight_act = dw->weight;
eve = BM_iter_new(&iter, em->bm, BM_VERTS_OF_MESH, NULL);
- for (index=0; eve; eve=BM_iter_step(&iter), index++) {
+ for (index = 0; eve; eve = BM_iter_step(&iter), index++) {
if (BM_elem_flag_test(eve, BM_ELEM_SELECT) && eve != eve_act) {
- dv= CustomData_bmesh_get(&em->bm->vdata, eve->head.data, CD_MDEFORMVERT);
- dw= defvert_find_index(dv, def_nr);
+ dv = CustomData_bmesh_get(&em->bm->vdata, eve->head.data, CD_MDEFORMVERT);
+ dw = defvert_find_index(dv, def_nr);
if (dw) {
- dw->weight= weight_act;
+ dw->weight = weight_act;
if (me->editflag & ME_EDIT_MIRROR_X) {
editvert_mirror_update(ob, eve, -1, index);
@@ -765,24 +785,22 @@ static void vgroup_normalize_active(Object *ob)
act_vert_def(ob, &eve_act, &dvert_act);
- if (dvert_act==NULL)
+ if (dvert_act == NULL)
return;
defvert_normalize(dvert_act);
if (((Mesh *)ob->data)->editflag & ME_EDIT_MIRROR_X)
editvert_mirror_update(ob, eve_act, -1, -1);
-
-
-
}
static void do_view3d_vgroup_buttons(bContext *C, void *UNUSED(arg), int event)
{
- Scene *scene= CTX_data_scene(C);
- Object *ob= OBACT;
+ Scene *scene = CTX_data_scene(C);
+ Object *ob = OBACT;
- if (event==B_VGRP_PNL_NORMALIZE) {
+ /* XXX TODO Use operators? */
+ if (event == B_VGRP_PNL_NORMALIZE) {
vgroup_normalize_active(ob);
}
else if (event == B_VGRP_PNL_COPY) {
@@ -795,9 +813,10 @@ static void do_view3d_vgroup_buttons(bContext *C, void *UNUSED(arg), int event)
vgroup_adjust_active(ob, event - B_VGRP_PNL_EDIT_SINGLE);
}
-// todo
-// if (((Mesh *)ob->data)->editflag & ME_EDIT_MIRROR_X)
-// ED_vgroup_mirror(ob, 1, 1, 0);
+#if 0 /* TODO */
+ if (((Mesh *)ob->data)->editflag & ME_EDIT_MIRROR_X)
+ ED_vgroup_mirror(ob, 1, 1, 0);
+#endif
/* default for now */
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
@@ -806,8 +825,8 @@ static void do_view3d_vgroup_buttons(bContext *C, void *UNUSED(arg), int event)
static int view3d_panel_vgroup_poll(const bContext *C, PanelType *UNUSED(pt))
{
- Scene *scene= CTX_data_scene(C);
- Object *ob= OBACT;
+ Scene *scene = CTX_data_scene(C);
+ Object *ob = OBACT;
BMVert *eve_act;
MDeformVert *dvert_act;
@@ -819,9 +838,9 @@ static int view3d_panel_vgroup_poll(const bContext *C, PanelType *UNUSED(pt))
static void view3d_panel_vgroup(const bContext *C, Panel *pa)
{
- uiBlock *block= uiLayoutAbsoluteBlock(pa->layout);
- Scene *scene= CTX_data_scene(C);
- Object *ob= OBACT;
+ uiBlock *block = uiLayoutAbsoluteBlock(pa->layout);
+ Scene *scene = CTX_data_scene(C);
+ Object *ob = OBACT;
BMVert *eve;
MDeformVert *dv;
@@ -837,25 +856,29 @@ static void view3d_panel_vgroup(const bContext *C, Panel *pa)
uiBlockSetHandleFunc(block, do_view3d_vgroup_buttons, NULL);
- col= uiLayoutColumn(pa->layout, 0);
- block= uiLayoutAbsoluteBlock(col);
+ col = uiLayoutColumn(pa->layout, 0);
+ block = uiLayoutAbsoluteBlock(col);
uiBlockBeginAlign(block);
- for (i= dv->totweight; i != 0; i--, dw++) {
+ for (i = dv->totweight; i != 0; i--, dw++) {
dg = BLI_findlink (&ob->defbase, dw->def_nr);
if (dg) {
- uiDefButF(block, NUM, B_VGRP_PNL_EDIT_SINGLE + dw->def_nr, dg->name, 0, yco, 180, 20, &dw->weight, 0.0, 1.0, 1, 3, "");
- uiDefBut(block, BUT, B_VGRP_PNL_COPY_SINGLE + dw->def_nr, "C", 180,yco,20,20, NULL, 0, 0, 0, 0, "Copy this groups weight to other selected verts");
+ uiDefButF(block, NUM, B_VGRP_PNL_EDIT_SINGLE + dw->def_nr, dg->name, 0, yco, 180, 20,
+ &dw->weight, 0.0, 1.0, 1, 3, "");
+ uiDefBut(block, BUT, B_VGRP_PNL_COPY_SINGLE + dw->def_nr, "C", 180, yco, 20, 20,
+ NULL, 0, 0, 0, 0, TIP_("Copy this group's weight to other selected verts"));
yco -= 20;
}
}
- yco-=2;
+ yco -= 2;
uiBlockEndAlign(block);
uiBlockBeginAlign(block);
- uiDefBut(block, BUT, B_VGRP_PNL_NORMALIZE, "Normalize", 0, yco,100,20, NULL, 0, 0, 0, 0, "Normalize active vertex weights");
- uiDefBut(block, BUT, B_VGRP_PNL_COPY, "Copy", 100,yco,100,20, NULL, 0, 0, 0, 0, "Copy active vertex to other seleted verts");
+ uiDefBut(block, BUT, B_VGRP_PNL_NORMALIZE, IFACE_("Normalize"), 0, yco, 100, 20,
+ NULL, 0, 0, 0, 0, TIP_("Normalize active vertex weights"));
+ uiDefBut(block, BUT, B_VGRP_PNL_COPY, IFACE_("Copy"), 100, yco, 100, 20,
+ NULL, 0, 0, 0, 0, TIP_("Copy active vertex to other seleted verts"));
uiBlockEndAlign(block);
}
}
@@ -863,105 +886,105 @@ static void view3d_panel_vgroup(const bContext *C, Panel *pa)
static void v3d_transform_butsR(uiLayout *layout, PointerRNA *ptr)
{
uiLayout *split, *colsub;
-
+
split = uiLayoutSplit(layout, 0.8, 0);
-
+
if (ptr->type == &RNA_PoseBone) {
PointerRNA boneptr;
Bone *bone;
-
+
boneptr = RNA_pointer_get(ptr, "bone");
bone = boneptr.data;
uiLayoutSetActive(split, !(bone->parent && bone->flag & BONE_CONNECTED));
}
colsub = uiLayoutColumn(split, 1);
- uiItemR(colsub, ptr, "location", 0, "Location", ICON_NONE);
+ uiItemR(colsub, ptr, "location", 0, NULL, ICON_NONE);
colsub = uiLayoutColumn(split, 1);
uiItemL(colsub, "", ICON_NONE);
- uiItemR(colsub, ptr, "lock_location", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
-
+ uiItemR(colsub, ptr, "lock_location", UI_ITEM_R_TOGGLE | UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
+
split = uiLayoutSplit(layout, 0.8, 0);
-
- switch(RNA_enum_get(ptr, "rotation_mode")) {
+
+ switch (RNA_enum_get(ptr, "rotation_mode")) {
case ROT_MODE_QUAT: /* quaternion */
colsub = uiLayoutColumn(split, 1);
- uiItemR(colsub, ptr, "rotation_quaternion", 0, "Rotation", ICON_NONE);
+ uiItemR(colsub, ptr, "rotation_quaternion", 0, IFACE_("Rotation"), ICON_NONE);
colsub = uiLayoutColumn(split, 1);
- uiItemR(colsub, ptr, "lock_rotations_4d", UI_ITEM_R_TOGGLE, "4L", ICON_NONE);
+ uiItemR(colsub, ptr, "lock_rotations_4d", UI_ITEM_R_TOGGLE, IFACE_("4L"), ICON_NONE);
if (RNA_boolean_get(ptr, "lock_rotations_4d"))
uiItemR(colsub, ptr, "lock_rotation_w", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
else
uiItemL(colsub, "", ICON_NONE);
- uiItemR(colsub, ptr, "lock_rotation", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
+ uiItemR(colsub, ptr, "lock_rotation", UI_ITEM_R_TOGGLE | UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
break;
case ROT_MODE_AXISANGLE: /* axis angle */
colsub = uiLayoutColumn(split, 1);
- uiItemR(colsub, ptr, "rotation_axis_angle", 0, "Rotation", ICON_NONE);
+ uiItemR(colsub, ptr, "rotation_axis_angle", 0, IFACE_("Rotation"), ICON_NONE);
colsub = uiLayoutColumn(split, 1);
- uiItemR(colsub, ptr, "lock_rotations_4d", UI_ITEM_R_TOGGLE, "4L", ICON_NONE);
+ uiItemR(colsub, ptr, "lock_rotations_4d", UI_ITEM_R_TOGGLE, IFACE_("4L"), ICON_NONE);
if (RNA_boolean_get(ptr, "lock_rotations_4d"))
- uiItemR(colsub, ptr, "lock_rotation_w", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
+ uiItemR(colsub, ptr, "lock_rotation_w", UI_ITEM_R_TOGGLE | UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
else
uiItemL(colsub, "", ICON_NONE);
- uiItemR(colsub, ptr, "lock_rotation", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
+ uiItemR(colsub, ptr, "lock_rotation", UI_ITEM_R_TOGGLE | UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
break;
default: /* euler rotations */
colsub = uiLayoutColumn(split, 1);
- uiItemR(colsub, ptr, "rotation_euler", 0, "Rotation", ICON_NONE);
+ uiItemR(colsub, ptr, "rotation_euler", 0, IFACE_("Rotation"), ICON_NONE);
colsub = uiLayoutColumn(split, 1);
uiItemL(colsub, "", ICON_NONE);
- uiItemR(colsub, ptr, "lock_rotation", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
+ uiItemR(colsub, ptr, "lock_rotation", UI_ITEM_R_TOGGLE | UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
break;
}
uiItemR(layout, ptr, "rotation_mode", 0, "", ICON_NONE);
-
+
split = uiLayoutSplit(layout, 0.8, 0);
colsub = uiLayoutColumn(split, 1);
- uiItemR(colsub, ptr, "scale", 0, "Scale", ICON_NONE);
+ uiItemR(colsub, ptr, "scale", 0, NULL, ICON_NONE);
colsub = uiLayoutColumn(split, 1);
uiItemL(colsub, "", ICON_NONE);
- uiItemR(colsub, ptr, "lock_scale", UI_ITEM_R_TOGGLE+UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
-
+ uiItemR(colsub, ptr, "lock_scale", UI_ITEM_R_TOGGLE | UI_ITEM_R_ICON_ONLY, "", ICON_NONE);
+
if (ptr->type == &RNA_Object) {
Object *ob = ptr->data;
/* dimensions and material support just happen to be the same checks
* later we may want to add dimensions for lattice, armature etc too */
if (OB_TYPE_SUPPORT_MATERIAL(ob->type)) {
- uiItemR(layout, ptr, "dimensions", 0, "Dimensions", ICON_NONE);
+ uiItemR(layout, ptr, "dimensions", 0, NULL, ICON_NONE);
}
}
}
static void v3d_posearmature_buts(uiLayout *layout, Object *ob)
{
-// uiBlock *block= uiLayoutGetBlock(layout);
-// bArmature *arm;
+/* uiBlock *block = uiLayoutGetBlock(layout); */
+/* bArmature *arm; */
bPoseChannel *pchan;
-// TransformProperties *tfp= v3d->properties_storage;
+/* TransformProperties *tfp = v3d->properties_storage; */
PointerRNA pchanptr;
uiLayout *col;
-// uiLayout *row;
-// uiBut *but;
+/* uiLayout *row; */
+/* uiBut *but; */
- pchan= get_active_posechannel(ob);
+ pchan = get_active_posechannel(ob);
+
+/* row = uiLayoutRow(layout, 0); */
-// row= uiLayoutRow(layout, 0);
-
if (!pchan) {
- uiItemL(layout, "No Bone Active", ICON_NONE);
- return;
+ uiItemL(layout, IFACE_("No Bone Active"), ICON_NONE);
+ return;
}
RNA_pointer_create(&ob->id, &RNA_PoseBone, pchan, &pchanptr);
- col= uiLayoutColumn(layout, 0);
-
+ col = uiLayoutColumn(layout, 0);
+
/* XXX: RNA buts show data in native types (i.e. quats, 4-component axis/angle, etc.)
* but oldskool UI shows in eulers always. Do we want to be able to still display in Eulers?
* Maybe needs RNA/ui options to display rotations as different types... */
v3d_transform_butsR(col, &pchanptr);
-#if 0
+#if 0 /* TODO: delete this? */
uiLayoutAbsoluteBlock(layout);
if (pchan->rotmode == ROT_MODE_AXISANGLE) {
@@ -977,10 +1000,10 @@ static void v3d_posearmature_buts(uiLayout *layout, Object *ob)
tfp->ob_eul[0]*= RAD2DEGF(1.0f);
tfp->ob_eul[1]*= RAD2DEGF(1.0f);
tfp->ob_eul[2]*= RAD2DEGF(1.0f);
-
- uiDefBut(block, LABEL, 0, "Location:", 0, 240, 100, 20, 0, 0, 0, 0, 0, "");
+
+ uiDefBut(block, LABEL, 0, "Location:", 0, 240, 100, 20, 0, 0, 0, 0, 0, "");
uiBlockBeginAlign(block);
-
+
but= uiDefButF(block, NUM, B_ARMATUREPANEL2, "X:", 0, 220, 120, 19, pchan->loc, -lim, lim, 100, 3, "");
uiButSetUnitType(but, PROP_UNIT_LENGTH);
but= uiDefButF(block, NUM, B_ARMATUREPANEL2, "Y:", 0, 200, 120, 19, pchan->loc+1, -lim, lim, 100, 3, "");
@@ -988,33 +1011,33 @@ static void v3d_posearmature_buts(uiLayout *layout, Object *ob)
but= uiDefButF(block, NUM, B_ARMATUREPANEL2, "Z:", 0, 180, 120, 19, pchan->loc+2, -lim, lim, 100, 3, "");
uiButSetUnitType(but, PROP_UNIT_LENGTH);
uiBlockEndAlign(block);
-
+
uiBlockBeginAlign(block);
uiDefIconButBitS(block, ICONTOG, OB_LOCK_LOCX, B_REDR, ICON_UNLOCKED, 125, 220, 25, 19, &(pchan->protectflag), 0, 0, 0, 0, "Protects X Location value from being Transformed");
uiDefIconButBitS(block, ICONTOG, OB_LOCK_LOCY, B_REDR, ICON_UNLOCKED, 125, 200, 25, 19, &(pchan->protectflag), 0, 0, 0, 0, "Protects Y Location value from being Transformed");
uiDefIconButBitS(block, ICONTOG, OB_LOCK_LOCZ, B_REDR, ICON_UNLOCKED, 125, 180, 25, 19, &(pchan->protectflag), 0, 0, 0, 0, "Protects Z Location value from being Transformed");
uiBlockEndAlign(block);
-
+
uiDefBut(block, LABEL, 0, "Rotation:", 0, 160, 100, 20, 0, 0, 0, 0, 0, "");
uiBlockBeginAlign(block);
uiDefButF(block, NUM, B_ARMATUREPANEL3, "X:", 0, 140, 120, 19, tfp->ob_eul, -1000.0, 1000.0, 100, 3, "");
uiDefButF(block, NUM, B_ARMATUREPANEL3, "Y:", 0, 120, 120, 19, tfp->ob_eul+1, -1000.0, 1000.0, 100, 3, "");
uiDefButF(block, NUM, B_ARMATUREPANEL3, "Z:", 0, 100, 120, 19, tfp->ob_eul+2, -1000.0, 1000.0, 100, 3, "");
uiBlockEndAlign(block);
-
+
uiBlockBeginAlign(block);
uiDefIconButBitS(block, ICONTOG, OB_LOCK_ROTX, B_REDR, ICON_UNLOCKED, 125, 140, 25, 19, &(pchan->protectflag), 0, 0, 0, 0, "Protects X Rotation value from being Transformed");
uiDefIconButBitS(block, ICONTOG, OB_LOCK_ROTY, B_REDR, ICON_UNLOCKED, 125, 120, 25, 19, &(pchan->protectflag), 0, 0, 0, 0, "Protects Y Rotation value from being Transformed");
uiDefIconButBitS(block, ICONTOG, OB_LOCK_ROTZ, B_REDR, ICON_UNLOCKED, 125, 100, 25, 19, &(pchan->protectflag), 0, 0, 0, 0, "Protects Z Rotation value from being Transformed");
uiBlockEndAlign(block);
-
+
uiDefBut(block, LABEL, 0, "Scale:", 0, 80, 100, 20, 0, 0, 0, 0, 0, "");
uiBlockBeginAlign(block);
uiDefButF(block, NUM, B_ARMATUREPANEL2, "X:", 0, 60, 120, 19, pchan->size, -lim, lim, 10, 3, "");
uiDefButF(block, NUM, B_ARMATUREPANEL2, "Y:", 0, 40, 120, 19, pchan->size+1, -lim, lim, 10, 3, "");
uiDefButF(block, NUM, B_ARMATUREPANEL2, "Z:", 0, 20, 120, 19, pchan->size+2, -lim, lim, 10, 3, "");
uiBlockEndAlign(block);
-
+
uiBlockBeginAlign(block);
uiDefIconButBitS(block, ICONTOG, OB_LOCK_SCALEX, B_REDR, ICON_UNLOCKED, 125, 60, 25, 19, &(pchan->protectflag), 0, 0, 0, 0, "Protects X Scale value from being Transformed");
uiDefIconButBitS(block, ICONTOG, OB_LOCK_SCALEY, B_REDR, ICON_UNLOCKED, 125, 40, 25, 19, &(pchan->protectflag), 0, 0, 0, 0, "Protects Y Scale value from being Transformed");
@@ -1027,7 +1050,7 @@ static void v3d_posearmature_buts(uiLayout *layout, Object *ob)
#if 0
static void validate_editbonebutton_cb(bContext *C, void *bonev, void *namev)
{
- EditBone *eBone= bonev;
+ EditBone *eBone = bonev;
char oldname[sizeof(eBone->name)], newname[sizeof(eBone->name)];
/* need to be on the stack */
@@ -1036,185 +1059,186 @@ static void validate_editbonebutton_cb(bContext *C, void *bonev, void *namev)
/* restore */
BLI_strncpy(eBone->name, oldname, sizeof(eBone->name));
- ED_armature_bone_rename(CTX_data_edit_object(C)->data, oldname, newname); // editarmature.c
- WM_event_add_notifier(C, NC_OBJECT|ND_BONE_SELECT, CTX_data_edit_object(C)); // XXX fix
+ ED_armature_bone_rename(CTX_data_edit_object(C)->data, oldname, newname); /* editarmature.c */
+ WM_event_add_notifier(C, NC_OBJECT | ND_BONE_SELECT, CTX_data_edit_object(C)); /* XXX fix */
}
#endif
static void v3d_editarmature_buts(uiLayout *layout, Object *ob)
{
-// uiBlock *block= uiLayoutGetBlock(layout);
- bArmature *arm= ob->data;
+/* uiBlock *block = uiLayoutGetBlock(layout); */
+ bArmature *arm = ob->data;
EditBone *ebone;
-// TransformProperties *tfp= v3d->properties_storage;
-// uiLayout *row;
+/* TransformProperties *tfp = v3d->properties_storage; */
+/* uiLayout *row; */
uiLayout *col;
PointerRNA eboneptr;
-
- ebone= arm->act_edbone;
- if (!ebone || (ebone->layer & arm->layer)==0) {
- uiItemL(layout, "Nothing selected", ICON_NONE);
+ ebone = arm->act_edbone;
+
+ if (!ebone || (ebone->layer & arm->layer) == 0) {
+ uiItemL(layout, IFACE_("Nothing selected"), ICON_NONE);
return;
}
-// row= uiLayoutRow(layout, 0);
+/* row = uiLayoutRow(layout, 0); */
RNA_pointer_create(&arm->id, &RNA_EditBone, ebone, &eboneptr);
- col= uiLayoutColumn(layout, 0);
- uiItemR(col, &eboneptr, "head", 0, "Head", ICON_NONE);
+ col = uiLayoutColumn(layout, 0);
+ uiItemR(col, &eboneptr, "head", 0, NULL, ICON_NONE);
if (ebone->parent && ebone->flag & BONE_CONNECTED ) {
PointerRNA parptr = RNA_pointer_get(&eboneptr, "parent");
- uiItemR(col, &parptr, "tail_radius", 0, "Radius (Parent)", ICON_NONE);
+ uiItemR(col, &parptr, "tail_radius", 0, IFACE_("Radius (Parent)"), ICON_NONE);
}
else {
- uiItemR(col, &eboneptr, "head_radius", 0, "Radius", ICON_NONE);
+ uiItemR(col, &eboneptr, "head_radius", 0, IFACE_("Radius"), ICON_NONE);
}
-
- uiItemR(col, &eboneptr, "tail", 0, "Tail", ICON_NONE);
- uiItemR(col, &eboneptr, "tail_radius", 0, "Radius", ICON_NONE);
-
- uiItemR(col, &eboneptr, "roll", 0, "Roll", ICON_NONE);
- uiItemR(col, &eboneptr, "envelope_distance", 0, "Envelope", ICON_NONE);
+
+ uiItemR(col, &eboneptr, "tail", 0, NULL, ICON_NONE);
+ uiItemR(col, &eboneptr, "tail_radius", 0, IFACE_("Radius"), ICON_NONE);
+
+ uiItemR(col, &eboneptr, "roll", 0, NULL, ICON_NONE);
+ uiItemR(col, &eboneptr, "envelope_distance", 0, IFACE_("Envelope"), ICON_NONE);
}
static void v3d_editmetaball_buts(uiLayout *layout, Object *ob)
{
PointerRNA mbptr, ptr;
- MetaBall *mball= ob->data;
-// uiLayout *row;
+ MetaBall *mball = ob->data;
+/* uiLayout *row; */
uiLayout *col;
-
- if (!mball || !(mball->lastelem)) return;
-
+
+ if (!mball || !(mball->lastelem))
+ return;
+
RNA_pointer_create(&mball->id, &RNA_MetaBall, mball, &mbptr);
-
-// row= uiLayoutRow(layout, 0);
+
+/* row = uiLayoutRow(layout, 0); */
RNA_pointer_create(&mball->id, &RNA_MetaElement, mball->lastelem, &ptr);
-
- col= uiLayoutColumn(layout, 0);
- uiItemR(col, &ptr, "co", 0, "Location", ICON_NONE);
-
- uiItemR(col, &ptr, "radius", 0, "Radius", ICON_NONE);
- uiItemR(col, &ptr, "stiffness", 0, "Stiffness", ICON_NONE);
-
- uiItemR(col, &ptr, "type", 0, "Type", ICON_NONE);
-
- col= uiLayoutColumn(layout, 1);
+
+ col = uiLayoutColumn(layout, 0);
+ uiItemR(col, &ptr, "co", 0, NULL, ICON_NONE);
+
+ uiItemR(col, &ptr, "radius", 0, NULL, ICON_NONE);
+ uiItemR(col, &ptr, "stiffness", 0, NULL, ICON_NONE);
+
+ uiItemR(col, &ptr, "type", 0, NULL, ICON_NONE);
+
+ col = uiLayoutColumn(layout, 1);
switch (RNA_enum_get(&ptr, "type")) {
case MB_BALL:
break;
case MB_CUBE:
- uiItemL(col, "Size:", ICON_NONE);
+ uiItemL(col, IFACE_("Size:"), ICON_NONE);
uiItemR(col, &ptr, "size_x", 0, "X", ICON_NONE);
uiItemR(col, &ptr, "size_y", 0, "Y", ICON_NONE);
uiItemR(col, &ptr, "size_z", 0, "Z", ICON_NONE);
break;
case MB_TUBE:
- uiItemL(col, "Size:", ICON_NONE);
+ uiItemL(col, IFACE_("Size:"), ICON_NONE);
uiItemR(col, &ptr, "size_x", 0, "X", ICON_NONE);
break;
case MB_PLANE:
- uiItemL(col, "Size:", ICON_NONE);
+ uiItemL(col, IFACE_("Size:"), ICON_NONE);
uiItemR(col, &ptr, "size_x", 0, "X", ICON_NONE);
uiItemR(col, &ptr, "size_y", 0, "Y", ICON_NONE);
break;
case MB_ELIPSOID:
- uiItemL(col, "Size:", ICON_NONE);
+ uiItemL(col, IFACE_("Size:"), ICON_NONE);
uiItemR(col, &ptr, "size_x", 0, "X", ICON_NONE);
uiItemR(col, &ptr, "size_y", 0, "Y", ICON_NONE);
uiItemR(col, &ptr, "size_z", 0, "Z", ICON_NONE);
- break;
- }
+ break;
+ }
}
static void do_view3d_region_buttons(bContext *C, void *UNUSED(index), int event)
{
- Main *bmain= CTX_data_main(C);
- Scene *scene= CTX_data_scene(C);
-// Object *obedit= CTX_data_edit_object(C);
- View3D *v3d= CTX_wm_view3d(C);
-// BoundBox *bb;
- Object *ob= OBACT;
- TransformProperties *tfp= v3d->properties_storage;
-
- switch(event) {
-
+ Main *bmain = CTX_data_main(C);
+ Scene *scene = CTX_data_scene(C);
+/* Object *obedit = CTX_data_edit_object(C); */
+ View3D *v3d = CTX_wm_view3d(C);
+/* BoundBox *bb; */
+ Object *ob = OBACT;
+ TransformProperties *tfp = v3d->properties_storage;
+
+ switch (event) {
+
case B_REDR:
ED_area_tag_redraw(CTX_wm_area(C));
return; /* no notifier! */
-
+
case B_OBJECTPANEL:
DAG_id_tag_update(&ob->id, OB_RECALC_OB);
break;
-
case B_OBJECTPANELMEDIAN:
if (ob) {
v3d_editvertex_buts(NULL, v3d, ob, 1.0);
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
}
break;
-
/* note; this case also used for parbone */
+
case B_OBJECTPANELPARENT:
if (ob) {
if (ob->id.lib || BKE_object_parent_loop_check(ob->parent, ob))
- ob->parent= NULL;
+ ob->parent = NULL;
else {
DAG_scene_sort(bmain, scene);
DAG_id_tag_update(&ob->id, OB_RECALC_OB);
}
}
break;
-
- case B_ARMATUREPANEL3: // rotate button on channel
+ case B_ARMATUREPANEL3: /* rotate button on channel */
{
bPoseChannel *pchan;
float eul[3];
-
- pchan= get_active_posechannel(ob);
- if (!pchan) return;
-
+
+ pchan = get_active_posechannel(ob);
+ if (!pchan)
+ return;
+
/* make a copy to eul[3], to allow TAB on buttons to work */
- eul[0]= DEG2RADF(tfp->ob_eul[0]);
- eul[1]= DEG2RADF(tfp->ob_eul[1]);
- eul[2]= DEG2RADF(tfp->ob_eul[2]);
-
+ eul[0] = DEG2RADF(tfp->ob_eul[0]);
+ eul[1] = DEG2RADF(tfp->ob_eul[1]);
+ eul[2] = DEG2RADF(tfp->ob_eul[2]);
+
if (pchan->rotmode == ROT_MODE_AXISANGLE) {
float quat[4];
/* convert to axis-angle, passing through quats */
- eul_to_quat( quat,eul);
- quat_to_axis_angle( pchan->rotAxis, &pchan->rotAngle,quat);
+ eul_to_quat(quat, eul);
+ quat_to_axis_angle(pchan->rotAxis, &pchan->rotAngle, quat);
}
else if (pchan->rotmode == ROT_MODE_QUAT)
- eul_to_quat( pchan->quat,eul);
+ eul_to_quat(pchan->quat, eul);
else
copy_v3_v3(pchan->eul, eul);
}
/* no break, pass on */
+
case B_ARMATUREPANEL2:
- {
- ob->pose->flag |= (POSE_LOCKED|POSE_DO_UNLOCK);
- DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
- }
+ ob->pose->flag |= (POSE_LOCKED|POSE_DO_UNLOCK);
+ DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
break;
+
case B_TRANSFORMSPACEADD:
- {
- char names[sizeof(((TransformOrientation *)NULL)->name)]= "";
- BIF_createTransformOrientation(C, NULL, names, 1, 0);
+ {
+ char names[sizeof(((TransformOrientation *)NULL)->name)] = "";
+ BIF_createTransformOrientation(C, NULL, names, 1, 0);
+ }
break;
- }
+
case B_TRANSFORMSPACECLEAR:
BIF_clearTransformOrientation(C);
break;
-
-#if 0 // XXX
+
+#if 0 /* XXX */
case B_WEIGHT0_0:
wpaint->weight = 0.0f;
break;
-
+
case B_WEIGHT1_4:
wpaint->weight = 0.25f;
break;
@@ -1227,7 +1251,7 @@ static void do_view3d_region_buttons(bContext *C, void *UNUSED(index), int event
case B_WEIGHT1_0:
wpaint->weight = 1.0f;
break;
-
+
case B_OPA1_8:
wpaint->a = 0.125f;
break;
@@ -1245,46 +1269,47 @@ static void do_view3d_region_buttons(bContext *C, void *UNUSED(index), int event
break;
#endif
case B_CLR_WPAINT:
-// if (!multires_level1_test()) {
+/* if (!multires_level1_test()) { */
{
bDeformGroup *defGroup = BLI_findlink(&ob->defbase, ob->actdef-1);
if (defGroup) {
- Mesh *me= ob->data;
+ Mesh *me = ob->data;
int a;
- for (a=0; a<me->totvert; a++)
+ for (a = 0; a < me->totvert; a++)
ED_vgroup_vert_remove (ob, defGroup, a);
DAG_id_tag_update(&ob->id, OB_RECALC_DATA);
}
}
break;
+
case B_RV3D_LOCKED:
case B_RV3D_BOXVIEW:
case B_RV3D_BOXCLIP:
{
- ScrArea *sa= CTX_wm_area(C);
- ARegion *ar= sa->regionbase.last;
+ ScrArea *sa = CTX_wm_area(C);
+ ARegion *ar = sa->regionbase.last;
RegionView3D *rv3d;
short viewlock;
-
- ar= ar->prev;
- rv3d= ar->regiondata;
- viewlock= rv3d->viewlock;
-
- if ((viewlock & RV3D_LOCKED)==0)
- viewlock= 0;
- else if ((viewlock & RV3D_BOXVIEW)==0)
+
+ ar = ar->prev;
+ rv3d = ar->regiondata;
+ viewlock = rv3d->viewlock;
+
+ if (!(viewlock & RV3D_LOCKED))
+ viewlock = 0;
+ else if (!(viewlock & RV3D_BOXVIEW))
viewlock &= ~RV3D_BOXCLIP;
-
- for (; ar; ar= ar->prev) {
- if (ar->alignment==RGN_ALIGN_QSPLIT) {
- rv3d= ar->regiondata;
- rv3d->viewlock= viewlock;
+
+ for (; ar; ar = ar->prev) {
+ if (ar->alignment == RGN_ALIGN_QSPLIT) {
+ rv3d = ar->regiondata;
+ rv3d->viewlock = viewlock;
}
}
-
+
if (rv3d->viewlock & RV3D_BOXVIEW)
view3d_boxview_copy(sa, sa->regionbase.last);
-
+
ED_area_tag_redraw(sa);
}
break;
@@ -1297,78 +1322,82 @@ static void do_view3d_region_buttons(bContext *C, void *UNUSED(index), int event
static void view3d_panel_object(const bContext *C, Panel *pa)
{
uiBlock *block;
- Scene *scene= CTX_data_scene(C);
- Object *obedit= CTX_data_edit_object(C);
- View3D *v3d= CTX_wm_view3d(C);
- //uiBut *bt;
- Object *ob= OBACT;
- // TransformProperties *tfp; // UNUSED
+ Scene *scene = CTX_data_scene(C);
+ Object *obedit = CTX_data_edit_object(C);
+ View3D *v3d = CTX_wm_view3d(C);
+ /* uiBut *bt; */
+ Object *ob = OBACT;
+ /* TransformProperties *tfp; */ /* UNUSED */
PointerRNA obptr;
uiLayout *col /* , *row */ /* UNUSED */;
float lim;
-
- if (ob==NULL) return;
+
+ if (ob == NULL)
+ return;
/* make sure we got storage */
#if 0
- if (v3d->properties_storage==NULL)
- v3d->properties_storage= MEM_callocN(sizeof(TransformProperties), "TransformProperties");
- tfp= v3d->properties_storage;
+ if (v3d->properties_storage == NULL)
+ v3d->properties_storage = MEM_callocN(sizeof(TransformProperties), "TransformProperties");
+ tfp = v3d->properties_storage;
-// XXX uiSetButLock(object_is_libdata(ob), ERROR_LIBDATA_MESSAGE);
+ /* XXX uiSetButLock(object_is_libdata(ob), ERROR_LIBDATA_MESSAGE); */
if (ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT|OB_MODE_TEXTURE_PAINT)) {
}
else {
- if ((ob->mode & OB_MODE_PARTICLE_EDIT)==0) {
+ if ((ob->mode & OB_MODE_PARTICLE_EDIT) == 0) {
uiBlockEndAlign(block);
}
}
#endif
- lim= 10000.0f * MAX2(1.0f, v3d->grid);
+ lim = 10000.0f * MAX2(1.0f, v3d->grid);
- block= uiLayoutGetBlock(pa->layout);
+ block = uiLayoutGetBlock(pa->layout);
uiBlockSetHandleFunc(block, do_view3d_region_buttons, NULL);
- col= uiLayoutColumn(pa->layout, 0);
- /* row= uiLayoutRow(col, 0); */ /* UNUSED */
+ col = uiLayoutColumn(pa->layout, 0);
+ /* row = uiLayoutRow(col, 0); */ /* UNUSED */
RNA_id_pointer_create(&ob->id, &obptr);
- if (ob==obedit) {
- if (ob->type==OB_ARMATURE) v3d_editarmature_buts(col, ob);
- else if (ob->type==OB_MBALL) v3d_editmetaball_buts(col, ob);
- else v3d_editvertex_buts(col, v3d, ob, lim);
+ if (ob == obedit) {
+ if (ob->type == OB_ARMATURE)
+ v3d_editarmature_buts(col, ob);
+ else if (ob->type == OB_MBALL)
+ v3d_editmetaball_buts(col, ob);
+ else
+ v3d_editvertex_buts(col, v3d, ob, lim);
}
else if (ob->mode & OB_MODE_POSE) {
v3d_posearmature_buts(col, ob);
}
else {
-
v3d_transform_butsR(col, &obptr);
}
}
#if 0
-static void view3d_panel_preview(bContext *C, ARegion *ar, short cntrl) // VIEW3D_HANDLER_PREVIEW
+static void view3d_panel_preview(bContext *C, ARegion *ar, short cntrl) /* VIEW3D_HANDLER_PREVIEW */
{
uiBlock *block;
- View3D *v3d= sa->spacedata.first;
+ View3D *v3d = sa->spacedata.first;
int ofsx, ofsy;
-
- block= uiBeginBlock(C, ar, __func__, UI_EMBOSS);
+
+ block = uiBeginBlock(C, ar, __func__, UI_EMBOSS);
uiPanelControl(UI_PNL_SOLID | UI_PNL_CLOSE | UI_PNL_SCALE | cntrl);
- uiSetPanelHandler(VIEW3D_HANDLER_PREVIEW); // for close and esc
-
- ofsx= -150+(sa->winx/2)/v3d->blockscale;
- ofsy= -100+(sa->winy/2)/v3d->blockscale;
- if (uiNewPanel(C, ar, block, "Preview", "View3d", ofsx, ofsy, 300, 200)==0) return;
+ uiSetPanelHandler(VIEW3D_HANDLER_PREVIEW); /* for close and esc */
+
+ ofsx = -150 + (sa->winx/2) / v3d->blockscale;
+ ofsy = -100 + (sa->winy/2) / v3d->blockscale;
+ if (uiNewPanel(C, ar, block, "Preview", "View3d", ofsx, ofsy, 300, 200) == 0)
+ return;
uiBlockSetDrawExtraFunc(block, BIF_view3d_previewdraw);
-
+
if (scene->recalc & SCE_PRV_CHANGED) {
scene->recalc &= ~SCE_PRV_CHANGED;
- //printf("found recalc\n");
+ /* printf("found recalc\n"); */
BIF_view3d_previewrender_free(sa->spacedata.first);
BIF_preview_changed(0);
}
@@ -1379,33 +1408,33 @@ void view3d_buttons_register(ARegionType *art)
{
PanelType *pt;
- pt= MEM_callocN(sizeof(PanelType), "spacetype view3d panel object");
+ pt = MEM_callocN(sizeof(PanelType), "spacetype view3d panel object");
strcpy(pt->idname, "VIEW3D_PT_object");
strcpy(pt->label, "Transform");
- pt->draw= view3d_panel_object;
+ pt->draw = view3d_panel_object;
BLI_addtail(&art->paneltypes, pt);
-
- pt= MEM_callocN(sizeof(PanelType), "spacetype view3d panel gpencil");
+
+ pt = MEM_callocN(sizeof(PanelType), "spacetype view3d panel gpencil");
strcpy(pt->idname, "VIEW3D_PT_gpencil");
strcpy(pt->label, "Grease Pencil");
- pt->draw= gpencil_panel_standard;
+ pt->draw = gpencil_panel_standard;
BLI_addtail(&art->paneltypes, pt);
- pt= MEM_callocN(sizeof(PanelType), "spacetype view3d panel vgroup");
+ pt = MEM_callocN(sizeof(PanelType), "spacetype view3d panel vgroup");
strcpy(pt->idname, "VIEW3D_PT_vgroup");
strcpy(pt->label, "Vertex Groups");
- pt->draw= view3d_panel_vgroup;
- pt->poll= view3d_panel_vgroup_poll;
+ pt->draw = view3d_panel_vgroup;
+ pt->poll = view3d_panel_vgroup_poll;
BLI_addtail(&art->paneltypes, pt);
- // XXX view3d_panel_preview(C, ar, 0);
+ /* XXX view3d_panel_preview(C, ar, 0); */
}
static int view3d_properties(bContext *C, wmOperator *UNUSED(op))
{
- ScrArea *sa= CTX_wm_area(C);
- ARegion *ar= view3d_has_buttons_region(sa);
-
+ ScrArea *sa = CTX_wm_area(C);
+ ARegion *ar = view3d_has_buttons_region(sa);
+
if (ar)
ED_region_toggle_hidden(C, ar);
@@ -1414,13 +1443,13 @@ static int view3d_properties(bContext *C, wmOperator *UNUSED(op))
void VIEW3D_OT_properties(wmOperatorType *ot)
{
- ot->name= "Properties";
- ot->description= "Toggles the properties panel display";
- ot->idname= "VIEW3D_OT_properties";
-
- ot->exec= view3d_properties;
- ot->poll= ED_operator_view3d_active;
-
+ ot->name = "Properties";
+ ot->description = "Toggles the properties panel display";
+ ot->idname = "VIEW3D_OT_properties";
+
+ ot->exec = view3d_properties;
+ ot->poll = ED_operator_view3d_active;
+
/* flags */
- ot->flag= 0;
+ ot->flag = 0;
}
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c
index eacd814c926..ccd1934b26a 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -225,13 +225,15 @@ static void rna_def_gpencil_layer(BlenderRNA *brna)
/* Onion-Skinning */
prop= RNA_def_property(srna, "use_onion_skinning", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_ONIONSKIN);
- RNA_def_property_ui_text(prop, "Use Onion Skinning", "Ghost frames on either side of frame");
+ RNA_def_property_ui_text(prop, "Onion Skinning", "Ghost frames on either side of frame");
RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
prop= RNA_def_property(srna, "ghost_range_max", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "gstep");
RNA_def_property_range(prop, 0, 120);
- RNA_def_property_ui_text(prop, "Max Ghost Range", "Maximum number of frames on either side of the active frame to show (0 = show the 'first' available sketch on either side)");
+ RNA_def_property_ui_text(prop, "Max Ghost Range",
+ "Maximum number of frames on either side of the active frame to show "
+ "(0 = show the 'first' available sketch on either side)");
RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
/* Flags */
@@ -273,7 +275,7 @@ static void rna_def_gpencil_layer(BlenderRNA *brna)
/* X-Ray */
prop= RNA_def_property(srna, "show_x_ray", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", GP_LAYER_NO_XRAY);
- RNA_def_property_ui_text(prop, "X Ray", "");
+ RNA_def_property_ui_text(prop, "X Ray", "Make the layer draw in front of objects");
RNA_def_property_update(prop, NC_SCREEN|ND_GPENCIL, NULL);
}
diff --git a/source/blender/render/CMakeLists.txt b/source/blender/render/CMakeLists.txt
index 51c5d49208e..a2d6e27bcb7 100644
--- a/source/blender/render/CMakeLists.txt
+++ b/source/blender/render/CMakeLists.txt
@@ -27,6 +27,7 @@
set(INC
extern/include
intern/include
+ ../blenfont
../blenkernel
../blenlib
../blenloader
diff --git a/source/blender/render/SConscript b/source/blender/render/SConscript
index 99ff10d19eb..53af2f9b2c2 100644
--- a/source/blender/render/SConscript
+++ b/source/blender/render/SConscript
@@ -5,7 +5,7 @@ sources = env.Glob('intern/source/*.c')
raysources = env.Glob('intern/raytrace/*.cpp')
incs = 'intern/include #/intern/guardedalloc ../blenlib ../makesdna ../makesrna'
-incs += ' extern/include ../blenkernel ../radiosity/extern/include ../imbuf'
+incs += ' extern/include ../blenkernel ../radiosity/extern/include ../imbuf ../blenfont'
incs += ' ../include ../blenloader ../../../intern/smoke/extern ../../../intern/mikktspace ../bmesh'
cflags_raytrace = env['CCFLAGS']
diff --git a/source/blender/render/intern/source/external_engine.c b/source/blender/render/intern/source/external_engine.c
index 703ca23c15b..335de2dd055 100644
--- a/source/blender/render/intern/source/external_engine.c
+++ b/source/blender/render/intern/source/external_engine.c
@@ -36,6 +36,8 @@
#include "MEM_guardedalloc.h"
+#include "BLF_translation.h"
+
#include "BLI_listbase.h"
#include "BLI_string.h"
#include "BLI_utildefines.h"
@@ -60,7 +62,7 @@
static RenderEngineType internal_render_type = {
NULL, NULL,
- "BLENDER_RENDER", "Blender Render", RE_INTERNAL,
+ "BLENDER_RENDER", N_("Blender Render"), RE_INTERNAL,
NULL, NULL, NULL, NULL,
{NULL, NULL, NULL}};
@@ -68,7 +70,7 @@ static RenderEngineType internal_render_type = {
static RenderEngineType internal_game_type = {
NULL, NULL,
- "BLENDER_GAME", "Blender Game", RE_INTERNAL|RE_GAME,
+ "BLENDER_GAME", N_("Blender Game"), RE_INTERNAL|RE_GAME,
NULL, NULL, NULL, NULL,
{NULL, NULL, NULL}};
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 7f3fd9d1355..22b13a72795 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -692,7 +692,7 @@ int WM_menu_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(event))
return retval;
}
else {
- pup= uiPupMenuBegin(C, op->type->name, ICON_NONE);
+ pup= uiPupMenuBegin(C, IFACE_(op->type->name), ICON_NONE);
layout= uiPupMenuLayout(pup);
uiItemsFullEnumO(layout, op->type->idname, RNA_property_identifier(prop), op->ptr->data, WM_OP_EXEC_REGION_WIN, 0);
uiPupMenuEnd(C, pup);